Orders Above the Customer's Own Average

medium
Unit 11 · Window Functions IV0/3 to milestone

Which orders were unusually large for that customer? Return id (order id), name, total and customer_avg (that customer's average order total, rounded to 2 decimal places) for every order whose total is greater than its customer's average. Sort by id.

Schema

customers(id, name, country, signup_date)
orders(id, customer_id, order_date, total)
#window-functions#comparison1 visible + 1 hidden tests
query.sql · SQLite
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Orders Above the Customer's Own Average · TechGradify