Syntax Definitions

The description of the syntax diagramm elements used in this tutorial.

Syntax elements used in this book

|

    The vertical line | means, that you have to use only one of the language elements on both sides of the line in the program text. This vertical line charakter is not to be used in the program text.

[ ]

    Anything in the quare brackets is optional and must not be excplicitly used. These square brackets are not to be used in the program text too.

{ }

    Anything between this brackets is considered as one language element. These brackets are not to be inserted into the program text too.

( )

    SQL language element used in field size definitions and in logical contsructs or formulas. These round brackets you have to insert into the program text at this place.

TextBigSmall

    Text elements, having big and small charakters together, are used to mark database, table, fields or aliases, or lists of them.

TEXTBIG

    Text elements, having only big charakters, are used to mark SQL keywords.

textsmall

    Text elements, having only small charakters, are used only in examples to mark table- of field- names.

[...]

    Any language elements, that are standing before [...] can be repeated and used more than once.

[,...]

    Any language elements, that are standing before [,...] can be repeated and used more than once in a list. The elements of the list have to be separated with "kommas".

SQL language elements in syntax diagramms

( )

    Round brackets. Are used in field size definitions in logical constucts or formulas.

Alias

    Alias is an alias to the original tablename, which is used instead of the tablename.

    Example:

mytable1

Fieldname

    Fieldname is the name of an databasetable-field or -column in the used database table.

    Example:

 preis 

Feldlist

    Fieldlist is a list of fieldnames of the used database table, separated with commas.

    Example:

 onum, preis, anz 

Value

    Value is here a value that can be stored in the corresponding SQL data type, such as an integer, decimal number or text in "Hochkomma".

    Example:

 'Berlin' 

Valuelist

    Valuelist is a list of values separated with commas (see value).

    Example:

 1001, 'Müller', 'Berlin', .12 

Tablename

    Tablename is a name of an table existing or to be created in the database.

    Example:

 torder 

Logical constuct

 preis &gt 100 AND preis &lt 1000 

Formula

 ( (price * prov) - .10 )

Integer

    Integer ist a number without decimals.

    Example:

 17 

Tables used in examples

Table tverkauf (salesman) :


    CREATE TABLE tverkauf (
    vnum INTEGER NOT NULL UNIQUE PRIMARY KEY,
    vname CHAR(40),
    stadt CHAR(40),
    prov DECIMAL );

Table tkunden (customers) :


    CREATE TABLE tkunden (
    knum INTEGER NOT NULL UNIQUE PRIMARY KEY,
    kname CHAR(40),
    stadt CHAR(40),
    rating INTEGER,
    vnum INTEGER );

Table torder (customer orders) :


    CREATE TABLE torder (
    onum INTEGER NOT NULL UNIQUE PRIMARY KEY,
    preis DECIMAL(2,30),
    anz REAL,
    odatum DATE,
    knum INTEGER
    vnum INTEGER );

Table tposition (order items) :


    CREATE TABLE tposition (
    pnum INTEGER NOT NULL UNIQUE PRIMARY KEY,
    onum INTEGER,
    anum INTEGER,
    menge INTEGER );

Table tartikel (products) :


    CREATE TABLE tartikel (
    anum INTEGER NOT NULL UNIQUE PRIMARY KEY,
    name CHAR(40),
    preis DECIMAL(2,30),
    hnum INTEGER );