EarthCam wants to identify the customers generating the most revenue from camera, monitoring, and streaming orders. Write a PostgreSQL query that returns the 10 customers with the highest total spend.
customer_name and calculate total spend with SUM(amount).customer_name ascending as a deterministic tie-breaker.A NULL order amount should not contribute to a customer's total. The query should still include that customer if the customer has other valid orders.
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| customer_name | VARCHAR(150) | Name of the customer |
| amount | NUMERIC(12,2) | Order amount in US dollars |
| order_date | DATE | Date the order was placed |