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

Customers With the Most Orders

Return the customer_id of every customer who has the maximum number of orders (include ties). Order by customer_id.

Table schema

Orders(id INT PRIMARY KEY, customer_id INT)

Sample data

id | customer_id
1 | 1
2 | 1
3 | 2
4 | 2
5 | 3

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.