Your question is Top Performers by Department Query. Start with the requirements and the four 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.
Unum's Data Science team wants a department-level view of its strongest active employees. Write a PostgreSQL query that combines employee, review, and performance outcome data to rank performers within each department.
| Column | Type | Description |
|---|---|---|
| department_idPK | INTEGER | Unique department identifier |
| department_name | VARCHAR(100) | Department name |
| Column | Type | Description |
|---|---|---|
| employee_idPK | INTEGER | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee's full name |
| department_id | INTEGER | Assigned department identifier |
| employment_status | VARCHAR(20) | Current employment status |
| Column | Type | Description |
|---|---|---|
| review_idPK | INTEGER | Unique review identifier |
| employee_id | INTEGER | Employee being reviewed |
| review_period | VARCHAR(20) | Review period label |
| review_score | NUMERIC(5,2) | Review score |
| Column | Type | Description |
|---|---|---|
| result_idPK | INTEGER | Unique outcome record identifier |
| employee_id | INTEGER | Employee associated with the outcome |
| performance_period | VARCHAR(20) | Outcome period label |
| outcome_score | NUMERIC(5,2) | Measured performance outcome score |