AnalystPath

Tasting Score Spread

SQLMediumMid level~15 min

Problem

Table: `entry`

| Column Name | Type |
|---|---|
| entry_id | int |
| roaster | varchar(40) |
| aroma | int |
| body | int |
| finish | int |

`entry_id` is the primary key. Each row is a coffee entered in a cupping contest, rated by judges on three attributes: `aroma`, `body`, and `finish`.

Each entry's total is the sum of its three attribute ratings. Return a single value, `score_spread`, equal to the difference between the highest total score and the lowest total score across all entries.

Tables

Example rows — the live problem includes the full dataset.

entry
entry_idroasteraromabodyfinish
1Highland879
2Riverbend665
3Coastline998

Expected output

Your answer should return 1 row with the columns score_spread.

Starter code (SQL)

SELECT *
FROM entry;

Solve this SQL question free

Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.

Solution & explanation

Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.

Sign up free to unlock

Related SQL questions