Often I want to categorize by something that isn't a column:
person 1: I want to count children/adults/teenagers but there's no column for that!
person 2: no problem! jut categorize people based on age!
`CASE` is how to write an `if` statement in SQL. Here's the syntax:
```
CASE
WHEN THEN
WHEN THEN
...
ELSE
END
```
## example:
Here's how to categorize people into age ranges!
```
SELECT first_name, age, CASE
WHEN age < 13 THEN 'child'
WHEN age < 20 THEN 'teenager'
ELSE 'adult' END AS age_range
FROM people
```
(returns first `THEN` where the condition matches)
people:
| first_name | age |
|