Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Top Customers by Region Volume

MediumSQL · PostgreSQL00:00
I
Practice interviewer
In session
5 left
00:00

Your question is Top Customers by Region Volume. Start with the requirements and the three tables on the right.

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.

Problem

Write a PostgreSQL query to return the top 3 customers by transaction volume in each region. Rank customers by total transaction count, break ties by higher total transaction amount, and then by lower customer_id.

Schema

Tables
  • customers
  • regions
  • transactions
Tablescustomersregionstransactions
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results