CS FundamentalsVery hardGATE CS (PYQ pattern)
R(A, B, C, D, E, F) has the functional dependencies A -> B, DB -> F, FB -> C, A -> C, A -> D, EF -> B. An attribute set X is closed if X+ = X. How many of the 63 non-empty subsets of {A, B, C, D, E, F} are closed?
- A. 25
- B. 18
- C. 21
- D. 32
Correct answer: C. 21
A closed set must absorb every FD whose left side it contains: any set with A must contain B, C, D and then F; with D and B it needs F and then C; with F and B it needs C; with E and F it needs B and then C. Enumerating the 63 subsets and keeping those equal to their own closure leaves 21 (the whole of R is one of them).
More DBMS and SQL questions
- R(A, B, C, D, E, F) has the functional dependencies AF → E, D → B, BF → D, ED → C, C → F. How many attributes belong to EVERY candidate…
- R(A, B, C, D, E) has the functional dependencies BD → A, B → E, AC → B, B → D, A → C. Which statement is correct?
- Table LV(id, v): (1,5), (2,9), (3,9), (4,3), (5,3). Let L be the sum over all rows of LASTVALUE(v) OVER (ORDER BY v) and F the sum of…
- HR(id, mgr): (1,NULL), (2,1), (3,1), (4,2), (5,2), (6,4), (7,6), (8,3). The recursive query WITH RECURSIVE D(id, d) AS (SELECT id, 0 FROM…
- UA(id, g, x): (1,1,10), (2,2,20), (3,3,30), (4,1,40). UB(g, bonus): (1,5), (2,7). After UPDATE UA SET x = x + (SELECT bonus FROM UB WHERE…
- IA(x): 1, 2, 3, NULL, 5 and IB(y): 2, 2, 5, 7. Let p = rows of IA satisfying x IN (SELECT y FROM IB), q = rows of IA satisfying x NOT IN…