CS FundamentalsModerateProduct placement · DBMS interview
R is decomposed into R1 and R2. Which condition guarantees the decomposition is lossless?
- A. R1 ∪ R2 = R and both are in BCNF
- B. (R1 ∩ R2) → R1 or (R1 ∩ R2) → R2 is in F⁺
- C. R1 ∩ R2 is non-empty
- D. (R1 ∩ R2) → R1 and (R1 ∩ R2) → R2 are both in F⁺
Correct answer: B. (R1 ∩ R2) → R1 or (R1 ∩ R2) → R2 is in F⁺
A binary decomposition is lossless exactly when the common attributes form a superkey of at least one side. A non-empty intersection is not enough, and requiring both sides is stronger than needed.
More DBMS and SQL questions
- Table T(x) has rows (1), (2), (3) and table U(y) has rows (2), (NULL). What do these two queries return? Q1: SELECT COUNT() FROM T WHERE x…
- Cust(cid, city) has rows (1, 'Pune'), (2, 'Delhi'), (3, NULL), (4, 'Pune'). Ord(oid, cid, amt) has rows (10, 1, 500), (11, 1, NULL), (12…
- Ord(oid, cid, amt) has rows (10, 1, 500), (11, 1, NULL), (12, 2, 300), (13, NULL, 200), (14, 5, 100). What does SELECT COUNT()…
- Player(pid, team, runs) has rows (1, 'A', 50), (2, 'A', 70), (3, 'A', 70), (4, 'B', 40), (5, 'B', NULL), (6, 'B', 90), (7, 'C', NULL). For…
- Pay(d, amt) has rows (1, 10), (2, 20), (2, 30), (3, 40). For the row (2, 20), what value does SUM(amt) OVER (ORDER BY d) give?
- What does this query return? SELECT CASE NULL WHEN NULL THEN 'eq' ELSE 'ne' END, CASE WHEN NULL IS NULL THEN 'eq' ELSE 'ne' END;