Average Order vs Average of Customer Averages

easy
Unit 3 · Aggregation II0/3 to milestone

These two numbers differ and the difference matters. Return one row with:

  • avg_order: the average order total across all orders
  • avg_customer_avg: the average, over customers with orders, of each customer's own average order

Both rounded to 2 decimals.

Schema

customers(id, name, country, signup_date)
orders(id, customer_id, order_date, total)
#aggregation#subqueries1 visible + 1 hidden tests
query.sql · SQLite
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Average Order vs Average of Customer Averages · TechGradify