SQL Challenges · THE GREAT DUCK MIGRATION!

Hometown Performance Analysis

Difficulty: medium

Mayor Mallory presents hometown performance statistics. Regional excellence drives migration success! Hometowns whose athletes average above the global performance mean produce superior talent. Athletes from these elite regions carry regional pride into battle. Sum their identification codes for the hometown champions registry!

Your task

Return the sum of SSNs for all ducks from hometowns where the average score of their athletes exceeds the global average score across all competitions. You will be working with the `duck_athletes` and `performance_records` tables.

Tables

performance_records (800 rows)

columntype
duck_idBIGINT
sportVARCHAR
scoreDOUBLE
competition_dateDATE

duck_athletes (50 rows)

columntype
idBIGINT
ssnBIGINT
nameVARCHAR
ageBIGINT
hometownVARCHAR

Database: https://dbquacks.com/data/databases/athletic_champions.duckdb

This page as markdown: https://dbquacks.com/challenges/athletic/31.md

Play this challenge →