SQL Challenges · THE GREAT DUCK MIGRATION!

Performance Quartile Assignment

Difficulty: hard

General Gander spreads out the strategic placement charts. Migration formations require careful athlete placement! Were dividing all athletes into four equal performance tiers based on their career averages. The top tier - our highest performers - will take the critical front formation positions where wind resistance is greatest. Calculate each ducks overall career average score, divide everyone into four equal groups, and identify those in the highest-performing group!

Your task

Return the sum of SSNs for all ducks in the top performance quartile. Calculate each duck's career average score across all their competitions, then divide all athletes into 4 equal groups (quartiles) based on these averages. Return those in the highest-scoring quartile (tier 1). You will be working with `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/26.md

Play this challenge →