Above Department Average Salary
Medium
Correlated Subqueries
Return the name, department and salary of employees who earn strictly more than the average salary of their own department. Order by name.
Table schema
Employees(id INT PRIMARY KEY, name VARCHAR(10), dept VARCHAR(10), salary INT)Sample data
id | name | dept | salary
1 | Asha | IT | 90
2 | Ben | IT | 60
3 | Chi | HR | 50
4 | Dev | HR | 70
5 | Eli | HR | 60
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.