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 |