Fetching algorithms...
Fetching algorithms...
| id | name | salary | departmentId |
|---|---|---|---|
| 1 | Joe | 85000 | 1 |
| 2 | Henry | 80000 | 2 |
| 3 | Sam | 60000 | 2 |
| 4 | Max | 90000 | 1 |
| 5 | Janet | 69000 | 1 |
| 6 | Randy | 85000 | 1 |
| 7 | Will | 70000 | 1 |
| id | name |
|---|---|
| 1 | IT |
| 2 | Sales |
| Department | Employee | Salary |
|---|---|---|
| IT | Max | 90000 |
| IT | Joe | 85000 |
| IT | Randy | 85000 |
| IT | Will | 70000 |
| Sales | Henry | 80000 |
| Sales | Sam | 60000 |
For the IT department:
Since the problem asks for the top three unique salaries, Max (90000), Joe/Randy (85000), and Will (70000) are included. Janet is excluded because 69000 is the fourth unique salary.
For the Sales department:
There are only two unique salaries in the Sales department, so both Henry and Sam are considered high earners as they fall within the top three.