CS FundamentalsHardGATE CS (PYQ pattern)
R(A, B, C, D, E, F) has the functional dependencies B → C, FE → D, EF → B, E → A, CF → E. How many attributes of R are prime (belong to at least one candidate key)?
- A. 5
- B. 4
- C. 3
- D. 2
Correct answer: B. 4
The candidate keys are ['BF', 'CF', 'EF']; their union is BCEF, so 4 attributes are prime.
More DBMS and SQL questions
- 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)?
- 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…