How to Use SQL Upper Function

How to Use SQL Upper Function

Earlier, I posted the solution to copy one column to another in SQL.

Now, 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

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

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

If you have any doubts about the solution, please mention them in the Comments section below. I’d be glad to help you out.

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

Thank you.


Get Weekly Updates

Never miss Magento tips,tricks,tutorials,and news.

Thank you for subscribing.

Something went wrong.

(based on 14 Reviews)

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

Leave a reply:

Your email address will not be published.