MySQL UPPER Function

The MySQL UPPER is one of the String Functions, which is very useful for converting the given character expression to uppercase. The basic syntax of the UPPER Function is as shown below:

SELECT UPPER(Expression)
FROM [Source]

To demonstrate this MySQL string Uppercase function, we are going to use the customer details table data that we have shown in the below image.

Customer Table

MySQL UPPER Function Example

The Upper Function helps to convert the user-specified string expression into uppercase characters. The following query shows you the multiple ways to use this function.

SELECT UPPER('Hello World');

SELECT UPPER('tutorial gateway');

-- Let me try NULL value
SELECT UPPER(NULL);
UPPER Function Example 1

In this String method example, we are going to implement it on a different set of columns in a customer table. The below MySQL statement converts the string data in the First_Name, Last_Name, and Education columns to uppercase and returns the same as an output.

USE company;
SELECT  First_Name, 
		UPPER(First_Name) AS FName_Upper,
		Last_Name,
        UPPER(Last_Name) AS LName_Upper,
        Education, 
        UPPER(Education) AS Edu_Upper,
        Profession, 
        Yearly_Income,     
        Sales
FROM customerdetails;
MySQL UPPER Function Example 2