#835

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.

mediancustomer_id
2001
3252
4003

Your query result will appear here