Your question is N-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 wants to benchmark compensation across its active analytics teams. Write a PostgreSQL query that returns every active employee earning the third-highest distinct salary among eligible employees.
employment_status = 'Active', assigned to an active team, and with a non-NULL salary.| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee full name |
| team_id | INT | Referenced team identifier |
| salary | NUMERIC(10,2) | Annual employee salary |
| employment_status | VARCHAR(20) | Current employment status |
| Column | Type | Description |
|---|---|---|
| team_idPK | INT | Unique team identifier |
| team_name | VARCHAR(100) | Team name |
| practice | VARCHAR(50) | Analytics practice supported by the team |
| is_active | BOOLEAN | Whether the team is active |