Which of the tuple relational calculus expression is NOT safe?

2001

Which of the tuple relational calculus expression is NOT safe?

  1. A.

    { t | ∃u ∈ R1 ( t[A] = u[A] ) ∧ ¬∃s ∈ R2 ( t[A] = s[A] ) }

  2. B.

    { t | ∀u ∈ R1 ( u[A] = "x" ⇒ ∃s ∈ R2 ( t[A] = s[A] ∧ s[A] = u[A] ) ) }

  3. C.

    { t | ¬( t ∈ R1 ) }

  4. 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 from R1

  • Also checked against values in R2

  • All variables are range-restricted

Safe

(b)

{ t | ∀u ∈ R1 ( u[A] = "x" ⇒ ∃s ∈ R2 ( t[A] = s[A] ∧ s[A] = u[A] ) ) }
  • u ranges over R1

  • s ranges over R2

  • t[A] is indirectly bound through s[A]

Safe

(c)

{ t | ¬( t ∈ R1 ) }
  • t is not restricted to any relation

  • It 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 of R1 and R2

  • All variables are properly bound

Safe

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir