# Misaligned Training Detection

THE GREAT DUCK MIGRATION! · challenge 32 · hard

> Dr. Stork reviews training efficiency reports with mounting concern. "We've discovered a troubling pattern! Some athletes have been dedicating most of their training time to sports where they show less natural aptitude. Their highest-scoring sport differs from the sport they've practiced most frequently. These misaligned training regimens waste precious energy and could compromise our migration! We need to identify these ducks immediately so we can redirect their focus to their natural strengths before departure."

## Task

Return the sum of SSNs for all ducks whose natural talent sport (the sport where they achieved their highest score) differs from their most-practiced sport (the sport with the most competition entries). For ties in highest score or practice count, use the sport that comes first alphabetically. 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/32

## Answer

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