| ||
Syntax diagrams in this book use Backus-Naur Form syntax notation conventions. Backus-Naur Form has become the de facto standard for most computer texts :
Angle brackets: < ... >. Angle brackets are used to represent names of categories and are also known as substitution variable representation . In this example, <table> will be replaced with a table name :
SELECT * FROM <table>;
The preceding code becomes:
SELECT * FROM country;
OR: . A pipe or character represents an OR conjunction meaning either can be selected. In this case, all or some fields can be retrieved, some meaning one or more:
SELECT { * { <field>, ... } } FROM <table>;
The preceding code becomes:
SELECT name, id, population FROM country;
Optional: [ ]. In a SELECT statement, a WHERE clause is syntactically optional:
SELECT * FROM <table> [ WHERE <field> = ... ];
The preceding code becomes:
SELECT * FROM name WHERE name='England';
At least one of: { }. For example, the SELECT statement must include one of *, or a list of one or more fields:
SELECT { * { <field>, ... } } FROM <table>;
The preceding code becomes:
SELECT name, id, population FROM country;
This is not a precise interpretation of Backus-Naur Form where curly braces usually represent zero or more. In this book, curly braces represent one or more iterations, never zero.
| ||