Beginner

698. JOIN with UPPER and LOWER

Normalize text case with UPPER or LOWER before JOINing string values.

📘 Lesson 698 of 728 ⏱ 14 min 🎯 Intermediate

UPPER converts text to uppercase and LOWER converts text to lowercase, allowing case-normalized comparisons.

Text stored with inconsistent capitalization may represent the same business value.

Match email addresses stored with different letter casing.

SQL
SELECT
    c.CustomerID,
    c.CustomerName
FROM Customers c
INNER JOIN CustomerContacts x
    ON LOWER(c.Email)
     = LOWER(x.Email);

Used in customer matching, email validation, data migration, and integration projects.

  • UPPER converts text to uppercase.
  • LOWER converts text to lowercase.
  • They can normalize text before comparison.
  • Case sensitivity depends on database collation and settings.
  • Persistent normalized keys may be better for large datasets.
Why use LOWER in a JOIN?

It can normalize both values to the same case before comparison.

Is a JOIN always case-sensitive?

No. Case sensitivity depends on the database system, collation, and configuration.

Have you finished this lesson?

Introduction to SQL – All Lessons