Your question is SQL Second Highest Age. 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.
Incedo's employee directory needs a query that identifies employees whose age is the second-highest distinct age among active employees. Write a PostgreSQL query using the employee and team data.
employment_status is Active.Unassigned when no team matches, and order results by employee name.| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee's full name |
| age | INT | Employee age |
| employment_status | VARCHAR(20) | Current employment status |
| team_id | INT | Assigned team identifier |
| Column | Type | Description |
|---|---|---|
| team_idPK | INT | Unique team identifier |
| team_name | VARCHAR(100) | Incedo team name |
| office_location | VARCHAR(100) | Team office location |