Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
Top 10 Spenders SQL
00:00
5 left

Top 10 Spenders SQL

EasySQL · PostgreSQL

Problem

Scopely wants to identify the highest-spending players in MONOPOLY GO! for a player monetization review. Write a SQL query that calculates each player's total positive purchase amount and returns the top 10 players.

Include only purchase records with a strictly positive amount_usd. A player may have multiple purchase records, and players with no qualifying purchases should not appear.

Output

  1. One row per player
  2. Columns named player_id, player_name, and total_spent
  3. total_spent is the player's total qualifying purchase amount
  4. Return at most 10 rows, ordered by total_spent from highest to lowest
  5. Break ties by player_id in ascending order

Schema

player_purchases
ColumnTypeDescription
purchase_idPKINTUnique identifier for the purchase record
player_idVARCHAR(20)Unique identifier for the player
player_nameVARCHAR(100)Display name of the player
amount_usdDECIMAL(10,2)Purchase amount in US dollars; negative values represent refunds
Tablesplayer_purchases
Interviewer

Your question is Top 10 Spenders SQL. Start with the requirements and the one table in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.