Practice · Demographics · Hard

Bigger than average

Return the name and population_millions of every governorate whose population is ABOVE the average governorate population, largest first.

Runs in your browser. No signup needed.

What you are given

Use governorates. Compare each row to a subquery: (SELECT AVG(population_millions) FROM governorates).

Starting point

SELECT name, population_millions
FROM governorates
WHERE population_millions > (SELECT AVG(population_millions) FROM governorates)
ORDER BY 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

Egypt’s population is extremely unevenly spread — a handful of Nile-valley and Delta governorates sit far above average while vast desert ones are nearly empty. (CAPMAS)

More Demographics challenges

Open it in the playground →