SQL Outer Join

SQL Outer Join: In equi-join and natural join, only the matching rows of both tables are added into the result that satisfy the join condition. Sometimes, it is the requirement of the user or organization that all the rows of one table or both tables should be included in the resultant table. For the purpose, the outer join is used. Therefore the outer join is defined as

“ A join in which matching rows as well as non-matching rows of one side table or both side table are also included in the query result, is called Outer Join.

Outer Join is further divided into two types.

SQL Left Outer Join

Left outer join adds every row of the first table in the result, if no matching tuple is found in the second table. The attributes included in the query result of the second table are filled with null values.

SQL Right Outer Join

Right Outer Join add every row of the second table in the result, if no matching tuple is found in the first table, then  the attributes of the first table are filled with null values.

SQL Joins

SQL Joins SQL Joins: A joins is a relational operation that combines row in one table to the rows in another table related table according to common values existing in…

Continue ReadingSQL Joins