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 }
- A. II and III only
- B. I and IV only
- C. I, II and III only
- 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
- R(A, B) = {(1,a), (1,b), (2,a), (3,c), (4,a), (5,b), (5,c)} and S(B) is EMPTY. Using the standard definition R ÷ S = πA(R) − πA((πA(R) ×…
- An ER design has three strong entity sets, one weak entity set (identified through one of them), one multivalued attribute on a strong…
- Which of the following statements about ARIES recovery are correct? I. It follows write-ahead logging: a log record must reach stable…
- Which of the following statements about two-phase locking variants are correct? I. Basic 2PL guarantees conflict-serializable schedules…
- R has 100 pages and S has 50 pages. Block nested-loop join uses 12 buffer pages: 10 for a block of the outer relation, 1 for the inner and…
- R(A, B, C, D, E, F) has the functional dependencies D → E, AD → B, D → E, DA → F, EC → D, ED → C. How many of the listed FDs violate BCNF…