Home / Visual decks / SQL joins, visually
Visual deck · 10 scenes · 24 animation beats
SQL joins, visually
Two tables with a deliberate mismatch, and every join drawn as row-pairing lines: INNER, LEFT, RIGHT, FULL and the anti-join, plus the duplicate-key trap and a one-rule cheat sheet.
By Sitraka Forler · Lecturer, Durham Business SchoolUpdated 3 October 2026 About this site
Venn diagrams are the usual way to teach joins, and they are the reason people still get LEFT JOIN wrong. A join pairs rows, so this deck draws rows and the lines between them. A trade with no matching account gets no line, and you can see what INNER drops and what LEFT keeps, with the NULLs it fills in.
The two tables are trades and accounts, with one trade pointing at an account that does not exist and one account with no trades. Every join is run on exactly that data, so the result is never a surprise.
How to drive it
- Click or tap anywhere, or press Space or the right arrow: one press is one animation beat, so you can narrate between reveals.
- Left arrow or right click goes back one beat. Escape leaves the deck.
- The position is kept in the address bar (#scene.beat), so a link lands on the exact beat you were showing.
The 10 scenes
- 1Two tables, one deliberate mismatch on each side
- 2INNER JOIN: only the pairs
- 3LEFT JOIN: every left row, NULLs where nothing matched
- 4RIGHT JOIN: the mirror image, and why nobody writes it
- 5FULL OUTER JOIN: everything, paired where possible
- 6The anti-join: rows with no partner, found with LEFT JOIN and IS NULL
- 7The duplicate-key trap: one row becomes three
- 8Joining on two columns
- 9Filtering in ON versus in WHERE
- 10The one rule: decide which table must keep all its rows