Practice · History · Medium

Countries holding more than one obelisk

Return only the countries that hold more than one obelisk, as current_country and obelisks, most first.

Runs in your browser. No signup needed.

What you are given

obelisks(current_country). Filter groups with HAVING, not WHERE.

Starting point

SELECT current_country, COUNT(*) AS obelisks
FROM obelisks
GROUP BY current_country
HAVING ...;

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.

Did you know

WHERE filters rows before grouping; HAVING filters the groups afterwards — which is why counting conditions belong in HAVING.

More History challenges

Open it in the playground →