AnalystPath

Times Each Chef Appears on the Menu

SQLEasyJunior level~15 min

Problem

Table: `menu_board`

| Column Name | Type |
|---|---|
| dish_id | int |
| dish_name | varchar |
| chef | varchar |

`dish_id` is the primary key. Each row is one dish currently listed on the tasting menu, attributed to the chef who created it.

Count how many dishes each chef has on the board. Output the chef's name and that count aliased as `appearances`. Order by `appearances` descending; break ties by `chef` ascending.

Tables

Example rows — the live problem includes the full dataset.

menu_board
dish_iddish_namechef
101Charred Leek TartRosa Linde
102Saffron GnocchiMarco Pell
103Smoked Plum BaoRosa Linde

Expected output

Your answer should return 3 rows with the columns chef, appearances.

Starter code (SQL)

SELECT *
FROM menu_board;

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