CS FundamentalsHardGATE CS (PYQ pattern)
R(A, B, C, D, E, F) has the functional dependencies F → B, C → A, BD → C, B → E, C → A, BC → A. How many superkeys does R have?
- A. 8
- B. 16
- C. 32
- D. 20
Correct answer: B. 16
The only candidate key is DF; every superset of it is a superkey: 2^(6 - 2) = 16.
More DBMS and SQL questions
- R(A, B, C, D, E, F) has the functional dependencies DB → C, F → A, AD → C, F → B, CA → D, C → F. 3NF synthesis (canonical cover, one…
- Table AA(x, y): (1,1), (1,2), (2,2), (2,NULL), (3,NULL), (NULL,3). How many groups does SELECT x FROM AA GROUP BY x HAVING COUNT(y) <…
- QA(a, b): (1,2), (2,3), (3,1), (4,4). How many rows does SELECT FROM QA x JOIN QA y ON x.b = y.a JOIN QA z ON y.b = z.a return?
- CO(c, n): (a,1), (a,2), (b,3), (b,3), (c,NULL), (c,4). What are COUNT(DISTINCT n), SUM(n), SUM(DISTINCT n) and AVG(n), in that order?
- MT(id, g, v): (1,1,10), (2,1,20), (3,2,30), (4,2,40), (5,2,50), (6,3,60). What does SELECT SUM(v) FROM MT a WHERE v >= (SELECT AVG(v) FROM…
- VW(id, v): (1,5), (2,15), (3,25) and the view BIG = SELECT id, v FROM VW WHERE v > 10. Two more rows (4,8) and (5,30) are then inserted…