🔧 Quick Syntax
SELECT UPPER(column_name)
FROM table_name;
This tells SQL:
“Take this column and make everything in it ALL CAPS.”
Perfect when you want to normalize text or make your output louder and clearer.
🧾 Here’s the Table You’re Working With
Your table is called products
:
id | name | category |
---|---|---|
1 | travel mug | kitchen |
2 | Hoodie Classic | clothing |
3 | wireless Mouse | electronics |
4 | Charging Cable | electronics |
5 | Eco bottle | kitchen |
✅ Suppose You Want to See All Product Names in UPPERCASE
SELECT UPPER(name)
FROM products;
💡 Output:
TRAVEL MUG
HOODIE CLASSIC
WIRELESS MOUSE
CHARGING CABLE
ECO BOTTLE
SQL turned every product name into uppercase — great for consistent formatting or reports.
✅ Suppose You Want to Compare Text Without Worrying About Case
SELECT *
FROM products
WHERE UPPER(category) = 'KITCHEN';
SQL uppercased the category
column before comparing it to 'KITCHEN'
,
so the query works no matter how the text is stored (lowercase, uppercase, or mixed).
🧃 Recap – What You Learned
UPPER()
converts text to all caps- Great for formatting, consistency, and visual emphasis
- Helps with case-insensitive comparisons when used with
WHERE
- Use with
UPDATE
if you want to save data in uppercase permanently