Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Top Customers by Region Volume

Medium
SQL & Data ManipulationWindow FunctionsJoinsRanking
Asked 2mo ago|
Idfc First Bank
Idfc First Bank
Asked 30 times

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

You are practicing as a guest. Sign up free to run your code against the sample data. Your draft stays right here.

Sign up freeI have an account
SELECT ...
FROM ...
JOIN ... ON ...
GROUP BY ...
HAVING ...
ORDER BY ... DESC;
Sign up to unlock solutions
JPMorganChase Data Visualisation Specialist Interview QuestionsWish Business Analyst Interview QuestionsCommonwealth Bank of Australia Data Engineer Interview QuestionsCitadel Data Analyst Interview QuestionsBoston Consulting Group Business Analyst Interview Questions
Next questions
GoogleTop Transaction Users by CountryMediumRevolutTop Users by Recent Transaction VolumeMediumFinacleTop Customers by SpendMedium
PostgreSQL