Practice · Demographics · Hard
Return the name of every governorate that has NO UNESCO site in our data, alphabetically.
Runs in your browser. No signup needed.
LEFT JOIN governorates → unesco_sites on name = governorate, then keep only rows WHERE the site is NULL. This “anti-join” finds the gaps.
SELECT g.name
FROM governorates g
LEFT JOIN unesco_sites u ON g.name = u.governorate
WHERE u.site IS NULL
ORDER BY g.name;
The reference solution is checked automatically when you run your query on the practice page — results are compared row by row, and order matters for this one.
The LEFT-JOIN-then-IS-NULL pattern is the standard way to ask “what’s missing?” — finding the absence of a match. (SQLite docs)