LoslegenKostenlos loslegen

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.

Diese Übung ist Teil des Kurses

Improving Query Performance in PostgreSQL

Kurs anzeigen

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

SELECT ___
  , ___
  , ___(___ ___) AS no_athletes
FROM athletes
WHERE country_code = ___
GROUP BY year, season;
Code bearbeiten und ausführen