CS FundamentalsVery hardProduct company interview · GATE level
A relation r(A, B, C, D) currently holds exactly these five tuples: (1, 2, 3, 4) (1, 2, 5, 6) (2, 2, 3, 4) (3, 4, 5, 4) (3, 4, 3, 6) How many of the dependencies A → B, B → C, AC → D, BD → A, CD → B and D → C are satisfied by this instance?
- A. 5
- B. 2
- C. 4
- D. 3
Correct answer: D. 3
An FD X → Y is violated when two tuples agree on X but differ on Y. A → B holds (1 → 2, 2 → 2, 3 → 4). B → C fails: B = 2 goes with C = 3 and C = 5. AC → D holds: the pairs (1,3), (1,5), (2,3), (3,5), (3,3) are all different. BD → A fails: tuples 1 and 3 share (B, D) = (2, 4) but have A = 1 and A = 2. CD → B holds: (3,4) → 2 twice, and (5,6), (5,4), (3,6) occur once each. D → C fails: D = 4 goes with C = 3 and C = 5. So A → B, AC → D and CD → B are satisfied: 3.
More DBMS and SQL questions
- Consider the schedule R2(A); R3(B); W1(A); R2(C); W1(C); W2(B); R4(A); W4(C). Which statement is correct?
- Consider the schedule R1(A); W2(A); W2(B); W1(A); W1(B); W3(A); W3(B). Which statement is correct?
- T1 executes R1(A); W1(A); R1(B) and T2 executes R2(B); W2(B); R2(A). Of the 20 possible interleavings of these two transactions (including…
- No transaction has committed yet in the schedule W1(A); R2(A); W2(B); R3(B); W4(B); R5(B). T1 now aborts. Besides T1, which transactions…
- A lock manager grants a request whenever it is compatible with the locks currently held; otherwise the requester waits. The requests…
- Transactions T1, T2 and T3 have timestamps 1, 2 and 3. All read and write timestamps of items A and C are initially 0, and the operations…