Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Top Customers by Region Volume
00:00
5 left

Top Customers by Region Volume

MediumSQL · PostgreSQL

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
Interviewer

Your question is Top Customers by Region Volume. Start with the requirements and the three tables 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
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.