Chess Club Standings
Problem
A chess club tracks each member's tournament record in `club_records`. Each row has a `member_id`, a `member_name`, the number of `games_played`, and counts of `victories`, `stalemates`, and `defeats`.
Scoring awards 3 points per victory and 1 point per stalemate; defeats are worth nothing. For every member return their `member_id`, `member_name`, total `score`, and their `standing` — the ranking by score from highest to lowest, where members tied on score share the same standing and the next standing skips the appropriate number of positions (a standard competition ranking).
Order the result by `score` descending, then by `member_name` ascending.
Tables
Example rows — the live problem includes the full dataset.
| member_id | member_name | games_played | victories | stalemates | defeats |
|---|---|---|---|---|---|
| 1 | Nadia | 10 | 6 | 2 | 2 |
| 2 | Bram | 10 | 5 | 5 | 0 |
| 3 | Ivo | 10 | 4 | 0 | 6 |
Expected output
Your answer should return 4 rows with the columns member_id, member_name, score, standing.
Starter code (SQL)
SELECT *
FROM club_records;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