76

Employees Earning Above Department Average

HardsubqueryJOINAVG

Problem Description

Write a SQL query to find employees who earn more than their department's average salary.

Expected Columns

  • name
  • department
  • salary
  • dept_avg

Example Output

| name | department | salary | dept_avg | |------|------------|--------|----------| | Aarav Sharma | Engineering | 85000 | 81400.0 | | Karthik Sundaram | Engineering | 95000 | 81400.0 | | ... | ... | ... | ... |

Hints

Unlocks after 2 more attempts
Submit your solution to unlock hints
//#76 Employees Earning Above Department Average
Hard

Loading schema...

Loading editor...

No results yet

Run a query to see results