# Performance Quartile Assignment

THE GREAT DUCK MIGRATION! · challenge 26 · hard

> General Gander spreads out the strategic placement charts. "Migration formations require careful athlete placement! We're dividing all athletes into four equal performance tiers based on their career averages. The top tier - our highest performers - will take the critical front formation positions where wind resistance is greatest. Calculate each duck's overall career average score, divide everyone into four equal groups, and identify those in the highest-performing group!"

## Task

Return the sum of SSNs for all ducks in the top performance quartile. Calculate each duck's career average score across all their competitions, then divide all athletes into 4 equal groups (quartiles) based on these averages. Return those in the highest-scoring quartile (tier 1). 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/26

## Answer

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