Good! Let's summarize what we have learned:
- You can join multiple tables with the
JOIN … ON construction. After the
JOIN keyword you need to specify the table you want to join. After the
ON keyword you need to specify the condition upon which you want to join the tables. The complete name of
LEFT JOIN is another commonly used type of
JOIN. It is used when we want to return ALL rows from the LEFT table, even if there are no matching rows from the right table.
- There is also the
RIGHT JOIN, which is the symmetric opposite of
FULL JOIN is a union of
LEFT JOIN and
RIGHT JOIN; it shows matching rows from both tables AND the rows that do not match from each table.
CROSS JOIN produces all possible combinations of rows from the first table joined with rows from the second table.