SQL Challenges · THE GREAT DUCK MIGRATION!

Cleared for Takeoff

Difficulty: medium

Navigator Neptune drops a faded trophy onto the planning table. Lovely trophy, Duckbert. Can it fly? Neither can a personal best from three years ago! The flight crew needs to be ready NOW. Check each ducks most recent flying competition date and find those who scored at least 90 that day. Sum their identification codes for the takeoff clearance roster!

Your task

Return the sum of SSNs for all ducks whose flying_speed score on their most recent flying_speed competition date is at least 90. Consider all years when finding that date for each duck. Ignore performances in other sports. You will be working with the `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/40.md

Play this challenge →