Median Order Value (No MEDIAN Function)

medium
Checkpoint challenge
Solve this to show you know the material and jump straight to Unit 3. Everything before it counts as cleared.

Averages are skewed by one huge order. The median is more robust, but SQLite (like many databases) has no MEDIAN function.

Return a single row with one column, median_order_value: the median of all order totals. With an even number of orders, it's the average of the two middle values.

Schema

customers(id, name, country, signup_date)
orders(id, customer_id, order_date, total)
#window-functions#statistics#interview1 visible + 2 hidden tests
query.sql · SQLite
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Median Order Value (No MEDIAN Function) · TechGradify