Practice · History · Medium
Count how many pharaohs fall in each era. Return era and a column named pharaohs, ordered by the count from high to low.
Runs in your browser. No signup needed.
pharaohs(name, era). Use GROUP BY.
SELECT era, COUNT(*) AS pharaohs
FROM pharaohs
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.
Egyptologists group ~30 dynasties into eras (Old / Middle / New Kingdom, split by "Intermediate Periods" of fragmentation). (Oxford History of Ancient Egypt)