SQLite - Keywords
Keywords are reserved words and SQLite has a number of keywords that are available while working on a database. A list of these keywords with brief description are mentioned below. For more details about any keyword, please visit its page.
SQLite Keywords
Keyword | Description |
---|---|
ADD | Adds a column in an existing table. |
ADD CONSTRAINT | Adds a constraint after a table is already created. |
ALTER COLUMN | Changes the data type of a column in a table. |
ALTER TABLE | Adds, deletes, or modifies columns in an existing table. |
AND | Combines multiple conditions and include a record if all the conditions separated by AND keyword are true. |
AS | Renames a column or table with an alias. |
ASC | Sorts the result set in ascending order. |
ATTACH DATABASE | Attaches another SQLite database file to current database connection. |
BETWEEN | Specify a range in SQLite statement. |
CASE | Creates different outputs based on conditions. |
CHECK | A constraint to ensures that all values in a column of a table satisfies specified condition. |
CREATE DATABASE | Creates a new SQLite database. |
CREATE INDEX | Creates an index on a table (allows duplicate values). |
CREATE TABLE | Creates a new table in the database. |
CREATE TABLE AS | Creates a table from an existing table by copying the existing table columns. |
CREATE UNIQUE INDEX | Creates a unique index on a table (no duplicate values). |
CREATE VIEW | Creates a view based on a SELECT statement. |
CROSS JOIN | Returns all rows from both of the tables when there is a match in either left table or right table. |
DEFAULT | A constraint used to set the default value for a column. |
DELETE | Deletes the existing records from a table. |
DESC | Sorts the result set in descending order. |
DETACH DATABASE | Detaches an attached database from current database connection. |
DISTINCT | Selects only distinct (different) values from the database. |
DROP COLUMN | Deletes a column in a table. |
DROP CONSTRAINT | Deletes a UNIQUE, PRIMARY KEY, FOREIGN KEY, or CHECK constraint. |
DROP DEFAULT | Deletes a DEFAULT constraint. |
DROP INDEX | Deletes an index on a table. |
DROP TABLE | Deletes an existing table from the database. |
DROP VIEW | Deletes a view. |
EXCEPT | Returns all records from the first result-set that do not appear in the second result-set. |
EXISTS | Tests for the existence of records from a subquery. |
FOREIGN KEY | A constraint that is a key used to link two tables together. |
FROM | Specifies which table to select or delete data from |
GLOB | Search for a specified pattern in a specified column. Performs case-sensitive search. |
GROUP BY | Arrange the result table into identical groups (used with aggregate functions: COUNT, MAX, MIN, SUM, AVG). |
HAVING | Specify conditions with aggregate functions. |
IN | Specify multiple values with a SQLite WHERE clause. |
INDEX | Creates or deletes an index on a table. |
INNER JOIN | Returns all rows from both of the tables when there is a match between the columns. |
INSERT INTO | Inserts a new record in a table. |
INSERT INTO SELECT | Copies data from one table into another table |
INTERSECT | Returns the intersection of result-set of two or more SELECT statements. |
IS NULL | Tests for empty values of a field. |
IS NOT NULL | Tests for non-empty values of a field. |
JOIN | Joins rows of two or more tables based on common column between them. |
LEFT JOIN | Returns all rows of the left table and matching rows of the right table. |
LEFT OUTER JOIN | Returns all rows of the left table and matching rows of the right table. |
LIKE | Search for a specified pattern in a specified column. |
LIMIT | Specifies number of records to fetch from a table. |
NOT | Include a record where the specified condition is not true. |
NOT GLOB | Negation of GLOB. |
NOT LIKE | Negation of LIKE. |
NOT NULL | A constraint that enforces a column to not accept NULL values. |
OR | Combines multiple conditions and include a record if any of the conditions separated by OR keyword is true. |
ORDER BY | Sorts the result table in ascending or descending order. |
PRIMARY KEY | A constraint that ensures that all values in a column are unique and not null. |
SELECT | Selects data from a database. |
SELECT DISTINCT | Selects only distinct (different) values from a database. |
SELECT LIMIT | Specifies number of records to fetch from a table. |
SET | Specifies which columns and values that should be updated in a table. |
TRUNCATE TABLE | Deletes the complete data from an existing table, but not the table itself. |
UNION | Combines the result set of two or more SELECT statements (only distinct values). |
UNION ALL | Combines the result set of two or more SELECT statements (allows duplicate values). |
UNIQUE | A constraint that ensures that all values in a column are unique. |
UPDATE | Updates the existing records in a table. |
VALUES | Specifies the values of an INSERT INTO statement |
VIEW | Creates, updates, or deletes a view |
WHERE | Filters a result set to include only records that fulfill a specified condition |