Skip to content

MySQL LOWER() and UPPER() Functions

Last updated on August 5, 2015

You can use either the MySQL UPPER() or LOWER() functions to format columns in your SQL SELECT statements or you can use these functions in conjunction with the other functions to accomplish different types of formatting.

Note: UCASE() is a synonym for UPPER() and LCASE() is a synonym for LOWER().

The MySQL LOWER() function converts all characters in the specified string to lowercase. If there are characters in the string that are not letters, they are ineffective by this function.
Example : mysql> SELECT LOWER('Arjun');
-> 'arjun'

The MySQL UPPER() function converts all characters in the specified string to uppercase. If there are characters in the string that are not letters, they are ineffective by this function.
Example : mysql> SELECT UPPER('Arjun');
-> 'ARJUN'

The LOWER() AND UPPER() functions will convert the characters using the current character mapping set, which is latin1, by default.

For example if you want to update all the user’s usernames with lowercase versions of the usernames, you can write and run query something similar to below shown


UPDATE users SET `username` = UPPER( `username` );
// UPDATE table_name SET `column_name` = UPPER( `column_name` );

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments