Catalog / SQLite Cheatsheet
SQLite Cheatsheet
A quick reference guide to SQLite, covering essential commands, data types, and query syntax for database management and manipulation.
Basic Commands & Syntax
Connecting & Creating Databases
|
|
|
|
|
Basic SQL Operations
|
Creates a new table in the database. |
|
Inserts a new row into the table. |
|
Retrieves data from the table based on the specified condition. |
|
Modifies existing data in the table based on the specified condition. |
|
Deletes rows from the table based on the specified condition. |
Data Types & Constraints
Common Data Types
|
|
|
|
|
Constraints
|
Uniquely identifies each row in a table. |
|
Ensures that a column cannot have a NULL value. |
|
Ensures that all values in a column are distinct. |
|
Specifies a condition that must be true for any row in the table. |
|
Specifies a default value for a column when no value is provided. |
|
Establishes a link between tables. |
Advanced Queries
WHERE Clause
|
|
|
|
|
JOIN Operations
|
Returns rows only when there is a match in both tables. |
|
Returns all rows from the left table and matching rows from the right table. If no match, the right side will contain nulls. |
|
Returns all rows from the right table and matching rows from the left table. If no match, the left side will contain nulls. |
|
Returns all rows when there is a match in one of the tables. |
|
Returns all possible combinations of rows from all tables. |
GROUP BY and Aggregate Functions
|
|
|
|
|
|
Managing Tables
Altering Tables
|
|
Dropping Tables
|
Indexes
|
Creates an index on a column to speed up query performance. |
|
Removes an index. |