FULL OUTER JOIN keeps matched and unmatched rows
FULL OUTER JOIN matches related rows using ON, then also keeps unmatched rows from both tables. Missing values on either side appear as NULL. It is useful when you need a complete comparison instead of favoring one table. Not every database supports it — older MySQL versions, for example, do not.
A tiny example
In plain English: Show me students next to their clubs, keeping students with no club and clubs with no students.
SELECT students.name AS student, clubs.name AS club
FROM students
FULL OUTER JOIN clubs ON students.club_id = clubs.id;What comes back
| student | club |
|---|---|
| Amara | Chess |
| Sana | NULL |
| NULL | Astronomy |
Amara matched Chess, Sana matched nothing (NULL for club), and Astronomy has no student (NULL for student).
Related SQL lessons
Ready for a break?
Take on today's cozy puzzle. A fresh, bite-sized query waits every morning — no timers, no pressure.
play today's sip