🔠 UPPER() – Convert Text to Uppercase in SQL

🔧 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
1travel mugkitchen
2Hoodie Classicclothing
3wireless Mouseelectronics
4Charging Cableelectronics
5Eco bottlekitchen

✅ 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

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top