CS FundamentalsVery hardProduct placement · DBMS interview
R(A, B, C, D) has FDs A → B, B → C, C → D and D → A. Every attribute is a candidate key. A designer still decomposes R into R1(A, B) and R2(B, C, D). Which statement is correct?
- A. Dependency preserving but lossy
- B. Lossless but not dependency preserving, because D → A crosses the parts
- C. Lossy, because A → B is lost
- D. Lossless and dependency preserving, and both parts are in BCNF
Correct answer: D. Lossless and dependency preserving, and both parts are in BCNF
R1 ∩ R2 = B is a key, so the join is lossless. A → B lies in R1 and B → C, C → D in R2; D → A follows from D → B (projected on R2) and B → A (projected on R1), so nothing is lost. Every attribute is a key of each part, so both are in BCNF.
More DBMS and SQL questions
- Optimistic (validation-based) concurrency control runs each transaction in three phases. In which order, and when are its writes applied…
- R(A, B, C, D, E) has functional dependencies DE → B, AC → E, AD → E, BD → CE, C → A. How many prime attributes does R have?
- A file has 50,000 records of 200 bytes stored unspanned in 2048-byte blocks, NOT ordered on attribute X. A dense secondary index on X (a…
- A table Teach(course, teacher, book) records that each course is taught by several teachers and uses several books, independently of each…
- How many of these statements are correct? 1. A BCNF decomposition obtained by the standard algorithm is always lossless. 2. A BCNF…
- R(A, B, C, D, E, F) has functional dependencies AD → BF, BD → F, F → A. How many superkeys does R have?