The reserved terms in SQL are listed in this SQL keywords reference.
Keyword | Description |
---|---|
ADD | In an existing table, adds a column. |
ADD CONSTRAINTS | After a table has been established, adds a constraint. |
ALL | Changes the data type of a column in a table or adds, deletes, or edits columns in a table. |
ALTER | A table's columns can be added, deleted, or modified. |
ALTER COLUMN | Only rows where both requirements are true are included. |
ALTER TABLE | If any of the subquery items fit the requirement, this function returns true. |
AND | An alias is used to rename a column or table. |
ANY | Sorts the result set from top to bottom in ascending order. |
AS | Creates a database backup from an existing one. |
ASC | A table column's data type is changed. |
BACKUP DATABASE | A table column's data type is changed. |
BETWEEN | Selects values from a specified range. |
CASE | Depending on the conditions, different outcomes are generated. |
CHECK | A constraint that restricts the amount of data that can be entered into a column. |
COLUMN | Changes a column's data type or deletes a column in a table. |
CONSTRAINTS | A constraint can be added or removed. |
CREATE | A database, index, view, table, or process is created. |
CREATE DATABASE | This command creates a new SQL database. |
CREATE INDEX | Creates a table's index (allows duplicate values) |
CREATE OR REPLACE VIEW | Updates the state of a view. |
CREATE TABLE | In the database, creates a new table. |
CREATE PROCEDURE | This function creates a stored procedure. |
CREATE UNIQUE INDEX | Creates a one-of-a-kind index for a table (no duplicate values) |
CREATE VIEW | Creates a view from a SELECT statement's result set. |
DATABASE | This command creates or deletes a SQL database. |
DEFAULT | A constraint that sets a column's default value. |
DELETE | Rows from a table are deleted. |
DESC | Stored in descending order. |
DISTINCT | Only distinct (different) values are chosen. |
DROP | Removes a column, constraint, database, index, table, or view from a table or view. |
DROP COLUMN | A UNIQUE, PRIMARY KEY, FOREIGN KEY, or CHECK constraint is removed from a table. |
DROP CONSTRAINTS | A DEFAULT constraint is removed. |
DROP DATABASE | Deletes a SQL database that already exists. |
DROP DEFAULT | Removes an existing database table. |
DROP INDEX | Removes a table's index. |
DROP TABLE | Removes an existing database table. |
DROP VIEW | Removes a view from the list. |
EXEC | This function runs a stored process. |
EXISTS | In a subquery, this function checks for the existence of any record. |
FOREIGN KEY | A constraint is a key that is used to connect two tables. |
FROM | Selects or deletes data from a certain table. |
FULL OUTER JOIN | When there is a match in either the left or right table, it returns all rows. |
GROUP BY | The result set is divided into groups (used with aggregate functions: COUNT, MAX, MIN, SUM, AVG) |
HAVING | With aggregate functions, this is used instead of WHERE. |
IN | In a WHERE clause, you can specify several values. |
INDEX | In a table, creates or deletes an index. |
INNER JOIN | Returns rows with values in both tables that are the same. |
INSERT INTO | Adds new rows to a table. |
INSERT INTO SELECT | Copies information from one table to another. |
IS NULL | Empty values or decreasing order are checked. |
IS NOT NULL | Non-empty values are checked. |
JOIN | Tables are joined. |
LEFT JOIN | All rows from the left table are returned, as well as the corresponding rows from the right table. |
LIKE | In a column, looks for a specific pattern. |
LIMIT | The number of records to return in the result set is specified here. |
NOT | Only rows where a condition is false are included. |
NOT NULL | A constraint that prevents NULL values from being entered in a column. |
OR | Rows where either criterion is true are included. |
ORDER BY | Sorts the result set from top to bottom in ascending or descending order. |
OUTER JOIN | When there is a match in either the left or right table, it returns all rows. |
PRIMARY KEY | A restriction that allows each record in a database table to be uniquely identified. |
PROCEDURE | A procedure that has been saved. |
RIGHT JOIN | All rows from the right table are returned, as well as the matching rows from the left table. |
ROWNUM | The number of records to return in the result set is specified here. |
SELECT | Obtains information from a database. |
SELECT DISTINCT | Only distinct (different) values are chosen. |
SELECT INTO | Copies information from one table to another. |
SELECT TOP | The number of records to return in the result set is specified here. |
SET | Indicates which columns and values in a table should be changed. |
TABLE | Creates a table, or adds, deletes, or alters columns in a table, or deletes a table or the data it contains. |
TOP | The number of records to return in the result set is specified here. |
TRUNCATE TABLE | The data in a table is deleted, but not the table itself. |
UNION | Combines the results of two or more SELECT operations into a single result set (ONLY DISTINCT values) |
UNION ALL | Combines the results of two or more SELECT operations into a single result set (allows duplicate values) |
UNIQUE | A restriction that ensures each column's values are unique. |
UPDATE | Existing rows in a table are updated. |
VALUES | The values of an INSERT INTO statement are specified here. |
VIEW | A view is created, updated, or deleted. |
WHERE | Filters a result set to only contain records that meet a set of criteria. |