Combine GROUP BY with AVG. The 'is web-AOV bigger than mobile-AOV' question that drives every channel-mix conversation in DTC ops.
Channel-mix review. For each `channel` value in `ecom_orders`, compute the average `total_price`, plus the order count alongside (so we can sanity-check the small-N channels). Three columns: channel, aov, order_count. Order by aov descending, rounded to two decimals on the AOV. The fight at next month's exec review is whether mobile AOV is collapsing — I want the data ready before the meeting.
| Column | Type | Key |
|---|---|---|
| order_id | INT | PK |
| customer_id | INT | FK → ecom_customers |
| order_number | TEXT | |
| financial_status | TEXT | |
| fulfillment_status | TEXT | |
| total_price | REAL | |
| subtotal | REAL | |
| tax | REAL | |
| shipping | REAL | |
| discount_total | REAL | |
| channel | TEXT | |
| created_date | TEXT | |
| processed_date | TEXT |
Each hint you reveal reduces the XP you can earn. Try the query first.
`GROUP BY channel`, with `AVG(total_price)` and `COUNT(*)` as the two aggregates.
`ROUND(AVG(total_price), 2)` for the dollars-and-cents AOV.
Four channels: web (the bulk), mobile, draft (rare — admin-created orders), pos (rarer still). Draft AOV will look high because of small-N — flag that in the debrief, don't just present the number.