Sql join
Inner Join
-------------------
Inner Join returns only the matching rows in both the tables(i.e. returns only those rows for which the join condition satisfies).
Left Join
------------------
Left Outer Join/Left Join returns all the rows from the LEFT table and the corresponding matching rows from the right table. If right
table doesn’t have the matching record then for such records right table column will have NULL value in the result.
Right Join
-------------------
Right Outer Join/Right Join returns all the rows from the RIGHT table and the corresponding matching rows from the left table. If left
table doesn’t have the matching record then for such records left table column will have NULL value in the result.
Full Join
------------------
It returns all the rows from both the tables, if there is no matching row in either of the sides then it displays NULL values in the result
for that table columns in such rows.
Cross join
-------------------
Cross join is also referred to as Cartesian Product. For every row in the LEFT Table of the CROSS JOIN all the rows from the RIGHT table are
returned and Vice-Versa (i.e.result will have the Cartesian product of the rows from join tables).
SELF JOIN
-------------------
If a Table is joined to itself using one of the join types explained above, then such a type of join is called SELF JOIN.
No comments:
Post a Comment