CS FundamentalsHardTCS NQT · Infosys pattern
Decomposing R(A, B, C) with FDs A → B and B → C into BCNF can require R1(A, B) and R2(B, C). Is this decomposition dependency-preserving?
- A. Yes; A → B is checkable within R1 alone, and B → C is checkable within R2 alone, so both original FDs are directly preserved
- B. No; B → C cannot be checked without joining R1 and R2 back together
- C. No decomposition of this relation can ever be lossless
- D. It depends on which attribute is chosen as the primary key
Correct answer: A. Yes; A → B is checkable within R1 alone, and B → C is checkable within R2 alone, so both original FDs are directly preserved
R1(A,B) contains exactly the attributes of A → B, so that FD can be checked by itself within R1; R2(B,C) likewise directly contains B → C. Since both original FDs individually 'fit' inside one of the two decomposed relations, this particular decomposition is both lossless (B is a key of R2, satisfying the lossless-join test) and dependency-preserving.
More DBMS and SQL questions
- 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…
- 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…