UPPER Function in SQL
This string function shows all the string characters in the upper case in Structured Query Language. It converts the small character or set of small characters into capital letters.
We can also use the UPPER function with the string fields of the SQL table.
Syntax of UPPER String Function
Syntax1: This syntax uses the UPPER function with the column names of the SQL table:
In the syntax, we have to specify the column’s name on which we want to use the UPPER string function.
Syntax2: This syntax uses the UPPER function with the set of lower case characters (string):
Syntax2: This syntax uses the UPPER function with the individual lower case character:
Examples of UPPER String function
Example 1: The following SELECT query converts all the characters of the following string in upper-case:
Output:
tutoraspire IS A GOOD WEBSITE
Example 2: The following SELECT query cannot change the characters of the following string because the UPPER function cannot change the symbols and integers of the string in SQL.
Output:
Example 3: The following SELECT query converts the small letters into capital letters:
Output:
NEW DELHI IS THE CAPITAL OF INDIA
Example 4: The following SELECT query shows the character ‘s’ in upper-case in the output:
Output:
S
Example 5: This example uses the UPPER function with the SQL table
In this example, we are going to create a new table, whose string columns will contains lower-case characters.
The syntax for creating the new table in the SQL database is as follows:
The following CREATE statement creates the Faculty_Info table:
The below INSERT queries insert the records of college Faculties in the Faculty_Info table:
The following SELECT statement displays the inserted records of the above Faculty_Info table:
Faculty_Id | Faculty_First_Name | Faculty_Last_Name | Faculty_Dept_Id |
---|