CS FundamentalsVery hardGATE CS (PYQ pattern)
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) (2) (A, B, C, D) and (D, E) (3) (A, B) and (B, C, D, E) (4) (A, B, C) and (B, D, E)
- A. 2
- B. 0
- C. 4
- D. 1
Correct answer: D. 1
A binary decomposition is lossless iff the common attributes determine one of the parts. (1): C is not a key of either part, lossy. (2): D → E, so D is a key of (D, E): lossless. (3): B is not a key of either side (A → B only), lossy. (4): B does not determine either part: lossy.
More DBMS and SQL questions
- 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…
- Table DU(a, b): (1,NULL), (1,NULL), (2,3), (2,3), (NULL,5), (NULL,5), (1,2). Let x = rows returned by SELECT DISTINCT a, b FROM DU, y =…