Your question is SQL Query Code Test and Bug Fix. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
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 |