CS FundamentalsVery hardProduct company interview · GATE level
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 this decomposition lossless?
- A. Yes, every binary decomposition of a 4-attribute relation is automatically lossless
- B. It depends only on whether R1 or R2 has more attributes
- C. No; the common attributes of R1 and R2 are empty (no shared column at all), so the lossless-join test (common attributes must determine one full side) automatically fails unless that empty intersection trivially determines everything, which it cannot here
- D. Yes, because A → B still holds logically
Correct answer: C. No; the common attributes of R1 and R2 are empty (no shared column at all), so the lossless-join test (common attributes must determine one full side) automatically fails unless that empty intersection trivially determines everything, which it cannot here
R1(A, C) and R2(B, D) share NO attributes at all. The lossless-join test requires the intersection of the two decomposed schemas to functionally determine at least one of them entirely; an empty intersection can only do that if one side has no attributes, which isn't the case here — so this decomposition is lossy (rejoining R1 and R2 would produce a meaningless Cartesian-product-like blow-up, losing the original A-B-C-D associations).
More DBMS and SQL questions
- 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…
- A table is partitioned by RANGE on a date column (e.g. one partition per year). A query filters WHERE saledate BETWEEN '2023-01-01' AND…