SQL Challenges · THE GREAT DUCK MIGRATION!

Relentless Cadence

Difficulty: hard

Scout Samantha unfurls a timeline of every competition entry stretching across the war table. Migration readiness isnt built in a single event - its forged through relentless, regular competition! Athletes who keep their gaps short between events stay sharp, their reflexes honed, their stamina peaking. I need the ducks whose average days between consecutive competitions is less than 70 - these high-frequency competitors never go cold and will be our most battle-ready flyers. Sum their identific…

Your task

Return the sum of SSNs for all ducks whose average gap (in days) between consecutive competitions is less than 70. Calculate the gap as the difference in days between each pair of consecutive competitions for a duck (ordered by competition_date), then average those gaps. Only include ducks who have at least two competitions. You will be working with the `duck_athletes` and `performance_records` tables.

Play this challenge →