These questions use every join from the unit. Before writing each one, say what one row of the answer is and which rows must survive without a match. Then pick the join:
- the same table twice: a self join with two aliases;
- rows without a match on one side: LEFT (or RIGHT) JOIN; on both sides: FULL OUTER JOIN;
- every combination: CROSS JOIN, often followed by a
LEFT JOIN and COALESCE;
- ranges or several columns: put the whole condition in
ON.