Above-Average Campuses
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.
| item_id | campus | price_cents |
|---|---|---|
| 1 | North | 800 |
| 2 | North | 900 |
| 3 | South | 400 |
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