Which of the tuple relational calculus expression is NOT safe?
2001
Which of the tuple relational calculus expression is NOT safe?
- A.
{ t | ∃u ∈ R1 ( t[A] = u[A] ) ∧ ¬∃s ∈ R2 ( t[A] = s[A] ) }
- B.
{ t | ∀u ∈ R1 ( u[A] = "x" ⇒ ∃s ∈ R2 ( t[A] = s[A] ∧ s[A] = u[A] ) ) }
- C.
{ t | ¬( t ∈ R1 ) }
- D.
{ t | ∃u ∈ R1 ( t[A] = u[A] ) ∧ ∃s ∈ R2 ( t[A] = s[A] ) }
Attempted by 37 students.
Show answer & explanation
Correct answer: C
(a)
{ t | ∃u ∈ R1 ( t[A] = u[A] ) ∧ ¬∃s ∈ R2 ( t[A] = s[A] ) }
t[A]is restricted by values fromR1Also checked against values in
R2All variables are range-restricted
✅ Safe
(b)
{ t | ∀u ∈ R1 ( u[A] = "x" ⇒ ∃s ∈ R2 ( t[A] = s[A] ∧ s[A] = u[A] ) ) }
uranges overR1sranges overR2t[A]is indirectly bound throughs[A]
✅ Safe
(c)
{ t | ¬( t ∈ R1 ) }
tis not restricted to any relationIt can take any possible tuple value
Result may be infinite
❌ NOT SAFE
(d)
{ t | ∃u ∈ R1 ( t[A] = u[A] ) ∧ ∃s ∈ R2 ( t[A] = s[A] ) }
t[A]is restricted by attributes ofR1andR2All variables are properly bound
✅ Safe
A video solution is available for this question — log in and enroll to watch it.