How to read the syntax diagrams

This topic describes the structure of SQL syntax diagrams.

Read the syntax diagrams from left to right and top to bottom, following the path of the line.

The double right arrowhead and line symbol ►►── indicates the beginning of a syntax diagram.

Two right arrowheads and a line ►►── indicates the beginning of a syntax diagram.

The line and single right arrowhead symbol ──► indicates that the syntax is continued on the next line.

A line and a single right arrowhead ──► indicates that the syntax is continued on the next line.

The right arrowhead and line symbol ►── indicates that the syntax is continued from the previous line.

A right arrowhead and a line ►── indicates that the syntax is continued from the previous line.

The line, right arrowhead, and left arrowhead symbol ──►◄ symbol indicates the end of a syntax diagram.

A line followed by a right arrowhead and a left arrowhead ──►◄ indicates the end of a syntax diagram.

Syntax fragments start with the pipe and line symbol |── and end with the ──| line and pipe symbol.

Syntax fragments start with a vertical bar and hyphens |── and end with hyphens and a vertical bar ──|.

Required items appear on the horizontal line (the main path).

Read syntax diagramSkip visual syntax diagramrequired_item

Optional items appear below the main path.

Read syntax diagramSkip visual syntax diagramrequired_itemoptional_item

If an optional item appears above the main path, that item has no effect on execution, and is used only for readability.

Read syntax diagramSkip visual syntax diagramrequired_itemoptional_item

If you can choose from two or more items, they appear in a stack.

If you must choose one of the items, one item of the stack appears on the main path.

Read syntax diagramSkip visual syntax diagramrequired_itemrequired_choice1required_choice2

If choosing one of the items is optional, the entire stack appears below the main path.

Read syntax diagramSkip visual syntax diagramrequired_itemoptional_choice1optional_choice2

If one of the items is the default, it will appear above the main path, and the remaining choices will be shown below.

Read syntax diagramSkip visual syntax diagramrequired_itemdefault_choiceoptional_choiceoptional_choice

An arrow returning to the left, above the main line, indicates an item that can be repeated. In this case, repeated items must be separated by one or more blanks.

Read syntax diagramSkip visual syntax diagramrequired_itemrepeatable_item

If the repeat arrow contains a comma, you must separate repeated items with a comma.

Read syntax diagramSkip visual syntax diagramrequired_item,repeatable_item

A repeat arrow above a stack indicates that you can make more than one choice from the stacked items or repeat a single choice.

Keywords appear in uppercase (for example, FROM). They must be spelled exactly as shown. Variables appear in lowercase (for example, column-name). They represent user-supplied names or values in the syntax.

If punctuation marks, parentheses, arithmetic operators, or other such symbols are shown, you must enter them as part of the syntax.

Sometimes a single variable represents a larger fragment of the syntax. For example, in the following diagram, the variable parameter-block represents the whole syntax fragment that is labeled parameter-block:

Read syntax diagramSkip visual syntax diagramrequired_itemparameter-block
parameter-block
Read syntax diagramSkip visual syntax diagramparameter1parameter2parameter3parameter4

Adjacent segments occurring between large bullets (●) may be specified in any sequence.

Read syntax diagramSkip visual syntax diagramrequired_itemitem1item2 item3item4
The above diagram shows that item2 and item3 may be specified in either order. Both of the following are valid:
   required_item item1 item2 item3 item4
   required_item item1 item3 item2 item4