CS FundamentalsVery hardGATE CS (PYQ pattern)

Which of the following tuple-relational-calculus expressions are SAFE (guaranteed to return a finite result for every database)? I. { t | ¬(t ∈ R) } II. { t | ∃s ∈ R (t[A] = s[A]) } III. { t | t ∈ R ∨ t ∈ S } (R and S union-compatible) IV. { t | t[A] > 5 }

  1. A. II and III only
  2. B. I and IV only
  3. C. I, II and III only
  4. D. II, III and IV only

Correct answer: A. II and III only

Safety needs every tuple of the answer to come from the active domain. I (the complement of R) and IV (every tuple with A > 5) describe infinite sets; II and III draw their tuples from R and S.

More DBMS and SQL questions

Exams that ask this topic