BaşlayınÜcretsiz Başlayın

What about the weather

Regionally, Africa has a reputation for dominating in the field of running. However, Africa has the fewest athletes per (competing) country. Why?

Running events are only found in the Summer Olympics, so maybe Africa does not send many athletes to the Winter Games. This would explain the low number of athletes when looking across all Olympic Games.

Explore that hypothesis by looking at athlete counts by season (Summer versus Winter).

Bu egzersiz

Improving Query Performance in PostgreSQL

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Add the season field from the athletes table to the SELECT statement.
  • Choose the join type to return only countries with competing athletes.
  • Sort by region and athletes_per_country to see if there is a difference between the summer and Winter Olympics.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

SELECT reg.region
  , ___
  , COUNT(DISTINCT ath.athlete_id) AS no_athletes
  , COUNT(DISTINCT reg.olympic_cc) AS no_countries
  , COUNT(DISTINCT ath.athlete_id)/COUNT(DISTINCT reg.olympic_cc) AS athletes_per_country
FROM athletes ath
___ JOIN oregions reg
  ON ath.country_code = reg.olympic_cc
GROUP BY reg.region, ___ -- Group by region and season
___ ___ , ___;
Kodu Düzenle ve Çalıştır