Example Queries



next up previous
Next: Safety of Expressions Up: The Domain Relational Previous: Formal Definitions

Example Queries

  1. Find branch name, loan number, customer name and amount for loans of over $1200.

  2. Find all customers who have a loan for an amount > than $1200.

  3. Find all customers having a loan from the SFU branch, and the city in which they live.

  4. Find all customers having a loan, an account or both at the SFU branch.

  5. Find all customers who have an account at all branches located in Brooklyn.

    If you find this example difficult to understand, try rewriting this expression using implication, as in the tuple relational calculus example. Here's my attempt:

    I've used two letter variable names to get away from the problem of having to remember what stands for.



Page created and maintained by Osmar R. Zaï ane
Last Update: Wed Sep 20 15:45:57 PDT 1995