Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Top Customers by Region Volume

MediumSQL · PostgreSQL00:00
I
Practice interviewer
Your interviewer
In session
I
Interviewer

Welcome to the SQL screen.

The question is on your right: Top Customers by Region Volume. Read through the requirements and the three tables first.

Run and submit your code as often as you need. You also have five interviewer messages this session - want to talk through your approach, or are you ready to start coding?

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