List unique customer cities
Return one city column containing each distinct non-NULL city in customers. Keep an empty string if it exists. Row order does not matter.
Difficulty: beginner
Show hint
Use DISTINCT and IS NOT NULL. NULL and an empty string are different values.
Tables and sample data
Each test starts with fresh tables. Result rows may be returned in any order. Column names and column order must match.
| customer_id (integer) | name (text) | city (text) |
|---|---|---|
| 1 | Asha | Kathmandu |
| 2 | Bina | Pokhara |
| 3 | Chen | Kathmandu |
| 4 | Dee | NULL |
| city |
|---|
| Kathmandu |
| Pokhara |