If I manage a SQL, how would you approach it?
Use the provided customer and order data to demonstrate a complete SQL approach. Return customers with at least two completed orders and at least 500 in completed order value. Treat orders with other statuses as excluded, and treat customers without qualifying orders as ineligible.
customer_id, customer_name, region, completed_order_count, total_completed_amount, and customer_tier.High when total completed amount is at least 1,000; otherwise assign Standard.total_completed_amount descending, then customer_id ascending.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer name |
| region | VARCHAR(50) | Customer region |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| customer_id | INT | Customer associated with the order |
| status | VARCHAR(20) | Order status |
| amount | NUMERIC(10,2) | Order amount |