LEFT JOIN
Lesson 14 of 24 · SQL.Micro
LEFT JOIN keeps every row of the left table, even without a match. Missing values on the right come back as NULL.
Use it to find 'who has none': customers without orders, products never sold.
Count with COUNT(o.id), not COUNT(*): NULLs are then counted as zero.
The table order matters: LEFT keeps the first one.
Check yourself
A customer has no orders. With LEFT JOIN, what is o.order_date on their row?
Show every customer's name and how many orders they placed, including those with zero.
Do it in the browser: a real SQL tool, a short mission and instant feedback. No install.
Start this lesson — free