#808

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.

scorequartileplayer_id
9511
8812
8813

Your query result will appear here