SQLite has many inherent capacities to perform handling on string or numeric information. Following is the rundown of few helpful SQLite worked in capacities and all are case in-delicate which implies you can utilize these capacities either in lower-case structure or in capitalized or in blended structure. For additional subtleties, you can check official documentation for SQLite.
Sr.No. | Function & Description |
---|---|
1 |
SQLite COUNT Function SQLite COUNT aggregate function is used to count the number of rows in a database table. |
2 |
SQLite MAX Function SQLite MAX aggregate function allows us to select the highest (maximum) value for a certain column. |
3 |
SQLite MIN Function SQLite MIN aggregate function allows us to select the lowest (minimum) value for a certain column. |
4 |
SQLite AVG Function SQLite AVG aggregate function selects the average value for certain table column. |
5 |
SQLite SUM Function SQLite SUM aggregate function allows selecting the total for a numeric column. |
6 |
SQLite RANDOM Function SQLite RANDOM function returns a pseudo-random integer between -9223372036854775808 and +9223372036854775807. |
7 |
SQLite ABS Function SQLite ABS function returns the absolute value of the numeric argument. |
8 |
SQLite UPPER Function SQLite UPPER function converts a string into upper-case letters. |
9 |
SQLite LOWER Function SQLite LOWER function converts a string into lower-case letters. |
10 |
SQLite LENGTH Function SQLite LENGTH function returns the length of a string. |
11 |
SQLite sqlite_version Function SQLite sqlite_version function returns the version of the SQLite library. |
Before we begin giving models on the previously mentioned capacities, consider COMPANY table with the accompanying records.
ID NAME AGE ADDRESS SALARY
---------- ---------- ---------- ---------- ----------
1 Paul 32 California 20000.0
2 Allen 25 Texas 15000.0
3 Teddy 23 Norway 20000.0
4 Mark 25 Rich-Mond 65000.0
5 David 27 Texas 85000.0
6 Kim 22 South-Hall 45000.0
7 James 24 Houston 10000.0
SQLite COUNT Function
SQLite COUNT total capacity is utilized to include the quantity of columns in a data set table. Following is a model −
sqlite> SELECT count(*) FROM COMPANY;
The above SQLite SQL proclamation will deliver the accompanying.
count(*)
----------
7
SQLite MAX Function
SQLite MAX total capacity permits us to choose the most noteworthy (greatest) esteem for a specific section. Following is a model −
sqlite> SELECT max(salary) FROM COMPANY;
The above SQLite SQL proclamation will deliver the accompanying.
max(salary)
-----------
85000.0
SQLite MIN Function
SQLite MIN total capacity permits us to choose the most reduced (least) esteem for a specific segment. Following is a model −
sqlite> SELECT min(salary) FROM COMPANY;
The above SQLite SQL explanation will create the accompanying.
min(salary)
-----------
10000.0
SQLite AVG Function
SQLite AVG total capacity chooses the normal incentive for a specific table segment. Following is a the model −
sqlite> SELECT avg(salary) FROM COMPANY;
The above SQLite SQL explanation will deliver the accompanying.
avg(salary)
----------------
37142.8571428572
SQLite SUM Function
SQLite SUM total capacity permits choosing the absolute for a numeric section. Following is a model −
sqlite> SELECT sum(salary) FROM COMPANY;
The above SQLite SQL proclamation will create the accompanying.
sum(salary)
-----------
260000.0
SQLite RANDOM Function
SQLite RANDOM capacity restores a pseudo-arbitrary whole number between - 9223372036854775808 and +9223372036854775807. Following is a model −
sqlite> SELECT random() AS Random;
The above SQLite SQL proclamation will create the accompanying.
Random
-------------------
5876796417670984050
SQLite ABS Function
SQLite ABS work restores the total estimation of the numeric contention. Following is a model −
sqlite> SELECT abs(5), abs(-15), abs(NULL), abs(0), abs("ABC");
The above SQLite SQL explanation will deliver the accompanying.
abs(5) abs(-15) abs(NULL) abs(0) abs("ABC")
---------- ---------- ---------- ---------- ----------
5 15 0 0.0
SQLite UPPER Function
SQLite UPPER capacity changes over a string into capitalized letters. Following is a model −
sqlite> SELECT upper(name) FROM COMPANY;
The above SQLite SQL proclamation will create the accompanying.
upper(name)
-----------
PAUL
ALLEN
TEDDY
MARK
DAVID
KIM
JAMES
SQLite LOWER Function
SQLite LOWER work changes over a string into lower-case letters. Following is a model −
sqlite> SELECT lower(name) FROM COMPANY;
The above SQLite SQL proclamation will create the accompanying.
lower(name)
-----------
paul
allen
teddy
mark
david
kim
james
SQLite LENGTH Function
SQLite LENGTH work restores the length of a string. Following is a model −
sqlite> SELECT name, length(name) FROM COMPANY;
The above SQLite SQL proclamation will create the accompanying.
NAME length(name)
---------- ------------
Paul 4
Allen 5
Teddy 5
Mark 4
David 5
Kim 3
James 5
SQLite sqlite_version Function
SQLite sqlite_version work restores the form of the SQLite library. Following is a model −
sqlite> SELECT sqlite_version() AS 'SQLite Version';
The above SQLite SQL explanation will create the accompanying.
SQLite Version
--------------
3.6.20
