🔧 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 | |
---|---|---|
1 | Fenn Rask | FENN@EMAIL.COM |
2 | Milo Kresh | milo@DustMail.net |
3 | Sora Dune | Sora_Dune@GMAIL.COM |
4 | Tovi Glint | t.glint@WindMail.NET |
5 | Lexa Vohn | Lexa.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