5 Joins Flashcards
joins
this will help in link 2 column together as one which came from different tables
inner join
In inner join we get common colums from different tables
syntax of inner join 1
select common column from common tables where table1.common column = table2.common column
synatax of inner join 2
select common column from common table1 INNER JOIN common column 2 on table1.common column = table2.common column
inner join return
this return common data in the table
Outer join
this return un common data in the table
Outer join Types
Left join, Right join , full join
Left join, Right join , full join also called as
Left outer join, Right outer join , full outer join
left join
This give more preference to first common column that comes after ON
Right join
This give more preference to last common column that comes after ON
Full join
If we want all uncommon data at single place.
Union
stack one data on top of another table,
union in null
this removes all duplicates
Duplicates in union
The union also remove the duplicates
union all
does not eliminate the duplicates even after specifying distinct