Can you explain your experience with SQL and how you optimize complex queries?
Use the provided customers and orders tables as a hands-on example. Return active customers whose completed orders since 2025-01-01 meet both the minimum order-count and spending requirements.
customer_name, order_count, total_completed, last_order_date, and spending_tier.high, otherwise standard.total_completed descending, then customer_name ascending.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer display name |
| account_status | VARCHAR(20) | Current account status |
| customer_segment | VARCHAR(30) | Customer segment |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| customer_id | INT | Customer associated with the order |
| order_date | DATE | Date the order was placed |
| status | VARCHAR(20) | Order processing status |
| amount | NUMERIC(12,2) | Order value |