Amazon's marketing team runs three promo codes: SPRING10, WELCOME5 and PRIME20. Finance asks: are the codes bringing in good orders, or just cheap ones that get sent back? Work through it in three steps. Leave cancelled orders out of every step.
For each promo code, plus orders with no code (labelled 'none'), show the number of orders and the total revenue (total_amount).
Expected output
'none'; any row orderExample of the shape (made-up values):
| promo_code | orders | revenue |
|---|---|---|
| none | 900 | 72000.00 |
| SPRING10 | 120 | 9500.00 |
Hints, the later steps and the answer come with Pro.
Step 1 of 3
Write your query here. Ctrl + Enter submits.