Your question is SQL Table Query Challenges. 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.
Payactiv needs a salary analysis for its active workforce. Write a PostgreSQL query that identifies employees with the second highest distinct current annual salary.
employment_status is Active.annual_salary.| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Unique employee identifier |
| full_name | VARCHAR(100) | Employee's full name |
| department | VARCHAR(50) | Payactiv department |
| employment_status | VARCHAR(20) | Current employment status |
| Column | Type | Description |
|---|---|---|
| compensation_idPK | INT | Unique compensation record identifier |
| employee_id | INT | Employee associated with the compensation record |
| annual_salary | NUMERIC(12,2) | Annual salary amount |
| is_current | BOOLEAN | Whether the compensation record is current |