- JOIN (INNER JOIN): Returns rows where there is a match in both tables.
- LEFT OUTER JOIN: Returns all rows from the left table and matching rows from the right table; unmatched rows in the right table are filled with
NULL
.
Example:
sql
-- JOIN
SELECT * FROM A INNER JOIN B ON A.id = B.id;
-- LEFT OUTER JOIN
SELECT * FROM A LEFT JOIN B ON A.id = B.id;