next up previous
Next: String Operations Up: Basic Structure Previous: The Rename Operation

Tuple Variables

  1. Tuple variables can be used in SQL, and are defined in the from clause:

     select distinct cname, T.loan#
    

    from borrower as S, loan as T

    where S.loan# = T.loan#

    Note: The keyword as is optional here.

  2. These variables can then be used throughout the expression. Think of it as being something like the rename operator.

    Finds the names of all branches that have assets greater than at least one branch located in Burnaby.

     select distinct T.bname
    

    from branch S, branch T

    where S.bcity=``Burnaby'' and T.assets > S.assets



Osmar Zaiane
Fri May 22 19:39:12 PDT 1998