Find the bugs: listing customers from Berlin
You need a list of customers whose city is actually recorded as Berlin in the database. Exclude anyone whose city is unknown. Return id, name, and city, with the rows sorted by id. A bug in the query causes it to include the wrong customers. Mark the incorrect lines.
Find the errorsNULLJuniorAnalystBackendQA
Input data · iv_customers
| id | name | city |
|---|---|---|
| 1 | Alice | Berlin |
| 2 | Bob | Paris |
| 3 | Carol | NULL |
| 4 | Dan | Berlin |
| 5 | Eve | Paris |
SELECT c.id,
c.name,
c.city
FROM iv_customers AS c
WHERE COALESCE(c.city, 'Berlin') = 'Berlin'
ORDER BY c.id