Practice · medium · dataset: ecom

Orders by channel and status

Operations wants a per-channel count of paid, pending, and cancelled orders in one table. Return channel, paid_count, pending_count, and cancelled_count.

Sort by channel ascending. Each channel must appear once, with the three counts computed from the same set of orders.

Tables available

Table Columns
orders order_id, customer_id, order_date, status, channel

refunded and shipped orders are not part of the three requested counts.

⌘/Ctrl + Enter to grade

Write a query, then grade it.

Hints

Try it first. Reveal a hint only when you are stuck.