Will city = 'Berlin' and city <> 'Berlin' include every customer?
The query combines customers from Berlin with customers from outside Berlin. How many rows will it return?
Predict the resultNULLMiddleAnalystData EngineerBackendQA
Input data · iv_customers
| id | name | city |
|---|---|---|
| 1 | Alice | Berlin |
| 2 | Bob | Paris |
| 3 | Carol | NULL |
| 4 | Dan | Berlin |
| 5 | Eve | Paris |
Query
SELECT name FROM iv_customers WHERE city = 'Berlin'
UNION ALL
SELECT name FROM iv_customers WHERE city <> 'Berlin'