🔡 LOWER() – Convert Text to Lowercase in SQL

🔧 Quick Syntax

SELECT LOWER(column_name)
FROM table_name;

This tells SQL:

“Take whatever’s in this column and turn it all into lowercase letters.”

Super helpful for emails, usernames, or anything where case doesn’t matter.


🧾 Here’s the Table You’re Working With

Your table is called users:

id name email
1Fenn RaskFENN@EMAIL.COM
2Milo Kreshmilo@DustMail.net
3Sora DuneSora_Dune@GMAIL.COM
4Tovi Glintt.glint@WindMail.NET
5Lexa VohnLexa.Vohn@gmail.com

✅ Suppose You Want to Show All Emails in Lowercase

SELECT LOWER(email)
FROM users;

💡 Output:

fenn@email.com
milo@dustmail.net
sora_dune@gmail.com
t.glint@windmail.net
lexa.vohn@gmail.com

SQL converted all emails to lowercase — clean, consistent, and easy to work with.


✅ Suppose You Want to Compare Emails in a Case-Insensitive Way

SELECT *
FROM users
WHERE LOWER(email) = 'sora_dune@gmail.com';

Even if the email in the database is uppercase or mixed-case, SQL will lowercase it before comparing — so this search still works.


🧃 Recap – What You Learned

  • LOWER() turns text into lowercase
  • Great for email cleanup, login checks, and text normalization
  • Combine with WHERE for case-insensitive matches
  • Use with UPDATE to permanently lowercase stored data

Leave a Comment

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

Scroll to Top