You are given an employee table having columns emp_id, emp_name, salary, department. Find the 4th highest salary in each department.
Asked in the R1 stage. Treat salaries as distinct levels, so employees tied at the same salary share one level. Exclude departments with fewer than four non-null salary levels.
department, fourth_highest_salary.department.| Column | Type | Description |
|---|---|---|
| emp_idPK | INT | Unique employee identifier |
| emp_name | VARCHAR(100) | Employee name |
| salary | NUMERIC(10,2) | Employee salary |
| department | VARCHAR(100) | Employee department |