Median vs Average Order Value
MediumDescription
For delivered orders, show in one row:
orders: how many there areavg_order: the averagetotal_amountmedian_order: the mediantotal_amount, the middle value once the amounts are sorted. With an even number of orders, it's the average of the two middle values.
Round avg_order and median_order to 2 decimal places.
Tables
| orders |
|---|
| order_id (PK) |
| customer_id (FK) |
| order_date |
| status |
| total_amount |
| shipping_city |