How to Use SQL Upper Function

What if one wants to change the column to uppercase in the database table?

Well, there’s UPPER() function that you can use directly to change the column to uppercase.

The upper() function converts all the letters in a string into uppercase.

For example, you have an online store where customers fill the form to sign up. As everyone is not the same, some of the mandatory fields like email addresses or country name may have a variety of inputs.

However, when you are managing the customer data from the database, you want all the email addresses in lower case or the country name in uppercase.

Doing it manually does not make sense, but you can use the SQL upper() function to change the column to uppercase!

The below example shows how to use SQL uppercase in the database.

Use of SQL Upper function:

Example: Change the column values to uppercase

UPDATE indiacity SET city = UPPER(city);

Here, the “indiacity” is the table name and  “city” is the field.

Using this query, you can change the column values to upper case.

Also, do not forget to share it using social media.

Thank you.

Jignesh Parmar

Article by

Jignesh Parmar

An expert in his field, Jignesh is the team leader at Meetanshi and a certified Magento developer. His passion for Magento has inspired others in the team too. Apart from work, he is a cricket lover.