Create a SQL to solve one specific problem
Use the customers and orders tables to calculate completed-order metrics for calendar year 2025. Include every customer, including customers without qualifying orders.
customer_name, completed_order_count, completed_amount, and customer_status.Priority; classify all other customers as Other.completed_amount descending, then customer_name ascending.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer name |
| customer_status | VARCHAR(20) | Current customer account status |
| 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 |
| order_status | VARCHAR(20) | Current order state |
| amount | DECIMAL(10,2) | Order amount |