Practice · History · Medium

Every monument’s era

Return each monument and the era of the pharaoh who built it. Return columns name and era, ordered by monument name.

Runs in your browser. No signup needed.

What you are given

monuments(name, builder, …) joins pharaohs(name, era) where monuments.builder = pharaohs.name. Alias the tables (m, p).

Starting point

SELECT m.name, p.era
FROM monuments m
JOIN pharaohs p ON m.builder = p.name
ORDER BY m.name;

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

A JOIN stitches two tables together on a matching key — the single most important idea in relational databases. (SQLite docs)

More History challenges

Open it in the playground →