CS FundamentalsVery hardProduct company interview · GATE level
A relation R(A, B, C, D, E) has FDs AB → CDE and E → B. What are the candidate key(s) of R?
- A. AB and AE
- B. Only AB
- C. Only AE
- D. ABE
Correct answer: A. AB and AE
(AB)⁺: {A,B} → apply AB→CDE → {A,B,C,D,E} — covers all, so AB is a candidate key. (AE)⁺: {A,E} → apply E→B → {A,B,E} → now AB present, apply AB→CDE → {A,B,C,D,E} — also covers all, so AE is a candidate key too. Neither A, B, nor E alone closes to everything, so both AB and AE are minimal: two candidate keys.
More DBMS and SQL questions
- Using the same R(A, B, C, D, E) with AB → CDE and E → B, how many superkeys does R have in total?
- R(A, B, C) has NO nontrivial functional dependencies at all (every attribute is independent of every other). What is R's only candidate…
- A relation R(A, B, C, D) has FDs A → BC and D → A (so D is also, indirectly, able to derive B and C). What are the candidate keys of R?
- A trigger-based implementation of a materialized view manually re-runs the entire defining query and replaces all the materialized rows…
- R(City, Street, Zip) has FDs City,Street → Zip and Zip → City, with candidate keys {City,Street} and {Street,Zip}. Decomposing into…
- A relation R(City, Street, Zip) has FDs City, Street → Zip and Zip → City (candidate keys: {City, Street} and {Street, Zip}). Why is this…