Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
0 Now, let us see the right join. Right join is similar to left join only that when we are doing the right join all rows 1
of the table b will be kept in the result set 2
Even if it is not present in the table A, wherever the table a vlaue is not present, will get null values. 3
This syntex of right join is also same only instead of left join we will write right join. 4
Let us look at the example. 5
So last time when we did left join, we were finding out against each sales order. 6
Who was the customer? 7
Even if there were some records where we did not have customer names, this time we want to find out 8
against all customer names if there is any sales value or not. 9
This we will do by using the right join on the customer table. 10
So customer table will be our table b again. 11
But we will have all values of this. 12
table b because will be doing the right join. 13
So what happens here is we will select all the column that we want with the same as the earlier examples 14
from sales table, which is our table a. Right join on table B, which is customer table. 15
Since we want all values of customers. 16
On the common field is customer id, and then we will order it by customer id, let's go and write this in the pgAdmin interface. 17
So again, you can see 10315 is not present in customer table. 18
Will this be President in the ResultSet? take a guess 19
10375 is President in both tables, 10480 is not present in sales table, So guess 20
which of these will be President in the ResultSet let us find out. 21
So select. 22
a.orderline 23
a.product id 24
a.customer id 25
sales. 26
next is b.customer name. 27
and b dot 28
Age from table a is our sales table 29
2015 as a. Right join 30
on customer table customer 2060 as b common field is customer id. 31
And we will ordered it by 32
customer id 33
Run. 34
So let's see which is present and which is not present, one zero three one five is not present. 35
Why is it not present, because it is not present in the customer table and we have done a right join. So, 36
all values of customer table should be present. 37
If it is not present in customer table, it should not be there. 38
So A10315 is not there. 39
10375 is present in both tables it should be there. But can you find 10480 40
? 41
It is not present in the sales table, but it is present in the customer table, so it should be part of the result set 42
Since Whiteaker, they join, but it is not here. 43
Where is it? 44
So let us go down. 45
And see that there are some values where customer that is coming as. 46
But it is part of the ResultSet. 47
These are the values, these are the records of customer table, which are here because these were not 48
present in the sales table and that is why it is giving a customer the idea of knowledge. 49
Since we were taking the customer I a table where there was no such record to get these records, let 50
us get the customer different. 51
They will be so let us change it to be and now run this query. 52
Now you can see. 53
Here is your customer ready, a one zero four zero. 54
You get the customer name and age because it is present in the customer table. 55
We are not getting the order line productivity and the sales value because it is not traditional staple. 56
And the second thing is this, customarily one zero three seven five. 57
This was present only once in the customizable. 58
So when I told you that it is taking out all the records of customer table, you may have thought that 59
it will give only one record and the is all set for this customer ready. 60
But that is not so since there were four different order values in the sales table for this particular 61
customer. 62
The ResultSet will have four different rules for this customer. 63
This is the concept I was conveying in the last letter also that if you want single value in the customer 64
table, you should ensure that the key that you're using should be primary or unique in the other table. 65
So this customer adds, if it was a unique key in the sales table, there would have been only one rule. 66
So this is how we use Ridvan. 67
In the next lecture, we will look at the Autotuning.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.