GATE / CS ARCHIVE

GATE CSE 2001 / QUESTION 2.24

Safety of relational-calculus expressions

Database Management Systems · Relational Algebra & Calculus · Full GATE CSE 2001 paper

GATE 2001, Q2.24 2 marks · MCQ
Report issue

Relational Algebra & Calculus

Question 2.24, GATE 2001: Which tuple-calculus expression is unsafe? A binds t[A] to an R1 value absent from R2. B says for every u∈R1, u[A]=constant x implies some s∈R2 has t[A]=s[A] and s[A]=u[A]. C is {t:¬(t∈R1)}. D binds t[A] to values present in both relations. Examine empty/unguarded cases as well as the obvious complement; exact formulas remain linked.
Tap to enlarge
Your answer
Answer & solution

Answer: C is unsafe; B is also unsafe as literally printed (no official key was published)

Step 1: C returns all tuples outside R1. Over an unrestricted infinite domain and finite R1, this produces an unbounded complement, so it is unsafe. A and D bind the returned A-value to existing relation values, under the intended one-attribute result interpretation.

Step 2: B universally quantifies u in R1 and guards the existential restriction on t with u[A]=the constant x. If R1 is empty, or contains no tuple with that A-value, every implication is vacuously true. Then t is unconstrained and arbitrary outside-domain values satisfy the expression. Thus B is also not domain-independent.

This is a literal second-unsafe-option issue confirmed in the paper, not an official-key correction. Adding an existence requirement for the guarded R1 value would change the question.

Original paper, page 7