Practice · History · Medium

Heritage meets population

For UNESCO sites in a governorate we have population for, return the site and that governorate’s population_millions, most populous first.

Runs in your browser. No signup needed.

What you are given

unesco_sites(site, governorate) joins governorates(name, population_millions) on governorate = name. An inner JOIN keeps only matches.

Starting point

SELECT u.site, g.population_millions
FROM unesco_sites u
JOIN governorates g ON u.governorate = g.name
ORDER BY g.population_millions DESC;

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

An inner join returns only rows that match on both sides — sites in governorates outside our slice simply drop out. (SQLite docs)

More History challenges

Open it in the playground →