CS FundamentalsVery hardGATE CS (PYQ pattern)
F = {A→B, B→C, AC→D, D→A} on R(A, B, C, D). Which of the following FD sets is equivalent to F (has exactly the same closure)?
- A. {A→B, B→C, AB→D, D→B}
- B. {A→B, B→C, C→D, D→A}
- C. {A→B, B→C, A→D, D→A}
- D. {A→BC, D→A}
Correct answer: C. {A→B, B→C, A→D, D→A}
G1 replaces AC → D by A → D, which is fine because A → B → C makes C redundant on the left side (A → C is implied), and everything else is unchanged. G2 changes the dependency D → A into D → B (A is lost), G3 swaps AC → D for C → D (too strong) and G4 drops D's dependency.
More DBMS and SQL questions
- R(A, B, C, D, E) has FDs A → B, BC → D, D → E. How many of these four binary decompositions are lossless-join? (1) (A, B, C) and (C, D, E)…
- Table N(id) has 10 rows with ids 1 to 10. For SELECT id, NTILE(4) OVER (ORDER BY id) AS g, CUMEDIST() OVER (ORDER BY id) AS cd FROM N…
- Table K(a, b): (0,5), (3,7), (0,NULL), (NULL,4), (2,NULL), (0,0). What does SELECT SUM(COALESCE(NULLIF(a, 0), b)) FROM K return?
- ORD(oid, amt): (1,100), (2,200), (3,300). LN(oid, item): (1,a), (1,b), (1,c), (2,a), (3,b), (3,c). PAY(oid, paid): (1,40), (1,60)…
- EM(id, sal, mgr): (1,90,NULL), (2,70,1), (3,70,1), (4,95,2), (5,60,2), (6,40,3), (7,80,3), (8,NULL,4), (9,85,7). How many rows does SELECT…
- Table UP(a, b): (1,10), (2,20), (3,30). After UPDATE UP SET a = b, b = a; (standard SQL semantics), what is the sum of column a and the…