Home » UPPER Function in SQL

UPPER Function in SQL

by Online Tutorials Library

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
Faculty_Address Faculty_City Faculty_Salary 1001 arush sharma 4001 aman vihar delhi 20000 1002 bulbul roy 4002 nirman vihar delhi 38000 1004 saurabh roy 4001 sector 128 mumbai 45000 1005 shivani singhania 4001 vivek viharkolkata42000 1006 avinash sharma 4002 sarvodya calony delhi 28000 1007 shyam besas 4003 krishna nagar lucknow 35000

You may also like