An articulation is a blend of at least one qualities, administrators, and SQL capacities that assess to a worth.
SQL articulations resemble equations and they are written in question language. You can likewise use to inquiry the information base for a particular arrangement of information.
Syntax
Think about the fundamental linguistic structure of the SELECT assertion as follows −
SELECT column1, column2, columnN
FROM table_name
WHERE [CONDITION | EXPRESSION];
Following are the various sorts of SQLite articulations.
SQLite - Boolean Expressions
SQLite Boolean Expressions bring the information based on coordinating single worth. Following is the linguistic structure −
SELECT column1, column2, columnN
FROM table_name
WHERE SINGLE VALUE MATCHTING EXPRESSION;
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
Following is a straightforward models indicating the utilization of SQLite Boolean Expressions −
sqlite> SELECT * FROM COMPANY WHERE SALARY = 10000;
ID NAME AGE ADDRESS SALARY
---------- ---------- ---------- ---------- ----------
4 James 24 Houston 10000.0
SQLite - Numeric Expression
These articulations are utilized to play out any numerical activity in any question. Following is the sentence structure −
SELECT numerical_expression as OPERATION_NAME
[FROM table_name WHERE CONDITION] ;
Here, numerical_expression is utilized for numerical articulation or any equation. Following is a straightforward model indicating the utilization of SQLite Numeric Expressions.
sqlite> SELECT (15 + 6) AS ADDITION
ADDITION = 21
There are a few underlying capacities, for example, avg(), whole(), tally(), and so forth, to perform what is known as total information estimations against a table or a particular table section.
sqlite> SELECT COUNT(*) AS "RECORDS" FROM COMPANY;
RECORDS = 7
SQLite - Date Expressions
Date Expressions restores the current framework date and time esteems. These articulations are utilized in different information controls.
sqlite> SELECT CURRENT_TIMESTAMP;
CURRENT_TIMESTAMP = 2013-03-17 10:43:35