31、Tuple Relational Calculus
① A nonprocedural query language, where each query is of the form
{t | P (t ) }
② It is the set of all tuples t such that predicate P is true for t ③ is a tuple variable , t [A ] denotes the value of tuple t on attribute A ④ t ∈ r denotes that tuple t is in relation r ⑤ P is a formula similar to that of the predicate calculus
32、Predicate Calculus Formula
- Set of attributes and constants
- Set of comparison operators: (e.g., <, ≤, =,>, ≥)
- Set of logical connectives: and (∧), or (v)? not (?)
- Implication (?): x ? y, if x if true, then y is true
x ? y ≡ ?x v y
- Set of quantifiers:
?t ∈r (Q (t )) ≡ ”there exists” a tuple in t in relation r such that predicate Q (t ) is true ?t ∈r (Q (t )) ≡ Q is true “for all” tuples t in relation r
33、Example Queries
|