# Cleared for Takeoff

THE GREAT DUCK MIGRATION! · challenge 40 · 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 duck's most recent flying competition date and find those who scored at least 90 that day. Sum their identification codes for the takeoff clearance roster!"

## 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)

| column | type |
| --- | --- |
| duck_id | BIGINT |
| sport | VARCHAR |
| score | DOUBLE |
| competition_date | DATE |

### `duck_athletes` (50 rows)

| column | type |
| --- | --- |
| id | BIGINT |
| ssn | BIGINT |
| name | VARCHAR |
| age | BIGINT |
| hometown | VARCHAR |

## Data

The tables live in a DuckDB database: https://dbquacks.com/data/databases/athletic_champions.duckdb

To query it outside the browser, attach it read-only:

```sql
ATTACH 'https://dbquacks.com/data/databases/athletic_champions.duckdb' AS db (READ_ONLY);
USE db;
```

Play it in the browser: https://dbquacks.com/challenges/athletic/40

## Answer

The expected answer is not published. Submit on the page to have it checked.
