Your question is Top N by Group Salary. 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.
Meta People Analytics wants the top paid people in a specific org unit, such as fb groups or ig reels. Write a PostgreSQL query to return the top N people by salary within one group or department.
employee_id ascending.| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Primary key for the employee |
| full_name | VARCHAR(255) | Employee name |
| group_id | INT | References org_groups.group_id |
| salary_usd | NUMERIC(12,2) | Annual salary in USD |
| hire_date | DATE | Hire date |
| Column | Type | Description |
|---|---|---|
| group_idPK | INT | Primary key for the org group |
| group_name | VARCHAR(255) | Group or department name |
| surface | VARCHAR(50) | Meta surface, for example fb groups or ig reels |