Exusia's Data Fabric team needs a repeatable way to identify the highest-paid employees while retaining department information when available. The result must handle salary ties and employees whose department reference does not match a department record.
Write a PostgreSQL query that returns every employee earning the maximum salary in the employees table. Also describe how to produce the same result with a DataFrame and an RDD.
LEFT JOIN to include the employee when its department reference has no matching department.| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee full name |
| salary | NUMERIC(12,2) | Annual salary |
| department_id | INT | Referenced department identifier |
| job_title | VARCHAR(100) | Current job title |
| Column | Type | Description |
|---|---|---|
| department_idPK | INT | Unique department identifier |
| department_name | VARCHAR(100) | Department name |