Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Improving Query Performance in PostgreSQL

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

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 bewerken en uitvoeren