Describe a time you used Pandas and wrote nested SQL queries to solve a data analytics problem.
Demonstrate the SQL portion by identifying customers whose completed-order spending exceeds the average completed-order spending across customers. Exclude cancelled, null-amount, and unmatched order records from the calculation.
customer_id, customer_name, total_spent, and order_count.total_spent descending, then customer_id ascending.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer display name |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| customer_id | INT | Customer associated with the order |
| amount | NUMERIC(10,2) | Order amount |
| status | VARCHAR(20) | Order lifecycle status |
| order_date | DATE | Date the order was placed |