UCASE

UCASE is a function in SQL that converts the value of a selected column into uppercase.

UCASE(string)

  • string: This is the string value that should be converted to uppercase letters. It can be a column name, a literal string, or a combination of column names and literal strings.

Example

SELECT UCASE('Hello World!');

Output

'HELLO WORLD!'

Explanation

In the above example, the UCASE() function is used to convert the string ‘Hello World!’ to uppercase, and the result ‘HELLO WORLD!’ is displayed.

UCASE(string)

  • string: This parameter represents the string value that needs to be converted to uppercase. UCASE() function will convert all the lowercase characters in the string to uppercase. It accepts character or binary data types.

Example

SELECT UCASE('sql tutorial') AS UpperCaseText;

Output

UpperCaseText
------------------------
SQL TUTORIAL

Explanation

In the provided SQL statement, the UCASE() function is used to convert all the lowercase characters in the ‘sql tutorial’ string to uppercase. The resulting uppercase text ‘SQL TUTORIAL’ is returned in the UpperCaseText column.

UCASE(string)

  • string: It refers to the string of characters that needs to be converted to uppercase. This is the input provided by the user that the UCASE function will manipulate. The string could be either a column name or a literal string with lowercase letters.

Example

SELECT UCASE('sql database') AS UpperCase FROM dual;

Output

"UPPERCASE"
"SQL DATABASE"

Explanation

In the given example, the UCASE function is used to upper-case a string provided as input. The output is the original string converted to upper case. The dual table in Oracle is a special single-row table present by default in all Oracle databases.

For in-depth explanations and examples SQL keywords where you write your SQL, install our extension.