Practice · Demographics · Hard
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.
Use governorates. Compare each row to a subquery: (SELECT AVG(population_millions) FROM governorates).
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.
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)