The LCASE() function in MySQL is used to convert any text value to lower-case letters. This is helpful when you want to make your data case-insensitive or just to display information in a uniform style.
MySQL LCASE Function Syntax
SQL
x
1
LCASE(text)
MySQL LCASE Function Example
This query converts the text “SQL Tutorial is FUN!” to all lower-case letters:
SQL
1
1
SELECT LCASE("SQL Tutorial is FUN!") AS LowercaseText;
Note: This example works in MySQL, but does not work in SQLite or the TechKubo Playground.
MySQL LCASE Function Parameters
Parameter | Description |
---|---|
text | Required. The string to convert. |
MySQL LCASE Function Patients Table Example
This query will return the first_name from the Patients table as all lower-case letters:
SQL
1
1
SELECT LCASE(first_name) AS LowercaseFirstName
2
FROM Patients;
Note: This example works in MySQL, but does not work in SQLite or the TechKubo Playground.
MySQL LCASE Function Notes
- The
LCASE()
function converts all characters in a string to lower-case.- This function is identical to
LOWER()
; both work the same way in MySQL.- If you use SQLite or the TechKubo Playground, use
LOWER()
instead—LCASE()
will return an error there.LCASE()
works in MySQL 4.0 and newer.