Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Top Customer per Region

For each region return the customer with the highest total order amount (customer and total). Order by region.

Table schema

Orders(id INT PRIMARY KEY, customer VARCHAR(20), region VARCHAR(10), amount INT)

Sample data

id | customer | region | amount
1 | A | East | 100
2 | B | East | 150
3 | C | West | 80
4 | A | East | 30

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.