Your question is SQL Problem Solving. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Describe how you would write SQL to solve a data problem from scratch.
Use the provided customers and orders tables. Return customers with at least two completed orders, including their order count, total completed order value, latest completed order date, and spending classification.
customer_id, customer_name, order_count, total_spent, latest_order_date, and spending_band.total_spent descending, then customer_id ascending.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer's full name |
| VARCHAR(255) | Customer email address |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| customer_id | INT | Customer who placed the order |
| status | VARCHAR(30) | Order processing status |
| order_amount | NUMERIC(10,2) | Order monetary value |
| order_date | DATE | Date the order was placed |