SQL is a standard computer language used to control the access to databases and manage data in databases.
SQL provides different statements to enable you to:
SQL consists of commands and functions that are used to manage databases and database objects. SQL can also forcibly implement the rules for data types, expressions, and texts. Therefore, section "SQL Reference" describes data types, expressions, functions, and operators in addition to SQL syntax.
Released SQL standards are as follows:
GaussDB(DWS) is compatible with Postgres-XC features and supports the major features of SQL2, SQL3, and SQL4 by default, and some features of SQL5.
GaussDB(DWS) supports PL/pgSQL, PL/Java, and PL/R.
To better understand the syntax usage, you can refer to the SQL syntax text conventions described as follows:
Format |
Description |
---|---|
Uppercase characters |
Indicates that keywords (the part that remains unchanged in a statement and must be consistent with the syntax format) must be in uppercase. |
Lowercase characters |
Indicates that parameters must be in lowercase. |
[ ] |
Indicates optional syntaxes. Indicates that the items in brackets [] are optional. |
{ } |
Indicates mandatory syntaxes. |
... |
Indicates that preceding elements can appear repeatedly. |
[ x | y | ... ] |
Indicates that one item is selected from two or more options or no item is selected. |
{ x | y | ... } |
Indicates that one item is selected from two or more options. |
[x | y | ... ] [ ... ] |
Indicates that multiple parameters or no parameter can be selected. If multiple parameters are selected, separate them with spaces. |
[ x | y | ... ] [ ,... ] |
Indicates that multiple parameters or no parameter can be selected. If multiple parameters are selected, separate them with commas (,). |
{ x | y | ... } [ ... ] |
Indicates that at least one parameter can be selected. If multiple parameters are selected, separate them with spaces. |
{ x | y | ... } [ ,... ] |
Indicates that at least one parameter can be selected. If multiple parameters are selected, separate them with commas (,). |
SQL examples in this manual are developed based on the TPC-DS model. Before you execute the examples, install the TPC-DS benchmark by following the instructions on the official website https://www.tpc.org/tpcds/.