Where to place a region filter
Population alone does not predict the number of Olympians. Researchers propose that gross domestic product (GDP) together with population can predict the number of Olympians. Luckily the World Bank also collects GDP per capita (GDP divided by the number of citizens) on many countries.
Focusing again on Africa, the most populous countries in 2014 were Nigeria, Ethiopia, and Egypt; however, the only African countries sending athletes to the 2014 Olympics were Morocco, Togo, and Zimbabwe.
Determine which African countries have 2014 GDP data and whether Morocco, Togo, and Zimbabwe have high GDPs.
Cet exercice fait partie du cours
Improving Query Performance in PostgreSQL
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
SELECT dem.olympic_cc, reg.country, dem.gdp, dem.population
FROM demographics dem
LEFT JOIN oregions reg
ON dem.olympic_cc = reg.olympic_cc
___ ___ = ___
WHERE dem.year = 2014
AND dem.gdp IS NOT NULL
ORDER BY dem.gdp DESC;