Your question is SQL Query for Third Largest. 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.
Sun Life Financial's QA team needs to validate salary-ranking logic in an employee reporting query. Write a PostgreSQL query that identifies employees earning the third-highest distinct salary among active employees with recorded compensation.
employees to employee_compensation using employee_id.salary is NULL.| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee full name |
| employment_status | VARCHAR(20) | Current employment status |
| department | VARCHAR(50) | Employee department |
| Column | Type | Description |
|---|---|---|
| compensation_idPK | INT | Unique compensation record identifier |
| employee_id | INT | Employee receiving the compensation |
| salary | NUMERIC(12,2) | Annual base salary |