# The Secret Route

THE CHRISTMAS HEIST! · challenge 13 · hard

> Detective Quacker's suspicion grows. "GPS gaps... packages being split... but wait, didn't we see Coach Waddles going somewhere unexpected?" Captain Cosmos descends with satellite data and GPS trajectory analysis glowing with insights. "Detective! I've mapped Coach Waddles' complete secret route using all that GPS data! The warehouse is at coordinates 45.5200 latitude, -122.6800 longitude. For Coach Waddles' deliveries, I want to know which district he visited the most. Where did our suspect spend his time delivering? Return the district name with the most deliveries! This will reveal where he was REALLY going!"

## Task

Find which district received the most deliveries from Coach Waddles (id = 1). You will be working with `deliveries_log` and `duck_households` tables.

## Tables

### `deliveries_log` (10000 rows)

| column | type |
| --- | --- |
| delivery_id | INTEGER |
| household_id | INTEGER |
| delivered_by | INTEGER |
| delivery_time | TIMESTAMP |
| success | BOOLEAN |
| parent_delivery_id | INTEGER |
| delivery_metadata | JSON |

### `duck_households` (200 rows)

| column | type |
| --- | --- |
| household_id | INTEGER |
| address | VARCHAR |
| district | VARCHAR |
| latitude | DOUBLE |
| longitude | DOUBLE |
| household_size | INTEGER |
| income_level | VARCHAR |
| reported_missing | BOOLEAN |

## Data

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

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

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

Play it in the browser: https://dbquacks.com/challenges/christmas/13

## Answer

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