Distribution of Orders per Customer
Medium
Derived Tables
Return how many customers placed exactly 1 order, exactly 2 orders, and so on: order_count and customers, ordered by order_count.
Table schema
Orders(id INT PRIMARY KEY, customer VARCHAR(10))Sample data
id | customer
1 | Ann
2 | Ann
3 | Bob
4 | Cy
5 | Dee
6 | Dee
7 | Dee
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.