MySQL UPPER is one of the String Functions, which is useful to convert the given character expression to uppercase. The basic syntax of the UPPER Function in MySQL 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 below
MySQL UPPER Example 1
The Upper Function helps convert the user-specified string expression into uppercase. The following string upper query shows multiple ways to use this function.
SELECT UPPER('Hello World'); SELECT UPPER('tutorial gateway'); -- Let me try NULL value SELECT UPPER(NULL);
OUTPUT
MySQL Uppercase function Example 2
In this String Function example, we are going to implement the MySQL string UPPER function on a different set of columns in a customer table. The below MySQL statement converts the string data in First_Name, Last_Name, and Education column to uppercase and returns the same.
-- MySQL String UPPER Example 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;
OUTPUT