Your question is Top 3 Highest-Paid 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.
Josh Technology's workforce dashboard needs to show the three highest-paid active employees and their departments.
Write a PostgreSQL query that returns exactly the top three active employees by annual salary.
Active or whose salary is NULL.employee_id ascending as the deterministic tie-breaker, then return the first three.| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Unique employee identifier |
| full_name | VARCHAR(100) | Employee's full name |
| department_id | INT | References departments.department_id |
| annual_salary | DECIMAL(12,2) | Annual salary in USD |
| employment_status | VARCHAR(20) | Employee's current employment status |
| Column | Type | Description |
|---|---|---|
| department_idPK | INT | Unique department identifier |
| department_name | VARCHAR(100) | Department name |