Each Order's Share of the Customer's Spend

easy
Unit 6 · Window Functions I0/3 to milestone

Return each order's id, customer_id, total and share: the order total as a percentage of that customer's total spend, rounded to 1 decimal. Sort by customer_id, then id.

Schema

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