Loading problem...
A compensation analytics system stores employee records and needs to create pay-based cohorts for benchmarking.
Table: employees
Team formation policy:
Team ID policy:
Task: Return every employee who belongs to a team, together with the computed team_id.
Output requirements:
Supported submission environments:
employees:
| employee_id | name | salary |
|-------------|---------|--------|
| 2 | Meir | 3000 |
| 3 | Michael | 3000 |
| 7 | Addilyn | 7400 |
| 8 | Juan | 6100 |
| 9 | Kannon | 7400 |[
{"employee_id":2,"name":"Meir","salary":3000,"team_id":1},
{"employee_id":3,"name":"Michael","salary":3000,"team_id":1},
{"employee_id":7,"name":"Addilyn","salary":7400,"team_id":2},
{"employee_id":9,"name":"Kannon","salary":7400,"team_id":2}
]Salary 6100 appears once and is excluded. Qualifying salaries are 3000 and 7400, so they receive team IDs 1 and 2 respectively.
employees:
| employee_id | name | salary |
|-------------|--------|--------|
| 10 | Avery | 5000 |
| 11 | Blair | 5000 |
| 12 | Casey | 5000 |
| 13 | Devon | 9000 |[
{"employee_id":10,"name":"Avery","salary":5000,"team_id":1},
{"employee_id":11,"name":"Blair","salary":5000,"team_id":1},
{"employee_id":12,"name":"Casey","salary":5000,"team_id":1}
]Only salary 5000 qualifies because it has at least two employees. Salary 9000 is unique and excluded.
employees:
| employee_id | name | salary |
|-------------|-------|--------|
| 101 | Iris | 4200 |
| 102 | Jonah | 5300 |
| 103 | Lila | 6100 |[]Every salary is unique, so no salary team is created.
Constraints