Practice · History · Medium

Oldest monument at each site

For each location, return the location and the earliest construction_start there (as earliest), oldest sites first.

Runs in your browser. No signup needed.

What you are given

Use monuments. GROUP BY location and take MIN(construction_start).

Starting point

SELECT location, MIN(construction_start) AS earliest
FROM monuments
GROUP BY location
ORDER BY earliest;

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

Giza’s pyramids predate the Luxor and Aswan temples by over a thousand years — the Great Pyramid was already ancient when Ramesses II ruled. (Oxford History of Ancient Egypt)

More History challenges

Open it in the playground →