SQL Challenges · THE GREAT DUCK MIGRATION!
Misaligned Training Detection
Difficulty: hard
Dr. Stork reviews training efficiency reports with mounting concern. Weve discovered a troubling pattern! Some athletes have been dedicating most of their training time to sports where they show less natural aptitude. Their highest-scoring sport differs from the sport theyve practiced most frequently. These misaligned training regimens waste precious energy and could compromise our migration! We need to identify these ducks immediately so we can redirect their focus to their natural strengths b…
Your task
Return the sum of SSNs for all ducks whose natural talent sport (the sport where they achieved their highest score) differs from their most-practiced sport (the sport with the most competition entries). For ties in highest score or practice count, use the sport that comes first alphabetically. You will be working with `duck_athletes` and `performance_records` tables.