Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions 4_soutions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,13 @@ GROUP BY continent
HAVING max(population) <= 25000000) AS x
ON y.continent = x.continent

--10. Some countries have populations more than three times that of any of their neighbours (in the same continent). Give the countries and continents.
SELECT name, continent
FROM world w1
WHERE population >=
ALL(
SELECT population * 3 FROM world w2
WHERE w1.continent = w2.continent
AND w1.name <> w2.name
)