SQL Challenges · THE GREAT DUCK MIGRATION!

Above Their Generation

Difficulty: medium

Admiral Aqua strides in carrying a gilded chart of age-bracketed performance statistics. Migration leadership rewards those who rise above their peers! Every athlete is born into an age bracket, and every bracket sets its own standard of excellence. I dont care how old a duck is - I care whether they outperform the others who share their years. Calculate each athletes career average across all competitions, then weigh it against the combined average of every competition flown by ducks of the sa…

Your task

Return the sum of SSNs for all ducks whose career average score (the mean of all their own competition scores) is strictly higher than their age group's average score. Calculate an age group's average as the mean of every competition score recorded by all athletes of that age, including the duck's own competitions. Only include ducks who have at least one competition. You will be working with the `duck_athletes` and `performance_records` tables.

Play this challenge →