Tell me about a time you worked on a SQL query code test and then fixed a bug in the solution.
For the SQL portion, use the provided customers and payments tables. Write the corrected query that returns settled payment totals for active customers, including customers with no settled payments.
customer_name and total_settled_amount.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer display name |
| is_active | BOOLEAN | Whether the customer is active |
| Column | Type | Description |
|---|---|---|
| payment_idPK | INT | Unique payment identifier |
| customer_id | INT | Customer associated with the payment |
| amount | NUMERIC(12,2) | Payment amount |
| status | VARCHAR(40) | Payment processing status |