Facebook Page Twitter Page LinkedIn Page
× SQL Tutorial SQL Advanced SQL Database SQL Resources


Keywords are reserved words and SQL 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.

SQL Keywords
KeywordDescription
ADD Adds a column in an existing table.
ADD CONSTRAINT Adds a constraint after a table is already created.
ALTER Adds, deletes, or modifies columns in a table, or changes the data type of a column in a table.
ALTER COLUMN Changes the data type of a column in a table.
ALTER TABLE Adds, deletes, or modifies columns in an existing table.
ALL Returns true if all of the subquery values satisfies the condition.
AND Combines multiple conditions and include a record if all the conditions separated by AND keyword are true.
ANY Returns true if any of the subquery values satisfies the condition.
AS Renames a column or table with an alias.
ASC Sorts the result set in ascending order.
BACKUP DATABASE Creates a back up of an existing database.
BETWEEN Specify a range in SQL statement.
CASE Creates different outputs based on conditions.
CHECK A constraint to ensures that all values in a column of a table satisfies certain conditions.
COLUMN Changes the data type of a column or deletes a column in a table.
CONSTRAINT Adds or deletes a constraint.
CREATE Creates a database, index, view, table, or procedure.
CREATE DATABASE Creates a new SQL database.
CREATE INDEX Creates an index on a table (allows duplicate values).
CREATE OR REPLACE VIEW Updates a view.
CREATE TABLE Creates a new table in the database.
CREATE PROCEDURE Creates a stored procedure
CREATE UNIQUE INDEX Creates a unique index on a table (no duplicate values).
CREATE VIEW Creates a view based on a SELECT statement.
DATABASE Creates or deletes an SQL database
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
DISTINCT Selects only distinct (different) values from the database.
DROP Deletes a column, constraint, database, index, table, or view
DROP COLUMN Deletes a column in a table
DROP CONSTRAINT Deletes a UNIQUE, PRIMARY KEY, FOREIGN KEY, or CHECK constraint
DROP DATABASE Deletes an existing SQL database
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
EXEC Executes a stored procedure
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
FULL JOIN Returns all rows from both of the tables when there is a match in either left table or right table.
FULL OUTER JOIN Returns all rows from both of the tables when there is a match in either left table or right table.
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 SQL 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
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 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.
OUTER JOIN Returns all rows when there is a match in either left table or right table
PRIMARY KEY A constraint that ensures that all values in a column are unique and not null.
PROCEDURE A stored procedure
RIGHT JOIN Returns all rows of the right table and matching rows of the left table.
RIGHT OUTER JOIN Returns all rows of the right table and matching rows of the left table.
ROWNUM Specifies number of records to fetch from a table.
SELECT Selects data from a database.
SELECT DISTINCT Selects only distinct (different) values from a database.
SELECT INTO Copies data from one table into a new table
SELECT TOP Specifies number or percentage of records to fetch from a table.
SET Specifies which columns and values that should be updated in a table.
TABLE Creates a table, or adds, deletes, or modifies columns in a table, or deletes a table or data inside a table
TOP Specifies number or percentage of records to fetch from 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 (constraint) A constraint that ensures that all values in a column are unique.
UNIQUE (operator) A operator used to check whether the sub-query has any duplicate values in the result.
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

5