CS FundamentalsHardAmazon · Microsoft MCQ pattern
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. Only A
- B. A and D
- C. AD only
- D. Only D
Correct answer: D. Only D
A⁺ = {A} → apply A→BC → {A,B,C}; D is still missing, so A alone is NOT a superkey. D⁺ = {D} → apply D→A → {A,D} → apply A→BC → {A,B,C,D} — covers every attribute, so D alone IS a key. Since A's closure never reaches D, A is not a superkey at all, leaving D as the sole, minimal candidate key.
More DBMS and SQL questions
- 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…
- The 3NF synthesis algorithm (based on a minimal cover of functional dependencies) is guaranteed to always produce a decomposition that is…
- Table Products(pid, pname, category, price, stock) rows: (1, 'Pen', 'Stationery', 10, 100), (2, 'Notebook', 'Stationery', 50, 0), (3…
- A database stores timestamps in UTC and converts to local time only at the application layer. A query does WHERE createdat BETWEEN…