CS FundamentalsModerateWipro Elite · LTIMindtree
R(A, B, C, D) has the functional dependencies AB -> C, C -> D and D -> A. How many candidate keys does R have?
- A. 1
- B. 3
- C. 2
- D. 4
Correct answer: B. 3
B appears on no right side, so every key contains B. AB, BC and BD each determine all attributes, and no smaller set works: 3 keys.
More DBMS and SQL questions
- S(v) has rows 1, 2, 3 and U(v) has rows 2, NULL. What does SELECT COUNT() FROM S WHERE v NOT IN (SELECT v FROM U) return?
- A(x) holds 1, 2, 2, 3 and B(x) holds 2, 3, 3, 4. How many rows does SELECT x FROM A UNION SELECT x FROM B return?
- R(A, B, C) has the functional dependencies AB -> C and C -> B. Which is the highest normal form that R satisfies?
- T(v) holds 40, 10, 30, 20, 50. What does SELECT v FROM T ORDER BY v DESC LIMIT 2 OFFSET 1 return, in order?
- T(x) holds 10, NULL, 20, 30, NULL. What does SELECT AVG(x) FROM T return?
- A bank's server crashes immediately after a transaction commits, before its changes are written to the data files. After restart the…