Practice · History · Medium
Count the obelisks in each country. Return current_country and a column named obelisks, most first, breaking ties by country name.
Runs in your browser. No signup needed.
obelisks(current_country). Use GROUP BY.
SELECT current_country, COUNT(*) AS obelisks
FROM obelisks
GROUP BY ...
ORDER BY ...;
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.
Italy holds more ancient Egyptian obelisks than any country except Egypt itself — Rome’s emperors shipped them home as trophies after 31 BCE. (Wikipedia, Egyptian obelisks)