SQL Challenges · WEEKLY QUACK CHALLENGE!

MIGRATION LAYOVERS

Difficulty: hard

Chief Migration Officer Gadwall slaps a map on the wall. Every year these ducks fly halfway across the continent and everybody cheers the starting pond and the finishing pond. Nobody asks about the middle! But Ive been watching the flight logs, Duckbert — one pond keeps showing up as a pass-through stop again and again and again. Its not where they take off. Its not where they land for good. Its the pond they stop at, rest their wings, and then leave. Find me that layover hotspot or youre clean…

Your task

On a duck’s journey, a layover is a pond it flies into and later flies out of again — never its starting pond or its final destination. Return the name of the pond used as a layover the most times across all journeys; on a tie, the alphabetically first. You will be working with the `flights` and `ponds` tables.

Play this challenge →