LOWER Function in SQLThis string function shows all the characters and strings in the lower case in Structured Query Language. It converts the small character or set of small characters into capital letters. We can also use the LOWER function with the string fields of the SQL table. Syntax of LOWER String FunctionSyntax1: This syntax uses the LOWER 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 LOWER string function. Syntax2: This syntax uses the LOWER function with the set of upper case characters (string): Syntax2: This syntax uses the LOWER function with the individual upper case character: Examples of LOWER String functionExample 1: The following SELECT query converts all the characters of the following string in lower case: Output: javatpoint is a good website Example 2: The following SELECT query cannot change the characters of the following string because the LOWER function cannot change the symbols and integers of the string in SQL. Output: @#$12453@# Example 3: The following SELECT query converts the capital letters into small letters: Output: new delhi is the capital of india Example 4: The following SELECT query shows the character 'S' in lower-case in the output: Output: s Example 5: This example uses the LOWER function with the SQL table In this example, we are going to create a new table whose string columns will contain upper-case characters. The syntax for creating the new SQL table is mentioned in the below block: The following CREATE statement creates the Student_Marks table: The below INSERT queries insert the records of college Faculties in the Student_Marks table: The following SELECT statement displays the inserted records of the above Student_Marks table:
The following SELECT query uses the LOWER function with the Student_Last_Name column of the above Student_Marks table: This SQL statement converts the last name in lower case of each student from the above table. Output:
The following SELECT query uses the LOWER function with the Student_First_Name, Student_City, and Student_State columns of those students whose Student_Id is greater than 4002 in the above Student_Marks table: Output:
Next TopicREPLACE Function in SQL |