Tournament Winners

ASKED IN INTERVIEW
10pts
Riot Games

Problem Statement

Identify the player(s) with the most points for every tournament.

Rules:

  • Output columns: tournament_name, winner_name, total_points.
  • Handle ties by returning all top scorers for that tournament.
  • Sort by tournament_name ASC.
Tests your understanding of
Window Functions, RANK, Aggregation and Joins

Input Tables

tournaments
tournament_id(INTEGER)name(VARCHAR)
1Worlds 2025
2MSI 2025
players
player_id(INTEGER)display_name(VARCHAR)
501Faker
502Caps
503Chovy
match_results
match_id(INTEGER)tournament_id(INTEGER)player_id(INTEGER)points(INTEGER)
1150110
2150115
3150220
4250330

Expected Output

tournament_name(VARCHAR)winner_name(VARCHAR)total_points(INTEGER)
MSI 2025Chovy30
Worlds 2025Faker25

Tags

HardASKED IN INTERVIEWWindow FunctionsRANKAggregationJoins
25-35 min
44%

Hints