SQL Reference

How to Read the Syntax Diagrams

Throughout this book, syntax is described using the structure defined as follows:

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

The >>--- symbol indicates the beginning of a statement.

The ---> symbol indicates that the statement syntax is continued on the next line.

The >--- symbol indicates that a statement is continued from the previous line.

The -->< symbol indicates the end of a statement.

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

>>-STATEMENT--required item------------------------------------><
 

Optional items appear below the main path.

>>-STATEMENT----+----------------+-----------------------------><
                '-optional item--'
 

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

                .-optional item--.
>>-STATEMENT----+----------------+-----------------------------><
 

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.

>>-STATEMENT----+-required choice1-+---------------------------><
                '-required choice2-'
 

If choosing none of the items is an option, the entire stack appears below the main path.

>>-STATEMENT----+------------------+---------------------------><
                +-optional choice1-+
                '-optional choice2-'
 

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

                .-default choice--.
>>-STATEMENT----+-----------------+----------------------------><
                +-optional choice-+
                '-optional 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.

                .--------------------.
                V                    |
>>-STATEMENT-------repeatable item---+-------------------------><
 

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

                .-,------------------.
                V                    |
>>-STATEMENT-------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 set of several parameters. For example, in the following diagram, the variable parameter-block can be replaced by any of the interpretations of the diagram that is headed parameter-block:

>>-STATEMENT----| parameter-block |----------------------------><
 
 
parameter-block
 
|--+-parameter1-----------------+-------------------------------|
   '-parameter2--+-parameter3-+-'
                 '-parameter4-'
 

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

>>-STATEMENT--item1--*--item2--*--item3--*--item4--------------><
 

The above diagram shows that item2 and item3 may be specified in either order. Both of the following are valid:

STATEMENT item1 item2 item3 item4
STATEMENT item1 item3 item2 item4


[ Top of Page | Previous Page | Next Page ]