Introduction to Relational Calculus
by K. Yue
1. Introduction
-
Non-procedural, declarative and higher level.
-
Two kinds:
- Domain Oriented Relational Calculus
- Tuple Oriented Relational Calculus
- Results specified by the set builder form.
2. TORC
- The variables in TORC are tuples.
- Format: {t | condition(t)}
- Reference to individual attribute A of tuple t: t(A) or t.A.
- Membership: R(t): t is a tuple in the relation R.
- Boolean operations: AND, OR, NOT.
- Quantifiers: universal and existential.
Exercise:
Work on some of the query questions listed in the Supplies database example in TORC.
3. DORC
- The variables in DORC are attributes (domain values).
- Query By Example (QBE) is based on DORC.
Exercise:
Work on some of the query questions listed in the Supplies database example in DORC.