LOWER

LOWER is a SQL function that converts all letters in a specified string to lowercase.

LOWER(str)

  • str: The input string for which all uppercase characters need to be converted into their lowercase equivalents.

Example

SELECT LOWER('HELLO WORLD');

Output

'hello world'

Explanation

The LOWER() function in SQL is used to convert all letters in a text string to lowercase. In the provided example, the input string ‘HELLO WORLD’ was converted to ‘hello world’.

LOWER(string text) RETURNS text

  • string text: This is a mandatory parameter. It is the text that needs to be converted to lower case. The string text can be a literal string, data from table columns or a derived character string. This function will return a version of the supplied string text where all uppercase characters have been changed to lowercase.

Example

SELECT LOWER('Hello World!');

Output

hello world!

Explanation

The LOWER function in PostgreSQL converts all letters in a text string to lower case. Used above, ‘Hello World!’ becomes ‘hello world!’.

LOWER( string_expression )

  • string_expression: This is the string that needs to be converted to lowercase. It is expressed as a variable, column, or string literal.

Example

SELECT LOWER('SELECT LOWER FUNCTION IN SQL') AS Lowercase_Output;

Output

lowercase_output
-----------------
select lower function in sql

Explanation

In the given example, the LOWER function is used to convert all the text of the string ‘SELECT LOWER FUNCTION IN SQL’ to lowercase. The result is ‘select lower function in sql’.

LOWER(string)

  • string: This parameter represents the string value to be converted to lowercase. All alphabetical characters in the specified string are converted to lowercase and non-alphabetical characters remain unchanged.

Example

SELECT LOWER('Hello World!') FROM dual;

Output

'hello world!'

Explanation

In Oracle SQL, the LOWER function converts all letters in the specified string to lowercase. In the example, ‘Hello World!’ is converted to ‘hello world!’.

LOWER(X)

  • x: This parameter represents the string that will be transformed into lowercase. It can be a string of text, or a column containing text within a database. The LOWER(X) function will convert all uppercase characters in the string to their lowercase equivalents.

Example

SELECT LOWER('HELLO WORLD') as lower_cased_text;

Output

lower_cased_text
----------------
hello world

Explanation

The LOWER() function in SQLite is used to convert all letters in a text string to lower case. In the given example, the function converts ‘HELLO WORLD’ to ‘hello world’.

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