The video for this lesson is being recorded.
Meanwhile, the notes below and the 60-second cards cover the same ideas.
Practise this topicInner joins
An inner join combines rows from two tables where a column matches, and drops rows with no match.
Remember: JOIN keeps only the matches.
Left joins
A left join keeps every row from the left table, with blanks (NULL) where there's no match.
Remember: LEFT JOIN = all of the left table, matches where they exist.
Try the example in Code Lab
SELECT s.name, d.dept_name FROM students s JOIN enrolments e ON e.student_id = s.id JOIN departments d ON d.id = e.dept_id ORDER BY s.id;