next up previous contents
Next: Formal Definition of Up: Stages of Translation Previous: First Optimisation (OP1)

Tuple Relational Calculus (TRC)

 

Unlike SQL, the Domain Relational Calculus makes assumptions about the order of the attributes in the database's tables. For example, the objects that are quantified over are attributes, which are constrained to occur in certain positions in particular tables. In contrast, SQL's quantifiers range over tuples. We need not know where a particular attribute appears in a tables: if we know that a tuple is from a certain table, then we can pick the appropriate attribute using a column name.

The expression:

{fva1!name;fva1:emp;
      exists(skf1:emp,
         exists(t1:boss,t1!mgr=skf1!name)&
         exists(t2:boss,t2!name=fva1!name&t2!mgr=skf1!name)
      )}
is a representation of:





Chris Fox, September 1995