AnalystPath

Third Fastest Marathon Time

SQLMediumMid level~15 min

Problem

A race organiser stores each runner's finishing time in whole minutes.

Table: `race_finishes`

| Column | Type |
|---------------|------|
| runner_id | int |
| finish_minutes| int |

`runner_id` is the primary key. Faster runners have a **smaller** `finish_minutes`.

Write a query that reports the **3rd fastest distinct** finishing time, aliased as `third_fastest`. (The 3rd fastest is the 3rd smallest distinct value.)

Tables

Example rows — the live problem includes the full dataset.

race_finishes
runner_idfinish_minutes
1188
2195
3210

Expected output

Your answer should return 1 row with the columns third_fastest.

Starter code (SQL)

SELECT *
FROM race_finishes;

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