English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

SQL Keywords Quick Reference

The SQL keyword大全速查 has compiled the commonly used reserved keywords in SQL, such as ADD, DROP TABLE, ALTER TABLE, JOIN, UPDATE, DELETE, INSERT INTO, SELECT, WHERE, GROUP BY, etc., with usage methods and example descriptions, hoping to help everyone learn SQL language.

SQL Keywords

The SQL keyword reference includes reserved keywords in SQL.

MethodDescription
ADDAdd a column to an existing table
ADD CONSTRAINTAdd constraints after the table is created
ALTERAdd, delete, or modify columns in the table, or change the data type of columns in the table
ALTER COLUMNChange the data type of a column in the table
ALTER TABLEAdd, delete, or modify columns in the table
ALLReturn true if all subquery values meet the condition
ANDOnly contain rows where both conditions are true
ANYReturn true if any subquery value meets the condition
ASRename a column or table with an alias
ASCSort the result set in ascending order
BACKUP DATABASECreate a backup of the existing database
BETWEENSelect values within a given range
CASECreate different outputs based on conditions
CHECKConstraint that limits the values that can be placed in a column
COLUMNChange the data type of a column or delete a column from the table
CONSTRAINTAdd or delete constraints
CREATECreate a database, index, view, table, or procedure
CREATE DATABASECreate a new SQL database
CREATE INDEXCreate an index on the table (allowing duplicate values)
CREATE OR REPLACE VIEWUpdate the view
CREATE TABLECreate a new table in the database
CREATE PROCEDURECreate a stored procedure
CREATE UNIQUE INDEXCreate a unique index (no duplicate values) on the table
CREATE VIEWCreate a view based on the result set of the SELECT statement
DATABASECreate or delete an SQL database
DEFAULTA constraint that provides a default value for the column
DELETEDelete rows from the table
DESCSort the result set in descending order
DISTINCTOnly select different (different) values
DROPDrop a column, constraint, database, index, table, or view
DROP COLUMNDrop a column in the table
DROP CONSTRAINTDrop UNIQUE, PRIMARY KEY, FOREIGN KEY, or CHECK constraints
DROP DATABASEDrop the existing SQL database
DROP DEFAULTDrop the default constraint
DROP INDEXDrop the index in the table
DROP TABLEDrop the existing table in the database
DROP VIEWDrop the view
EXECExecute the stored procedure
EXISTSTest if there are any records in the subquery
FOREIGN KEYA constraint used to link two tables with a key
FROMSpecify the table from which to select or delete data
FULL OUTER JOINReturn all rows when there are matching items in the left table or right table
GROUP BYGroup the result set (used with aggregate functions: COUNT, MAX, MIN, SUM, AVG)
HAVINGUse the summary function instead of WHERE
INAllow you to specify multiple values in the WHERE clause
INDEXCreate or delete an index in the table
INNER JOINReturn rows with matching values in both tables
INSERT INTOInsert a new row into the table
INSERT INTO SELECTCopy data from one table to another
IS NULLTest null values
IS NOT NULLTest non-null values
JOINJoin table
LEFT JOINReturn all rows in the left table, as well as matching rows in the right table
LIKESearch for a specified pattern in the column
LIMITSpecify the number of records to return in the result set
NOTOnly include rows where the condition is not true
NOT NULLEnforce a constraint that the column does not accept NULL values
ORInclude rows where any condition is true
ORDER BYSort the result set in ascending or descending order
OUTER JOINReturn all rows when there are matching items in the left table or right table
PRIMARY KEYA constraint that uniquely identifies each record in a database table
PROCEDUREStored procedure
RIGHT JOINReturn all rows in the right table, as well as matching rows in the left table
ROWNUMSpecify the number of records to return in the result set
SELECTSelect data from the database
SELECT DISTINCTOnly select different (different) values
SELECT INTOCopy data from one table to a new table
SELECT TOPSpecify the number of records to return in the result set
SETSpecify the columns and values to be updated in the table
TABLECreate a table, or add, delete, or modify columns in the table, or delete the table or data in the table
TOPSpecify the number of records to return in the result set
TRUNCATE TABLEDelete data from the table without deleting the table itself
UNIONMerge the results of two or more SELECT statements (only different values)
UNION ALLMerge the results of two or more SELECT statements (allows duplicate values)
UNIQUEA constraint that ensures all values in the column are unique
UPDATEUpdate existing rows in the table
VALUESSpecify the values for the INSERT INTO statement
VIEWCreate, update, or delete a view
WHEREFilter the result set to include only records that meet the specified conditions