LoslegenKostenlos loslegen

Using different joins to explore athletes' regions

You probably know about the Olympians from your country. Many Russians watch figure skating. Kenyans have a strong presence in running events. Canadians dominate hockey. Do these trends hold true across regions? Do all European countries have figure skating Olympians? Do all North Americans have Olympic-level hockey teams?

See which European countries sent figure skating competitors to the 2014 Winter Olympics. The athletes table is already filtered to figure skating athletes, and the regions table is filtered to European countries. Use the different join types and compare the results.

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 reg.region, reg.country
  , COUNT(DISTINCT ath.athlete_id) AS no_athletes
FROM ___ ___
___ JOIN ___ ___
  ON reg.olympic_cc = ath.country_code
GROUP BY reg.region, reg.country
ORDER BY no_athletes DESC;
Code bearbeiten und ausführen