Joins in SQL
Joins in SQL
Anish Chakravorty
Follow me on LinkedIn
What Are Joins in SQL?
Syntax:
Example:
Left Join
Left Join returns all rows from the left table,
and the matched rows from the right table.
If no match, NULL values are returned.
Syntax:
Example:
Right Join
Right Join returns all rows from the right
table, and the matched rows from the left
table. If no match, NULL values are
returned.
Syntax:
Example:
Full Join
Full Join returns all rows from both tables,
with NULLs for non-matching rows.
Syntax:
Example:
Cross Join
Cross Join returns the Cartesian product of
two tables, pairing each row in the first
table with every row in the second.
Syntax:
Example:
Venn diagram for Joins
Key Notes on Joins