LOWER()

SQL · String Functions

Theory

LOWER(string) returns a copy of the string with every letter converted to lowercase; digits, spaces and symbols are left unchanged. LOWER('Asha@TechTown.IN') returns 'asha@techtown.in'. The stored data is not changed unless you use LOWER inside an UPDATE.

Its main job is making comparisons case-insensitive. Whether 'Asha' = 'asha' is true depends on the database and its collation: MySQL and SQL Server are usually case-insensitive by default, while Postgres, Oracle and SQLite compare case-sensitively. Writing WHERE LOWER(email) = 'asha@techtown.in' gives the same answer everywhere. Grouping on LOWER(email) also exposes duplicates that differ only in case. One cost to know: applying a function to a column in WHERE can stop a normal index on that column from being used, so busy tables often store a normalised copy or use a function-based index.

Why we use it

Users type the same value in different cases: Asha@Gmail.com, asha@gmail.com, ASHA@GMAIL.COM. LOWER normalises them so searches, joins and duplicate checks treat them as the same value.

When to use it

Use LOWER for case-insensitive search, de-duplicating emails or usernames, and for normalising data before storing it. Use UPPER instead when the convention is upper case (codes, country codes). Some dialects offer ILIKE for case-insensitive pattern matching.

How it works

  1. Take the input string
  2. Read each character
  3. Is it an uppercase letter? Yes: Replace it with its lowercase form. No: Keep it unchanged.
  4. Repeat to the end of the string
  5. Return the lowercased copy

Syntax

LOWER(string)

Example

SELECT LOWER(email) FROM employees;

Key points

SQL topics

Introduction to SQL

Querying Data

Sorting Rows

Limiting Rows

Filtering Rows

Joining Multiple Tables

Grouping Rows

SET Operators

Working with Tables

Modifying Data

Views & Triggers

Conditional Expressions

SQL Subqueries

Aggregate Functions

Window Functions

String Functions

Date Functions

Math Functions

Extra Concepts

T
Tech Town
Log InSign Up Free
Home SQL Python DSA Power BI Snowflake Databricks Spark Gen AI Practice Problems Contest Blog

Master SQL from Zero to Pro

All SQL topics in one place. Click any topic in the sidebar — content opens right here without leaving the page.

{{ sectionCount }}
Sections
{{ topicCount }}
Topics
Free
Forever
Hands-on practice Practice SQL Online Solve 150 SQL interview problems in a live editor with instant checking. Start practising →
Section {{ sec.num }}

{{ sec.label }}

SQL  /  {{ current.sectionLabel }}  /  {{ current.name }}

{{ current.name }}

Theory

{{ current.def }}

Why we use it

{{ rich.why }}

When to use it

{{ rich.when }}

Diagram

{{ rich.dg.caption }}

{{ tb.title }}
{{ c.v }}
{{ rich.dg.op }}
➜
{{ rich.dg.output.title }}
{{ c.v }}
{{ nd.label }}
{{ nd.sub }}
{{ nd.label }}
{{ nd.sub }}
{{ rich.dg.left.title }}
{{ it }}
{{ rich.dg.right.title }}
{{ it }}
Flowchart — how it works
{{ nd.text }}
{{ nd.text }}
◇ {{ nd.text }}
Yes → {{ nd.yes }}
No → {{ nd.no }}
Syntax
{{ current.syntax }}
Example
{{ current.example }}
▶ Try It Live — runs against a real sample database
{{ liveError }}
{{ col }}
{{ cell }}
Key Points — click to check off as you learn
  • {{ pt.mark }} {{ pt.text }}

Share this topic