This SQL keyword reference comprises the reserved words utilized in SQL.
Keyword |
Description |
ADD |
Adds a column to an existing table. |
ADD CONSTRAINT |
Applies a constraint after a table has been created. |
ALL |
Returns true if all values retrieved by the subquery meet the condition. |
ALTER |
Modifies columns in a table by adding, deleting, or altering them, including changing the data type of a column. |
ALTER COLUMN |
Alters the data type of a column in a table. |
ALTER TABLE |
Modifies columns within a table by adding, deleting, or altering them. |
AND |
|
ANY |
|
AS |
Assigns an alias to rename a column or table. |
ASC |
Arranges the result set in ascending order. |
BACKUP DATABASE |
Generates a backup of an existing database. |
BETWEEN |
Retrieves values falling within a specified range. |
CASE |
Generates various outputs depending on specified conditions. |
CHECK |
A constraint that restricts the value that can be inserted into a column. |
COLUMN |
Alters the data type of a column or removes a column from a table. |
CONSTRAINT |
Applies or removes a constraint. |
CREATE |
Creates a database, index, view, table, or procedure |
CREATE DATABASE |
Creates an index on a table (allows duplicate values) |
CREATE INDEX |
Creates an index on a table, permitting duplicate values. |
CREATE OR REPLACE VIEW |
Modifies a view. |
CREATE TABLE |
Generates a new table within the database. |
CREATE PROCEDURE |
Generates a stored procedure. |
CREATE UNIQUE INDEX |
Creates a unique index on a table, ensuring no duplicate values are allowed. |
CREATE VIEW |
Creates a view using the result set of a SELECT statement. |
DATABASE |
Creates or deletes an SQL database. |
DEFAULT |
A constraint that specifies a default value for a column. |
DELETE |
Removes rows from a table. |
DESC |
Arranges the result set in descending order. |
DISTINCT |
Retrieves only unique (distinct) values. |
DROP |
Removes a column, constraint, database, index, table, or view. |
DROP COLUMN |
Removes a column from a table. |
DROP CONSTRAINT |
“Remove a constraint such as UNIQUE, PRIMARY KEY, FOREIGN KEY, or CHECK.” |
DROP DATABASE |
Removes an existing SQL database. |
DROP DEFAULT |
Removes a DEFAULT constraint |
DROP INDEX |
Removes an index from a table |
DROP TABLE |
Removes an existing table from the database. |
DROP VIEW |
Removes a view. |
EXEC |
Runs a stored procedure. |
Checks for the presence of any record in a subquery. |
|
FOREIGN KEY |
A key constraint utilized to connect two tables. |
FROM |
Specifies the table from which to select or delete data. |
FULL OUTER JOIN |
Retrieves all rows where there is a match either in the left table or the right table |
GROUP BY |
Groups the result set using aggregate functions such as COUNT, MAX, MIN, SUM, AVG. |
HAVING |
Utilized in place of WHERE when working with aggregate functions. |
IN |
Enables specifying multiple values within a WHERE clause. |
INDEX |
Establishes or removes an index within a table. |
INNER JOIN |
Retrieves rows with matching values in both tables. |
INSERT INTO |
Adds new rows to a table. |
INSERT INTO SELECT |
Transfers data from one table to another. |
IS NULL |
Checks for null values. |
IS NOT NULL |
Checks for values that are not null. |
JOIN |
Combines tables. |
LEFT JOIN |
Retrieves all rows from the left table and matching rows from the right table. |
LIKE |
Looks for a specified pattern within a column. |
LIMIT |
Defines the quantity of records to be included in the result set. |
NOT |
Excludes rows where a condition is false |
NOT NULL |
A constraint that mandates a column to not allow NULL values. |
OR |
Incorporates rows where either condition is true. |
ORDER BY |
Arranges the result set in ascending or descending order. |
OUTER JOIN |
Retrieves all rows when there is a match in either the left or right table. |
PRIMARY KEY |
A constraint that ensures each record in a database table is uniquely identified. |
PROCEDURE |
A stored procedure. |
RIGHT JOIN |
Retrieves all rows from the right table and matching rows from the left table. |
ROWNUM |
Specifies the quantity of records to be returned in the result set. |
SELECT |
Retrieves data from a database. |
SELECT DISTINCT |
Retrieves only unique values. |
SELECT INTO |
Duplicates data from one table into a new table. |
SELECT TOP |
Determines the count of records to include in the result set. |
SET |
Specifies the columns and their corresponding values to update in a table. |
TABLE |
“Creates a table, adds, deletes, or modifies columns within a table, deletes a table, or manipulates data within a table.” |
TOP |
“Defines the quantity of records to retrieve in the result set.” |
TRUNCATE TABLE |
“Clears the data within a table, without affecting the table structure itself.” |
UNION |
“Merges the result sets of two or more SELECT statements, considering only distinct values.” |
UNION ALL |
“Merges the result sets of two or more SELECT statements, including duplicate values.” |
UNIQUE |
“A constraint that guarantees all values in a column are unique.” |
UPDATE |
“Modifies existing rows in a table.” |
VALUES |
“Defines the values for an INSERT INTO statement.” |
VIEW |
“Establishes, modifies, or removes a view.” |
WHERE |
“Refines a result set to include only records that meet a specified condition.” |