A payments team wants a histogram of order sizes from the orders table:
orders (
order_id INTEGER PRIMARY KEY,
amount INTEGER
)
Bucket each order:
- 'small' : amount < 50
- 'medium' : amount between 50 and 199 (inclusive)
- 'large' : amount >= 200
Write a SQL query that returns each bucket that has at least one order,
with its order count.
Return columns: bucket, order_count.
Order buckets small, then medium, then large (only include non-empty buckets).