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

Filter by Database
SQL UPPER / LOWER Compatibility Across Databases
Database System Support Status Since Version Notes
MySQL Native all UPPER() and LOWER(). Case conversion is locale-aware based on the column's collation. UCASE() and LCASE() are deprecated synonyms.
PostgreSQL Native all UPPER() and LOWER(). Locale/collation-aware. For case-insensitive comparisons, prefer ILIKE or citext extension rather than manually lowercasing.
SQL Server Native all UPPER() and LOWER(). Behavior is collation-dependent. Turkish collation (tr_TR) is the classic gotcha — 'i'.UPPER() ≠ 'I' under Turkish collation rules.
Oracle Native all UPPER() and LOWER(). NLS_LANGUAGE session parameter affects case conversion for locale-specific characters.
SQLite Native 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: Native in all listed versions PostgreSQL: Native in all listed versions SQL Server: Native in all listed versions Oracle: Native in all listed versions SQLite: Native in all listed versions

Per-Database Syntax & Notes

MySQL Native syntax

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 Native syntax

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 Native syntax

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 Native syntax

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 Native syntax

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)