SQL LCASE() & UCASE() Function


The UCASE() Function

The UCASE() function converts the value of a field to uppercase.

SQL UCASE() Syntax

SELECT UCASE(column_name) FROM table_name;

Syntax for SQL Server

SELECT UPPER(column_name) FROM table_name;

Example

student Table

stud_sidstud_nameBranch
11211Ashwani SinghECE
11212Sachin YadavCSE
11213DeepakMECH
SELECT UCASE(stud_name) AS student_name_uppercase FROM student;
Output
student_name_uppercase
ASHWANI SINGH
SACHIN YADAV
DEEPAK

The LCASE() Function

The LCASE() function converts the value of a field to lowercase.

SQL LCASE() Syntax

SELECT LCASE(column_name) FROM table_name;

Syntax for SQL Server

SELECT LOWER(column_name) FROM table_name;

Example

student Table

stud_sidstud_nameBranch
11211ASHWANI SINGHECE
11212SACHIN YADAVCSE
11213DEEPAKMECH
SELECT LCASE(stud_name) AS student_name_lowercase FROM student;
Output
student_name_lowercase
ashwani singh
sachin yadav
deepak

Share this article on