CommencerCommencer gratuitement

South African trends

You decide to zero in on one country to look at country demographic trends over time. Since 1990 (the first year of demographics' data), South Africa's population has increased from 37.5 to 56.7 million people. The GDP per capita has also increased from $6,267 to $13,497.

You want to determine if the number of Olympic athletes from South Africa has increased during this time.

The athletes table is at an athlete-event level grain. You aggregate it to the year-country grain before joining it to the demographics_rank table. Additionally, the demographics_rank table is large, so you want to filter it to only South Africa before joining it to the athletes data.

Cet exercice fait partie du cours

Improving Query Performance in PostgreSQL

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

SELECT ___
  , ___
  , ___(___ ___) AS no_athletes
FROM athletes
WHERE country_code = ___
GROUP BY year, season;
Modifier et exécuter le code