Your question is Highest Paid Employee Per Department. 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.
Data Axle needs a department-level compensation report. Write a PostgreSQL query that returns every employee whose salary equals the highest non-null salary in their department.
| Column | Type | Description |
|---|---|---|
| department_idPK | INTEGER | Unique department identifier |
| department_name | VARCHAR(100) | Department name |
| Column | Type | Description |
|---|---|---|
| employee_idPK | INTEGER | Unique employee identifier |
| department_id | INTEGER | Referenced department identifier |
| employee_name | VARCHAR(100) | Employee full name |
| job_title | VARCHAR(100) | Employee job title |
| salary | NUMERIC(12,2) | Annual employee salary |