Practice · History · Medium

Rulers who reigned over 30 years

Return the name and reign length (as years_reigned) of every pharaoh who reigned MORE than 30 years, longest first.

Runs in your browser. No signup needed.

What you are given

Use pharaohs. reign_end − reign_start gives the length.

Starting point

SELECT name, (reign_end - reign_start) AS years_reigned
FROM pharaohs
WHERE ...
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.

Did you know

Ramesses II reigned ~66 years and outlived many of his own heirs; the son who finally succeeded him, Merneptah, was already elderly. (Britannica)

More History challenges

Open it in the playground →