CS FundamentalsHardGATE CS (PYQ pattern)

The tuple calculus expression { t | ¬ Student(t) } over a database with a Student relation: is it safe, and why?

  1. A. Safe: it returns the complement within the database's active domain by definition
  2. B. Safe: negation is always finite in relational databases
  3. C. Not safe: tuple variables cannot be negated at all
  4. D. Not safe: it describes all tuples not in Student, an infinite set

Correct answer: D. Not safe: it describes all tuples not in Student, an infinite set

Safety requires the result to be finite and derived from the database. The set of all tuples that are not Student tuples is infinite, so the expression is unsafe (it must be restricted, e.g. t ∈ Employee ∧ ¬ Student(t)).

More DBMS and SQL questions

Exams that ask this topic