Joins - Yousef's Notes
Joins

Joins

  • INNER JOIN
    • Returns only the rows that have matching values in both tables.
    • Commonly used for retrieving related data.
  • LEFT JOIN (or LEFT OUTER JOIN):
    • Returns all rows from the left table and the matching rows from the right table.
    • Non-matching rows from the left table have NULL values in the result.
  • RIGHT JOIN (or RIGHT OUTER JOIN):
    • Returns all rows from the right table and the matching rows from the left table.
    • Non-matching rows from the right table have NULL values in the result.
  • FULL OUTER JOIN:
    • Returns all rows when there is a match in either the left or the right table.
    • Non-matching rows from both tables have NULL values the result.