Which of the following relational query languages have the same expressive…
2006
Which of the following relational query languages have the same expressive power?
Relational algebra
Tuple relational calculus restricted to safe expressions
Domain relational calculus restricted to safe expressions
- A.
II and III only
- B.
I and II only
- C.
I and III only
- D.
I, II and III
Attempted by 110 students.
Show answer & explanation
Correct answer: D
Answer: All three languages — relational algebra, tuple relational calculus restricted to safe expressions, and domain relational calculus restricted to safe expressions — have the same expressive power.
Key fact (Codd's theorem): Relational algebra, safe tuple relational calculus, and safe domain relational calculus can express exactly the same set of queries over finite relations.
Role of safety: Restricting tuple and domain relational calculus to safe expressions prevents formulas that produce infinite or domain-dependent results; this restriction is essential for the equivalence with relational algebra.
Operator-to-calculus correspondence (sketch):
- Selection: The algebra selection σ_condition(R) corresponds to {t | t ∈ R and condition(t)} in calculus.
- Projection: The algebra projection π_A,B(R) corresponds to {t[A,B] | ∃u (u ∈ R and t[A]=u[A] and t[B]=u[B])}.
- Join and Cartesian product: Expressed by conjunction and existential quantification over tuples from each relation.
- Union and set difference: Expressible with disjunction and negation (negation must be used in a safe, domain-independent way).
Because every relational algebra operator can be simulated in the safe calculi, and every safe calculus expression corresponds to some relational algebra expression, the three formalisms are equivalent in expressive power.
Conclusion: The correct choice is the one that includes all three languages, since they are equivalent when the calculi are restricted to safe expressions.