The Pyrrho Database Management System

Malcolm Crowe, University of the West of Scotland

 

Pyrrho SQL syntax

Boolean Expressions

BooleanExpr = BooleanTerm | BooleanExpr OR BooleanTerm .

BooleanTerm = BooleanFactor | BooleanTerm AND BooleanFactor .

BooleanFactor = [NOT] BooleanTest .

BooleanTest = Predicate | '(' BooleanExpr ')' | Boolean_Value .

Predicate = Any | At | Between | Comparison | Contains | Current | Every | Exists | In | Like | Null | Of | PeriodBinary | Some | Unique | [ColumnRef '.']Document_Value .

LIKE_REGEX and SIMILAR can be supported by changing options in the source code. A Document value can be supplied as an equality condition consisting of a conjunction of equality conditions on its fields and values.

Any = ANY '(' [DISTINCT|ALL] Value ')' FuncOpt .

Between = Value [NOT] BETWEEN [SYMMETRIC|ASYMMETRIC] Value AND Value .

Comparison = Value CompOp Value .

CompOp = '=' | '<>' | '<' | '>' | '<=' | '>=' .

Contains = PeriodPredicand CONTAINS (PeriodPredicand | DateTime_Value ) .

Every = EVERY '(' [DISTINCT|ALL] Value ')' FuncOpt .

Exists = EXISTS Table_Subquery | XMLEXISTS '(' XmlQuery ')' .

In = Value [NOT] IN '(' Table_Subquery | ( Value { ',' Value } ) ')' .

Like = Value [NOT] LIKE Value [ ESCAPE Value ].

Null = Value IS [NOT] NULL .

Of = Value IS [NOT] ( OF '(' [ONLY] Type {','[ONLY] Type } ')' | (CONTENT | DOCUMENT | VALID ) .

Some = SOME '(' [DISTINCT|ALL] Value ')' FuncOpt .

Unique = UNIQUE Table_Subquery .

PeriodBinary = PeriodPredicand (OVERLAPS|EQUALS|[IMMEDIATELY](PRECEDES|SUCCEEDS)) PeriodPredicand .

PeriodPredicand = { id '.'} id | PERIOD'(' Value',' Value ')' .