Write a SQL query to find the top five customers by revenue given three tables: orders, customers, and payments.
Treat revenue as the sum of settled payments associated with each customer's orders. Include customers without settled payments as zero revenue.
customer_id, customer_name, and revenue, with one row per customer.revenue descending and customer_id ascending to break ties.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer display name |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| customer_id | INT | Customer who placed the order |
| order_date | DATE | Date the order was placed |
| Column | Type | Description |
|---|---|---|
| payment_idPK | INT | Unique payment identifier |
| order_id | INT | Order associated with the payment |
| payment_amount | NUMERIC(12,2) | Amount recorded for the payment |
| payment_status | VARCHAR(30) | Payment processing status |