Write a SQL query using window functions (DENSE_RANK) to retrieve the K-th highest employee salary while properly handling duplicate values.
For this exercise, use K = 3. Exclude employees whose salary is NULL, and include the department name when available.
employee_id, employee_name, salary, department_name, and salary_rank.salary descending, then employee_id ascending.| Column | Type | Description |
|---|---|---|
| employee_idPK | INTEGER | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee full name |
| department_id | INTEGER | Referenced department identifier |
| salary | NUMERIC(12,2) | Annual employee salary |
| Column | Type | Description |
|---|---|---|
| department_idPK | INTEGER | Unique department identifier |
| department_name | VARCHAR(100) | Department name |