Your question is Classify Customer Membership by Total Spend. 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.
A retail company wants to analyze customer purchase behavior and assign membership status based on total spending.
Write a SQL query to produce a summary of each customer's total spending, order count, and membership status.
customers and orders to aggregate spending and order count per customer.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique identifier for each customer |
| customer_name | VARCHAR(255) | Name of the customer |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique identifier for each order |
| customer_id | INT | Reference to the customer who placed the order |
| amount | DECIMAL(10,2) | Total amount for the order |