Practice · Demographics · Hard
Return the governorate names that are NOT a university city in our data, alphabetically.
Runs in your browser. No signup needed.
SELECT name FROM governorates EXCEPT SELECT city FROM universities. EXCEPT subtracts the second set from the first.
SELECT name FROM governorates
EXCEPT
SELECT city FROM universities
ORDER BY 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.
EXCEPT (called MINUS in some databases) answers “in A but not in B” — a clean alternative to an anti-join for single columns. (SQLite docs)