Amagi Cloud maintains employee and salary data for internal workforce reporting. Write a PostgreSQL query to retrieve employees whose current salary is the second highest distinct salary in the company.
is_current is TRUE.employee_id, employee_name, and salary, ordered by employee_id.salary is NULL; they must not take part in the ranking.| Column | Type | Description |
|---|---|---|
| employee_idPK | INTEGER | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee's full name |
| team_name | VARCHAR(100) | Amagi team assigned to the employee |
| Column | Type | Description |
|---|---|---|
| salary_idPK | INTEGER | Unique salary record identifier |
| employee_id | INTEGER | References employees.employee_id |
| salary | NUMERIC(12,2) | Annual salary amount |
| is_current | BOOLEAN | Indicates whether the salary record is current |