100

Complete Order Analysis

Hardmultiple JOINsmultiple aggregationscomplex query

Problem Description

Write a comprehensive SQL query combining customers, orders, and products to show customer spending details.

Expected Columns

  • customer_name
  • city
  • total_orders
  • total_items
  • total_spent
  • avg_order_value

Example Output

| customer_name | city | total_orders | total_items | total_spent | avg_order_value | |---------------|------|--------------|-------------|-------------|-----------------| | Rajesh Kumar | Mumbai | 3 | 4 | 83200.0 | 27733.33 | | Sunita Devi | Delhi | 2 | 3 | 83850.0 | 41925.0 | | ... | ... | ... | ... | ... | ... |

Hints

Unlocks after 2 more attempts
Submit your solution to unlock hints
//#100 Complete Order Analysis
Hard

Loading schema...

Loading editor...

No results yet

Run a query to see results