CS FundamentalsHardAmazon · Microsoft MCQ pattern
A relation R(A, B, C) has FDs A → B and A → C, but NOT B → C or C → B (B and C are independent given A). Decomposing R into R1(A, B) and R2(A, C) — is this decomposition lossless?
- A. No, because B and C are never directly related by any FD
- B. Only if A is also a candidate key of the original R, which cannot be determined here
- C. No; a decomposition is only lossless if all three attributes stay in one single piece
- D. Yes; A is a key of R1 and a key of R2, so the intersection of R1 and R2 (which is {A}) is a superkey of at least one of them (it's a key of both), satisfying the lossless-join test
Correct answer: D. Yes; A is a key of R1 and a key of R2, so the intersection of R1 and R2 (which is {A}) is a superkey of at least one of them (it's a key of both), satisfying the lossless-join test
The standard binary lossless-join test requires the common attributes of the two pieces (here just A) to functionally determine ALL the attributes of at least one piece. Since A → B makes A a key of R1, and A → C makes A a key of R2, the common attribute A is a superkey of both halves — the decomposition is lossless (and, since A→B and A→C are each fully checkable in one piece, it is dependency-preserving too).
More DBMS and SQL questions
- A relation R(A, B, C, D) has only the FD A → B (C and D are independent, part of the key). Decomposing R into R1(A, C) and R2(B, D) — is…
- A SERIALIZABLE transaction in PostgreSQL (which uses Serializable Snapshot Isolation, SSI) can occasionally abort with a serialization…
- A table has a UNIQUE constraint on (email) and a separate UNIQUE constraint on (phone). An application inserts a row where email already…
- A column is declared NOT NULL DEFAULT 0. An application performs INSERT INTO T (othercol) VALUES (5); without mentioning this column at…
- A transaction executes UPDATE Accounts SET balance = balance - 100 WHERE id = 1; followed immediately (same transaction) by SELECT balance…
- A B+ tree index supports efficient range queries because leaf nodes are linked in sorted order. For a query WHERE age BETWEEN 25 AND 35…