How to read the syntax diagrams

The following rules apply to the syntax diagrams used in this book.

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

    The ►►─── symbol indicates the beginning of the syntax diagram.

    The ───► symbol indicates that the syntax is continued on the next line.

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

    The ───►◄ symbol indicates the end of the syntax diagram.

    Diagrams of syntactical units start with the |─── symbol and end with the ───| symbol.

  • 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 item appears above the main path, that item is optional, and has no effect on the execution of the statement and is used only for readability.

    Read syntax diagramSkip visual syntax diagramrequired_itemoptional_item
  • If more than one item can be chosen, they appear vertically, in a stack.

    If one of the items must be chosen, one item of the stack appears on the main path.

    Read syntax diagramSkip visual syntax diagramrequired_itemrequired_choicerequired_choice

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

    Read syntax diagramSkip visual syntax diagramrequired_itemoptional_choiceoptional_choice

    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

    If an optional item has a default when it is not specified, the default appears above the main path.

    Read syntax diagramSkip visual syntax diagramrequired_itemoptional_choicedefault_choicerequired_choicerequired_choiceoptional_choice
  • An arrow returning to the left, above the main line, indicates an item that can be repeated.

    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 the items in the stack can be repeated.

  • Keywords appear in uppercase (for example, FROM). They must be spelled exactly as shown. Variables appear in all lowercase letters (for example, column-name). They represent user-supplied names or values.
  • If punctuation marks, parentheses, arithmetic operators, or other such symbols are shown, you must enter them as part of the syntax.
  • The syntax diagrams only contain the preferred or standard keywords. If nonstandard synonyms are supported in addition to the standard keywords, they are described in the Notes sections instead of the syntax diagrams. For maximum portability, use the preferred or standard keywords.
  • 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