Split players into four equal rating buckets
An esports team lead wants to split the player ranking into four equal groups — top 25%, 25-50%, 50-75%, bottom 25%. Tag every player with their group number. Caveat: when the player count isn't divisible by four, the groups come out uneven — extra rows go into the first groups. On ten players that produces a 3-3-2-2 split, not «2.5 per group». Show the player id, their score, and the group number. Sort by score descending, with the player id as the tiebreaker (needed for a deterministic order).
Expected output sample
This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.
| score | quartile | player_id |
|---|---|---|
| 95 | 1 | 1 |
| 88 | 1 | 2 |
| 88 | 1 | 3 |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in