Write a SQL query to retrieve the top 10 customers based on their lifetime value.
Use the customers and orders tables. Lifetime value is the sum of qualifying order totals, excluding orders with cancelled or refunded status. Customers without qualifying orders should have a lifetime value of zero.
customer_id, customer_name, and lifetime_value.customer_id ascending as the tie-breaker.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer's display name |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| customer_id | INT | Customer associated with the order |
| order_total | DECIMAL(12,2) | Total monetary value of the order |
| status | VARCHAR(20) | Current order status |