Here we will learn Upper() function in SQLite and how to use SQLite Upper() function to convert given string characters to uppercase with examples.
In SQLite upper() function is used to convert given text to uppercase or specified string characters to uppercase.
In case if the given string contains other than letters means those characters won’t affect with this upper() function.
Following is the syntax of SQLite upper() function to convert given string characters to uppercase.
upper( string )
In above SQLite upper() function syntax, we defined few parameters those are
string – Its source string which is used to convert string characters to uppercase.
Now we will see how to use SQLite upper() function to convert specified string characters to uppercase with examples.
The following are the simple examples of SQLite Upper() function to convert specified string characters to uppercase.
sqlite>SELECT upper('Welcome to Tutlane!!!');
upper("Welcome to Tutlane!!!")
-------------------------------
WELCOME TO TUTLANE!!!
sqlite>SELECT upper('tutlane!!!123');
upper("tutlane!!!123")
-------------------------------
TUTLANE!!!123
Now we will see how to use SQLite Upper() function with tables to convert columns data to uppercase. Consider we have a table called “test” with the following records.
sqlite> SELECT * from test;
i
----------
Shweta
Shwets
Shwati
Vinay
Vijay
Vivek
Now we will update the test table column i value with Upper() function to convert values to Upper case like as shown following.
sqlite> UPDATE test set i = upper(i);
Now we will check the records of test table using following SELECT statement.
sqlite> SELECT * from test;
i
----------
SHWETA
SHWETS
SHWATI
VINAY
VIJAY
VIVEK
This is how we can use SQLite upper() function to convert required string characters to uppercase based on our requirements.