Here we will learn Lower() function in SQLite and how to use SQLite Lower() function to convert given string characters to lowercase with examples.
In SQLite lower() function is used to convert given text to lowercase or specified string characters to lowercase.
In case if the given string contains other than letters means those characters won’t affect with this lower() function.
Following is the syntax of SQLite lower() function to convert given string characters to lowercase.
lower( string )
In above SQLite lower() function syntax, we defined few parameters those are
string – Its source string which is used to convert string characters to lowercase.
Now we will see how to use SQLite lower() function to convert specified string characters to lowercase with examples.
The following are the simple examples of SQLite Lower() function to convert specified string characters to lowercase.
sqlite> SELECT lower('WELCOME to Tutlane!!!');
lower("WELCOME to Tutlane!!!")
-------------------------------
welcome to tutlane!!!
sqlite> SELECT lower('TUTlane!!!123');
upper("TUTlane!!!123")
-------------------------------
tutlane!!!123
Now we will see how to use SQLite lower() function with tables to convert columns data to lowercase. 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 test table column i value with lower() function to convert values to a Lower case like as shown following.
sqlite> UPDATE test set i = lower(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 Lower() function to convert given or specified string text or characters to lowercase based on our requirements.