Above the Average
Return the name and salary of everyone who earns more than the average salary of the whole table. Rows may come in any order.
Example 1
employees
| id | name | salary |
|---|---|---|
| 1 | Ada | 3000 |
| 2 | Ben | 4000 |
| 3 | Cy | 5000 |
returns
| name | salary |
|---|---|
| Cy | 5000 |
Constraints
- Up to 12 people
Write it in your browser, against the clock. The model query, with a note on each piece of it, comes after.
More SQL problems
- Best Paid in Each DepartmentMedium
- Bought but Never SoldMedium
- Change From the Day BeforeMedium
- First OrderMedium
- Latest PriceMedium
- More Than the ManagerMedium
- Open PositionsMedium
- Rank in the DepartmentMedium