# THE BAKER'S DOZEN

WEEKLY QUACK CHALLENGE! · challenge 1 · medium · 5 guesses

> Baker Sheldrake peers over the pastry counter at Duckbert. "We sold a mountain of biscuits — but which item actually raked in the most bread? Quantity fools the eye, Duckbert. Find the item with the highest revenue that isn't our unit king."

## Task

Each item’s revenue is its total quantity sold times its price. Among all items that are NOT the single best-seller by total quantity sold, return the name of the one with the highest revenue. On a revenue tie, return the alphabetically first. You will be working with the `order_items` and `items` tables.

## Tables

### `order_items` (26 rows)

| column | type |
| --- | --- |
| order_id | INTEGER |
| item_id | INTEGER |
| qty | INTEGER |

### `items` (6 rows)

| column | type |
| --- | --- |
| item_id | INTEGER |
| name | VARCHAR |
| price | DECIMAL(6,2) |

## Data

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

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

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

Play it in the browser: https://dbquacks.com/challenges/weekly/1

## Answer

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