SQLite SQL Language Reference

The right SQLite command depends on the result you need. SQLite SQL is the set of commands SQLite uses to work with a database.

I’ll show how statement groups help you find a command and where to check its full syntax in SQLite’s language documentation.

TL;DR

SQLite statements fall into groups based on whether they define database objects, change rows, read data, control transactions, or inspect SQLite settings. This table is a lookup index, not a replacement for each statement’s full syntax.

GroupStatementsPurpose
Schema (DDL)CREATE TABLE, CREATE INDEX, CREATE VIEW, CREATE TRIGGER, ALTER TABLE, DROP TABLE, DROP INDEX, DROP VIEW, DROP TRIGGERCreate, change, or remove schema objects.
Data changes (DML)INSERT, UPDATE, DELETE, REPLACEAdd, modify, or remove table rows.
QueriesSELECT, VALUESRead rows or produce literal rows.
TransactionsBEGIN, COMMIT, END, ROLLBACK, SAVEPOINT, RELEASEGroup changes and control when they are committed.
Connection and maintenanceATTACH, DETACH, PRAGMA, ANALYZE, REINDEX, VACUUMConnect database files or inspect and maintain database state.

SQLite’s language documentation is the authority for exact syntax and supported options. Start with the SQLite query language index when you need a statement that is not listed here.

What Is SQLite SQL?

SQLite SQL is the language SQLite uses to define database objects, read and change rows, and manage some database operations. SQLite supports much of standard SQL, with SQLite-specific syntax and some omissions, so a command documented for another database may not work unchanged.

Start with SELECT when you need rows, and look under the data-change family when you need to modify them. CREATE, ALTER, and DROP are schema commands, and their syntax pages explain supported options.

Some commands have related forms or clauses documented on separate pages. The INSERT reference covers INSERT and its conflict behavior, while the UPDATE reference documents row changes. SQLite’s main language index also lists expression syntax, common table expressions, joins, and compound SELECT operations.

Find the SQLite Statement You Need

I tested this sequence in an in-memory SQLite database to confirm how CREATE TABLE, INSERT, UPDATE, and SELECT work together.

CREATE TABLE notes(id INTEGER PRIMARY KEY, body TEXT);
INSERT INTO notes(body) VALUES ('draft');
UPDATE notes SET body='ready' WHERE id=1;
SELECT id, body FROM notes;
1|ready

CREATE TABLE defines the table, INSERT adds a row, UPDATE changes it, and SELECT reads the result. For detailed examples, see the SQLDocs guides to the SQLite SELECT statement, SQLite UPDATE FROM, and SQLite triggers.

SQLite Syntax and Statement Boundaries

SQLite’s syntax reference describes statements separately, while an SQL statement list is a sequence separated by semicolons. Use the official page for the statement you plan to run, especially when porting SQL from another database engine.

BEGIN starts an explicit transaction, and COMMIT or ROLLBACK ends it. BEGIN transactions do not nest, so use SAVEPOINT and RELEASE for nested work. PRAGMA is SQLite-specific, so check its reference when a command returns information or changes settings.

SituationWhat to check
SQL came from SQL ServerIt may use Transact-SQL syntax or features that SQLite does not implement. Check each statement in SQLite’s reference.
A statement changes schemaUse the matching CREATE, ALTER, or DROP page. CREATE TABLE options are not interchangeable with another database’s grammar.
A transaction needs nestingUse SAVEPOINT and RELEASE rather than starting another BEGIN transaction.
A command starts with PRAGMACheck the PRAGMA documentation because these commands are SQLite-specific.

Transact-SQL is Microsoft’s SQL Server dialect, and Oracle SQL has its own reference too. Their indexes help explain why a generic SQL reference may not answer an SQLite question. Use SQLite’s own language page for the supported statements, then follow its per-statement pages for syntax details.

For statement details, consult the official pages for transactions, PRAGMA, and the full SQLite language reference.

Conclusion: Use the Index, Then Check the Syntax

Use the statement groups to find the right command, then check SQLite’s own syntax page before relying on dialect-specific behavior. The SQLite syntax hub connects this reference to more focused guides.

FAQ

These answers cover the main questions that come up when using the index.

Where is the official SQLite SQL reference?

The SQLite query language page at https://www.sqlite.org/lang.html links to statement syntax, keywords, and related language topics.

Are SQLite PRAGMA commands standard SQL?

No. PRAGMA is an SQLite-specific extension used to query or change SQLite library behavior.

Can SQLite BEGIN transactions be nested?

No. BEGIN transactions do not nest. Use SAVEPOINT and RELEASE for nested transaction scopes.