Esports Ladder Standings by Split
Problem
A competitive gaming league stores end-of-split results for every roster. A win is worth 3 ladder points and a draw is worth 1; losses are worth 0. Rank rosters within each split by, in order: ladder points (highest first), then round_diff = rounds_won minus rounds_lost (highest first), then roster_name alphabetically. Use a ranking that gives tied rows the same standing. Return split_id, roster_id, roster_name, victories, stalemates, defeats, rounds_won, rounds_lost and standing. Order the result by split_id, then standing, then roster_name.
Tables
Example rows — the live problem includes the full dataset.
| split_id | roster_id | roster_name | games_played | victories | stalemates | defeats | rounds_won | rounds_lost |
|---|---|---|---|---|---|---|---|---|
| 2021 | 1 | Nova Surge | 38 | 29 | 6 | 3 | 99 | 26 |
| 2021 | 2 | Iron Wolves | 38 | 28 | 8 | 2 | 94 | 26 |
| 2021 | 3 | Crimson Edge | 38 | 21 | 11 | 6 | 76 | 33 |
Expected output
Your answer should return 10 rows with the columns split_id, roster_id, roster_name, victories, stalemates, defeats, rounds_won, rounds_lost, standing.
Starter code (SQL)
SELECT *
FROM split_results;Solve this SQL question free
Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock