Database

MySQL LOWER Function

MySQL LOWER Function

In this tutorial, we will learn about MySQL LOWER Function with some examples. We can use this function to convert the characters in the given string to lowercase format.

MySQL LOWER Function

The LOWER() function returns the string with all characters in the lowercase.

Syntax

The general syntax of the function is as follows:

LOWER(<string>)

For example:

LOWER(‘ABC’) will output ‘abc’

Examples

Let’s use the function and check the output of the function in this example.

mysql> SELECT LOWER(‘MySQL Tutorials’);
+————————–+
| LOWER(‘MySQL Tutorials’) |
+————————–+
| mysql tutorials |
+————————–+
1 row in set (0.00 sec)

MySQL LOWER Function

In this example, we will convert the column values of a database table into lower case. Let’s use the Country database table from the world MySQL database. The column is the Name column that contains the country name. Since the table has many rows will filter the output to rows from the ‘North America’ continent.

mysql> SELECT Name, LOWER(Name)
-> FROM Country
-> WHERE Continent=’North America’;

 

MySQL LOWER function database examples

—

MySQL Tutorials

MySQL Tutorials on this website:

https://www.testingdocs.com/mysql-tutorials-for-beginners/