Convert a string to all uppercase or all lowercase characters.

Converts string case to upper or lower. Useful for case-insensitive comparisons and data normalization. Note: case conversion rules vary by locale for non-ASCII characters (Unicode case mapping differs from locale-specific rules).

Compatibility

Show:
Database System Support Status Since Version Notes
MySQL ✓ Supported all UPPER() and LOWER(). Case conversion is locale-aware based on the column's collation. UCASE() and LCASE() are deprecated synonyms.
PostgreSQL ✓ Supported all UPPER() and LOWER(). Locale/collation-aware. For case-insensitive comparisons, prefer ILIKE or citext extension rather than manually lowercasing.
SQL Server ✓ Supported all UPPER() and LOWER(). Behavior is collation-dependent. Turkish collation (tr_TR) is the classic gotcha — 'i'.UPPER() ≠ 'I' under Turkish collation rules.
Oracle ✓ Supported all UPPER() and LOWER(). NLS_LANGUAGE session parameter affects case conversion for locale-specific characters.
SQLite ✓ Supported all UPPER() and LOWER() only work on ASCII characters by default. Non-ASCII characters (accented letters, etc.) are NOT case-converted without loading the ICU extension.

Details

SQLite is the major gotcha — UPPER/LOWER only affects ASCII by default, so accented characters are silently left alone. SQL Server's Turkish collation is a classic production bug. For case-insensitive search, avoid LOWER(col) = LOWER(input) and use engine-native features instead: ILIKE (PostgreSQL), COLLATE (SQL Server/MySQL).

Standard Syntax

SELECT UPPER(name), LOWER(email) FROM users;

Version Support

MySQL: Since all PostgreSQL: Since all SQL Server: Since all Oracle: Since all SQLite: Since all

Per-Database Syntax & Notes

MySQL

UPPER() and LOWER(). Case conversion is locale-aware based on the column's collation. UCASE() and LCASE() are deprecated synonyms.

SELECT UPPER('hello world'); -- 'HELLO WORLD' SELECT LOWER('HELLO WORLD'); -- 'hello world'

PostgreSQL

UPPER() and LOWER(). Locale/collation-aware. For case-insensitive comparisons, prefer ILIKE or citext extension rather than manually lowercasing.

SELECT UPPER('hello world'); -- 'HELLO WORLD' SELECT LOWER('HELLO WORLD'); -- 'hello world'

SQL Server

UPPER() and LOWER(). Behavior is collation-dependent. Turkish collation (tr_TR) is the classic gotcha — 'i'.UPPER() ≠ 'I' under Turkish collation rules.

SELECT UPPER('hello world'); -- 'HELLO WORLD' SELECT LOWER('HELLO WORLD'); -- 'hello world'

Oracle

UPPER() and LOWER(). NLS_LANGUAGE session parameter affects case conversion for locale-specific characters.

SELECT UPPER('hello world') FROM DUAL; -- 'HELLO WORLD' SELECT LOWER('HELLO WORLD') FROM DUAL; -- 'hello world'

SQLite

UPPER() and LOWER() only work on ASCII characters by default. Non-ASCII characters (accented letters, etc.) are NOT case-converted without loading the ICU extension.

SELECT UPPER('hello'); -- 'HELLO' SELECT UPPER('café'); -- 'CAFé' (é not converted without ICU)