SQL
Data Structure
DBMS
PL/SQL
MY SQL
Mongo DB
PostgreSQL
SQL Server
Oracle
Cassandra
SQLite Syntax
SQLite Syntax
Syntax is a unique set of rules and guidelines. Following is a list of syntax for SQLite.
Case sensitivity:
- SQLite is not case sensitive. But, there are some commands which are case sensitive.
- For example: GLOB and glob have different meaning in SQLite statements.
Comments:
- Comments are used to add more readability in your SQLite code.
- Comments cannot be nested.
- Comments begin with two consecutive "-" characters.
- Sometimes it also appears with "/*" and extend up to and including the next "*/" character pair.
SQLite Statements
All the SQLite statement is started with any of the keywords like SELECT, INSERT, UPDATE, DELETE, ALTER, DROP, etc. All the statement will end with a semicolon (;).
SQLite ANALYZE Statement
Syntax:
or
ANALYZE database_name;
or
ANALYZE database_name.table_name;
SQLite AND/OR Clause
Syntax:
FROM table_name
WHERE CONDITION-1 {AND|OR} CONDITION-2;
SQLite ALTER TABLE Statement
Syntax:
SQLite ALTER TABLE Statement (Rename)
Syntax:
SQLite ATTACH DATABASE Statement
Syntax:
SQLite BEGIN TRANSACTION Statement
Syntax:
or
BEGIN EXCLUSIVE TRANSACTION;
SQLite BETWEEN Clause
Syntax:
FROM table_name
WHERE column_name BETWEEN val-1 AND val-2;
SQLite COMMIT Statement:
COMMIT;
SQLite CREATE INDEX Statement
Syntax:
ON table_name ( column_name COLLATE NOCASE );
SQLite CREATE UNIQUE INDEX Statement
Syntax:
ON table_name ( column1, column2,...columnN);
SQLite CREATE TABLE Statement
Syntax:
(
column1 datatype,
column2 datatype,
column3 datatype,
columnN datatype,
PRIMARY KEY( one or more columns )
);
SQLite CREATE TRIGGER Statement
Syntax:
BEFORE INSERT ON table_name FOR EACH ROW
BEGIN
stmt1;
stmt2;
END;
SQLite CREATE VIEW Statement
Syntax:
SELECT statement....;
SQLite CREATE VIRTUAL TABLE Statement
Syntax:
or
CREATE VIRTUAL TABLE database_name.table_name USING fts3( );
SQLite COMMIT TRANSACTION Statement
Syntax:
SQLite COUNT Clause
Syntax:
FROM table_name
WHERE CONDITION;
SQLite DELETE Statement
Syntax:
WHERE {CONDITION};
SQLite DETACH DATABASE Statement
Syntax:
SQLite DISTINCT Clause
Syntax:
FROM table_name;
SQLite DROP INDEX Statement
Syntax:
SQLite DROP TABLE Statement
Syntax:
SQLite DROP VIEW Statement
Syntax:
SQLite DROP TRIGGER Statement
Syntax:
SQLite EXISTS Clause
Syntax:
FROM table_name
WHERE column_name EXISTS (SELECT * FROM table_name );
SQLite EXPLAIN Statement
Syntax:
or
EXPLAIN QUERY PLAN SELECT statement...;
SQLite GLOB Clause
Syntax:
FROM table_name
WHERE column_name GLOB { PATTERN };
SQLite GROUP BY Clause
Syntax:
SQLite HAVING Clause
Syntax:
SQLite INSERT INTO Statement
Syntax:
SQLite IN Clause
Syntax:
SQLite Like Clause
Syntax:
SQLite NOT IN Clause
Syntax:
SQLite ORDER BY Clause
Syntax:
SQLite PRAGMA Statement
Syntax:
For example:
SQLite RELEASE SAVEPOINT Statement
Syntax:
SQLite REINDEX Statement
Syntax:
SQLite ROLLBACK Statement
Syntax:
SQLite SAVEPOINT Statement
Syntax:
SQLite SELECT Statement
Syntax:
SQLite UPDATE Statement
Syntax:
SQLite VACUUM Statement
Syntax: