Your question is K-th Highest Salary Query. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
CLARA analytics needs to identify employees at a specific compensation tier for internal workforce analysis. Write a PostgreSQL query to return every employee earning the third-highest distinct salary, where k = 3.
employee_id order. The query should make it clear how to replace 3 with another value of k.| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee full name |
| department_id | INT | Referenced department identifier |
| salary | NUMERIC(10,2) | Annual employee salary |
| Column | Type | Description |
|---|---|---|
| department_idPK | INT | Unique department identifier |
| department_name | VARCHAR(100) | Department display name |