WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

SQL LCASE() Function



LCASE () function

The LCASE () function converts the value of a field to lower case.

SQL LCASE () syntax

SELECT LCASE (column_name) FROM table_name;

Syntax for SQL Server

SELECT LOWER (column_name) FROM table_name;


Demo database

In this tutorial, we will use the welookups sample database.

Here is the data from the "Websites" table:

+----+--------------+---------------------------+-------+---------+
| id | name         | url                       | alexa | country |
+----+--------------+---------------------------+-------+---------+
| 1  | Google       | https://www.google.cm/  | 1     | USA     |
| 2  | zomato          | https://www.zomato.com/ | 13    | IN      |
| 3  | indiamart      | http://www.indiamart.com/  | 4689  | IN      |
| 4  | Yahoo          | http://Yahoo.com/       | 20    | IN      |
| 5  | Facebook     | https://www.facebook.com/| 3     | USA     |
| 7  | stackoverflow | http://stackoverflow.com/|   0 | IND     |
+----+---------------+---------------------------+-------+---------+


SQL LCASE () instance

The following SQL statement selects the "name" and "url" columns from the "Websites" table and converts the value of the "name" column to lowercase:

Example

SELECT LCASE (name) AS site_title, url
FROM Websites;

The result of executing the above SQL is as follows: