Practice · medium · dataset: ecom

Revenue by month and channel

Break down revenue by order month and channel. Revenue is the sum of quantity times the line’s unit_price.

Return month (the first day of the month), channel, and revenue rounded to two decimals. Sort by month ascending, then by channel ascending.

Tables available

Table Columns
orders order_id, customer_id, order_date, status, channel
order_items order_id, product_id, quantity, unit_price

Only month-channel combinations with orders should appear.

⌘/Ctrl + Enter to grade

Write a query, then grade it.

Hints

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