next up previous contents
Next: Tuple Attributes Up: Syntactic Extensions and Previous: Implicit Variable Declarations

More Implicit Variables

In the special case where we have exactly one starting class for a query, and no repeated variables, we can avoid explicit variables altogether. In this case we can allow from statements of the form

     FROM <class name>
expressions of the form
     <projection composition>
and select statements of the forms
     SELECT '(' <attribute list> ')'
   | SELECT *
Here a FROM statement, FROM C would be shorthand for FROM IN C where is some implicit variable; an expression projs where projs is some projection composition would be shorthand for . projs, where is the same implicit variable as bound in the in FROM statement; and the SELECT statements SELECT (, ,) and SELECT * are equivalent to SELECT (, ,) and SELECT (*) respectively.

For example the query

     SELECT (name, age)
     FROM   PERSON
     WHERE  age > 50
     ;
would be equivalent to
     SELECT _0 (name, age)
     FROM   _0 IN PERSON
     WHERE  _0.age > 50
     ;

Note that these extensions to expressions and SELECT statements are only meaningful in the case where the FROM statement consists of exactly one class name, and are not allowed in any other situation.