AnalystPath

Above-Average Campuses

SQLEasyJunior level~15 min

Problem

Table: `menu_item`

| Column Name | Type |
|---|---|
| item_id | int |
| campus | varchar(50) |
| price_cents | int |

`item_id` is the primary key. Each row is one cafeteria menu item sold on a `campus`, priced in cents.

A campus is considered expensive when its average item price is strictly greater than the average item price across all campuses combined. Return the `campus` names of the expensive campuses, sorted alphabetically ascending.

Tables

Example rows — the live problem includes the full dataset.

menu_item
item_idcampusprice_cents
1North800
2North900
3South400

Expected output

Your answer should return 2 rows with the columns campus.

Starter code (SQL)

SELECT *
FROM menu_item;

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