Newton School of Technology wants to identify active employees whose salary is the second-highest distinct salary in the organization. Write a PostgreSQL query that returns every employee tied at that salary, along with their department.
employment_status = 'active' and a non-NULL salary.employee_id in ascending order.| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee full name |
| department_id | INT | References departments.department_id |
| salary | DECIMAL(10,2) | Annual employee salary |
| employment_status | VARCHAR(20) | Current employment status |
| Column | Type | Description |
|---|---|---|
| department_idPK | INT | Unique department identifier |
| department_name | VARCHAR(100) | Department name |