SQLite Expressions are the combination of one or more values, operators and SQL functions. These expressions are used to evaluate a value.
SQLite expressions are written in query language and used with SELECT statement.
SELECT column1, column2, columnN FROM table_name WHERE [CONDITION | EXPRESSION];
There are mainly three types of SQLite expressions:
SQLite Boolean expressions are used to fetch the data on the basis of matching single value.
SELECT column1, column2, columnN FROM table_name WHERE SINGLE VALUE MATCHTING EXPRESSION;
We have an existing table named "STUDENT", having the following data:
See this simple example of SQLite Boolean expression.
SELECT * FROM STUDENT WHERE FEES = 20000;
SQLite Numeric expression is used to perform any mathematical operations in the query.
SELECT numerical_expression as OPERATION_NAME [FROM table_name WHERE CONDITION] ;
SELECT (25 + 15) AS ADDITION;
Numeric expressions contain several built-in functions like avg(), sum(), count(), etc. These functions are known as aggregate data calculation functions.
SELECT COUNT(*) AS "RECORDS" FROM STUDENT;
SQlite Date expressions are used to fetch the current system date and time values.