Abzooba maintains employee salary history with an effective date for each salary change. Write a PostgreSQL query that reports each employee's latest salary effective on a fixed reporting date, DATE '2026-08-30', and the salary immediately before it.
employee_id, employee_name, current_salary, previous_salary, and current_effective_from.effective_from <= DATE '2026-08-30'. Rows with no eligible salary record must have NULL salary fields.employee_id ascending.| Column | Type | Description |
|---|---|---|
| employee_idPK | INTEGER | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee's full name |
| department | VARCHAR(80) | Abzooba department |
| Column | Type | Description |
|---|---|---|
| salary_history_idPK | INTEGER | Unique salary history identifier |
| employee_id | INTEGER | References employees.employee_id |
| salary | NUMERIC(12,2) | Salary amount |
| effective_from | DATE | Date the salary became effective |
| effective_to | DATE | Date the salary ended, if known |