With more than one column, DISTINCT keeps each different combination once. SELECT DISTINCT city, name would keep every customer, because no two have the same name and city.
CASE chooses a value for each row, like an "if" in a spreadsheet. It checks each WHEN in turn and uses the THEN of the first one that's true. ELSE covers everything else, and END closes it:
SELECT name, price,
CASE
WHEN price < 20 THEN 'low'
WHEN price <= 50 THEN 'mid'
ELSE 'high'
END AS band
FROM products
ORDER BY price;
Returns
name | price | band
------------+-------+-----
Sketchbook | 9.75 | low
Pond net | 12.5 | low
Field guide | 18 | low
Duck feeder | 24 | mid
Rain boots | 40 | mid
Bird bath | 45.5 | mid
Raincoat | 59 | high
Binoculars | 120 | high
(8 rows)
Because the first true WHEN wins, the second line doesn't need to say price >= 20: anything under 20 was already caught. If no WHEN is true and there's no ELSE, the result is NULL.
CASE can turn codes into words people understand, too:
SELECT id,
CASE status WHEN 'shipped' THEN 'On its way' WHEN 'pending' THEN 'Not sent yet' ELSE 'Cancelled' END AS progress
FROM orders
WHERE customer_id = 3;
Returns
id | progress
----+-----------
104 | Cancelled
110 | On its way
(2 rows)
That short form, CASE status WHEN 'shipped' …, compares one column with each value in turn.
Practice
The different cities customers live in, each once. (The missing city counts as one too.)