Champion Win, Pick and Ban Rates per Patch in SQL

Last updated: November 29, 2026

Quick Overview

Given matches, participants and bans tables for League of Legends ranked games, write a query returning each champion's games, win rate, pick rate and ban rate per patch, excluding remakes and champions below a minimum game count.

Riot Games
Data Manipulation (SQL/Python)
Data Scientist
Riot Games
November 29, 2026
Data Scientist
Technical Screen
Data Manipulation (SQL/Python)
Easy

0

0

0 solved


Given matches, participants and bans tables for League of Legends ranked games, write a query returning each champion's games, win rate, pick rate and ban rate per patch, excluding remakes and champions below a minimum game count.

A SQL screen in the style of Riot's player insights and game balance analytics work, where per-patch champion stats drive balance decisions. The interviewer checks correct denominators, filtering of remakes and other queues, and a left join so ban rates do not drop rows.

What the Interviewer Expects
  • Filter to the right queue and drop remakes before any counting
  • Use total matches per patch as the pick and ban denominator
  • Count bans per match, not per ban slot
  • Left join bans so unbanned champions keep a 0 ban rate
  • Apply a minimum games threshold
  • Explain what each rate means in plain terms
Key Topics to Cover
CTEs
aggregation
left joins
denominators
game balance metrics
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • How would you break win rate down by rank tier and role?
  • How would you add a confidence interval for each win rate?
  • Champions that are banned so often they are rarely picked are missing: how do you include them?
  • How would you compute these stats incrementally as new matches stream in?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data

Assume matches(match_id, patch, queue, is_remake), participants(match_id, puuid, team_id, champion, win) with 10 rows per match, and bans(match_id, champion) with up to 10 bans per match. In ran...

Approach
  1. valid_matches: ranked solo, not remakes. 2. Matches per patch as the shared denominator. 3. Picks and wins per patch and champion. 4. Bans per patch and champion with COUNT(DISTINCT match_id), ...

Submit Your Answer
Markdown supported

Related Questions