Practice · History · Hard
Join obelisks to pharaohs and count obelisks per era. Return era and a column named obelisks, most first, breaking ties by era name.
Runs in your browser. No signup needed.
obelisks(pharaoh). pharaohs(name, era). Join on the name, then group by era.
SELECT p.era, COUNT(*) AS obelisks
FROM obelisks o
JOIN pharaohs p ON ...
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.
The New Kingdom dominates the surviving obelisks — it was both the wealthiest era and the one that built most in hard granite. (Wikipedia, Egyptian obelisks)