# Elite Tier Ranking

THE GREAT DUCK MIGRATION! · challenge 18 · hard

> Captain Cosmos descends with holographic formation displays. "Space-age formation strategy requires precision tiering! Rank all 2025 swimming performances into skill tiers using dense ranking - no gaps in rankings even with tied scores. Find athletes in the elite top tier (rank 1 or 2) who will lead our water crossings!"

## Task

Return the sum of SSNs for all ducks who achieved a dense rank of 1 or 2 based on their best swimming score in 2025. Use SQL's DENSE_RANK() function where tied scores receive the same rank with no gaps. You will be working with `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/18

## Answer

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