SQL UPPER and LOWER
Change text to capitals or small letters.
Syntax
UPPER(text) LOWER(text)
Also handy for comparing text without caring about case: LOWER(name) = 'mia chen'.
Example
Query (on the shop database used in the SQL course)
SELECT name, UPPER(name) AS upper_name, LOWER(country) AS lower_country FROM customers LIMIT 4;
Result
| name | upper_name | lower_country |
|---|---|---|
| Aarav Sharma | AARAV SHARMA | new zealand |
| Mia Chen | MIA CHEN | australia |
| Liam Walker | LIAM WALKER | australia |
| Sita Gurung | SITA GURUNG | australia |
4 rows
Related
Learn it step by step in the free lesson Functions: Text, Numbers, Dates & CASE, with exercises that check your queries.