HR wants to see who is paid above their own team's norm. Engineering earns more than Sales on average, so comparing everyone to one company-wide average would give the wrong answer.
Write a query returning name, department and salary of every employee whose salary is greater than the average salary of their own department. Use a correlated subquery.
name, department, salaryThe subquery can refer to a column of the outer row, e.g. e.department.
Give the outer table an alias so the inner query can reach it.
No results yet
Run your code to check it against the examples, or submit to run every test.