Compute a median ticket — outlier-resistant
Marketing wants to see the median order size per customer — the median is more outlier-resistant than the mean and better reflects the «typical» ticket. For every customer compute the median order amount. Sort by customer id.
Expected output sample
This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.
| median | customer_id |
|---|---|
| 200 | 1 |
| 325 | 2 |
| 400 | 3 |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in