Several Views on How to Teach JOINs
Teachers and tutorial writers explain JOINs in very different ways, and each way helps some learners more than others. This page lays out four common approaches side by side. They are composite viewpoints, not opinions of named people.
View 1: use Venn diagrams
The idea: draw two overlapping circles, one for each table. An inner join is the overlap; a left join is the whole left circle plus the overlap.
Why people like it: quick to draw, easy to remember, shows which rows are "kept".
The criticism: circles suggest each row appears once, but joins can produce many rows for one row when there are several matches. Learners may be surprised by duplicates.
View 2: match rows by hand
The idea: take two tiny tables, three or four rows each, and write out the result row by row, drawing lines between matching rows.
| students | enrolments | ||
|---|---|---|---|
| id | name | student_id | course |
| 1 | Ana | 1 | Maths |
| 2 | Ben | 1 | Art |
| 3 | Cy | 3 | Music |
Matching by hand shows that Ana appears twice (two courses), Cy once, and Ben not at all in an inner join.
Why people like it: it shows exactly what the database does, including duplicates and missing rows.
The criticism: it takes longer, and some learners find it tedious.
View 3: explain it as a loop in code
The idea: for learners who already program, show the join as nested loops:
for s in students:
for e in enrolments:
if e.student_id == s.id:
print(s.name, e.course)
Why people like it: it connects SQL to something programmers already understand.
The criticism: it can suggest the database always works this way, when real databases use cleverer methods. It also does not help learners who are not programmers yet.
View 4: start from a question
The idea: begin with a real question, such as "which students take Maths?", show that the answer needs data from two tables, and introduce JOIN as the tool for combining them.
Why people like it: it gives a reason to learn joins before the mechanics.
The criticism: without one of the other views, learners may copy the pattern without understanding it.
Side by side
| Approach | Shows duplicates clearly | Speed to explain | Best for |
|---|---|---|---|
| Venn diagrams | No | Fast | A first rough idea |
| Matching rows by hand | Yes | Slow | Real understanding |
| Loops in code | Yes | Medium | Learners who already program |
| Starting from a question | Depends | Medium | Motivation |
Where these views agree
Most teachers end up combining approaches: a question to motivate, tiny tables matched by hand to understand, and perhaps a diagram as a reminder. They also agree that LEFT JOIN deserves extra time, because learners often lose rows without noticing.
Try the hands-on approach
Our INNER JOIN and LEFT JOIN tutorial uses tiny tables you can match by hand, and several reader questions about JOINs cover the surprises that follow.
A free learning page for beginners. Practise on a test database, never on real customer data, and check the official documentation for your database version.
Illustrative outline only: no live session, recording, registration or certificate is offered on this site. Any speakers, panels or schedules mentioned are hypothetical.