Return the input string with every character converted to its uppercase equivalent.
UPPER(str)
## Overview Returns the input string with every lowercase character replaced by its uppercase equivalent. Non-letter characters (digits, punctuation, whitespace) are passed through unchanged. UPPER is most often used to produce case-insensitive join and lookup keys, to normalise user-entered data (country codes, product SKUs, status labels), and to standardise output in reports. Because UPPER applies Unicode case mapping, it works beyond ASCII. This matters when your data includes accented Latin letters, Greek, Cyrillic, or other cased scripts. For fully locale-aware casing rules (for example the Turkish dotted/dotless I), use NORMALIZE first or handle those code points explicitly. ## Behavior - Returns NULL when the input is NULL. - Returns an empty string when the input is an empty string. - Characters that have no cased counterpart (digits, punctuation, whitespace, symbols) are copied to the output unchanged. - Operates on Unicode code points: multi-byte UTF-8 characters are handled correctly and the output is always valid UTF-8. - Some characters expand on case conversion (for example the German sharp s 'ß' maps to 'SS'), so the output length in characters may differ from the input. - Does not modify surrogate pairs or combining marks; characters outside the Basic Multilingual Plane are preserved. - Idempotent: UPPER(UPPER(x)) equals UPPER(x). ## Compatibility - Conforms to the SQL standard definition of UPPER. - Case mapping follows the default (language-neutral) Unicode rules. Locale-sensitive variants are not applied automatically.
| Name | Type | Description |
|---|---|---|
str | Specifies the input string to convert to uppercase. Accepts any UTF-8 string value. |
-- Basic lowercase to uppercase
SELECT UPPER('hello'); -- 'HELLO'
-- Normalise a column for case-insensitive matching
SELECT UPPER(email) AS email_key
FROM retail.customers.profiles;
-- NULL propagates
SELECT UPPER(CAST(NULL AS VARCHAR)); -- NULL
-- Empty string stays empty
SELECT UPPER(''); -- ''
-- Non-alphabetic characters are unchanged
SELECT UPPER('abc-123!'); -- 'ABC-123!'
-- Combine with TRIM for a canonical key
SELECT UPPER(TRIM(country_code)) AS cc
FROM retail.customers.profiles;