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.
This exercise is part of the course
Improving Query Performance in PostgreSQL
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
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;