CS FundamentalsVery hardProduct company interview · GATE level
A relation R(A, B, C, D, E) has candidate key AB and no other candidate keys. Which of the following dependencies, if it existed, would specifically violate 2NF (as opposed to only 3NF or BCNF)?
- A. C → D (neither C nor D is part of the key)
- B. AB → E (the whole key determines a non-prime attribute)
- C. A → C (a proper subset of the key AB determines a non-prime attribute C)
- D. D → A (a non-prime attribute determines part of the key)
Correct answer: C. A → C (a proper subset of the key AB determines a non-prime attribute C)
2NF is specifically about PARTIAL dependencies: a non-prime attribute depending on only part of a candidate key. A → C has A (a proper subset of the key AB) determining C (non-prime), which is exactly a partial dependency and violates 2NF. C → D is a dependency among two non-prime attributes (a 3NF/transitive-dependency concern, not 2NF, since neither side touches the key at all in a way 2NF cares about). AB → E is the key determining a non-prime attribute, which is expected and never a 2NF violation.
More DBMS and SQL questions
- A relation R(A, B, C, D) has candidate key AB. If C and D are both non-prime, and B → C holds (B alone, part of the key, determines C)…
- A query optimizer estimates the selectivity of WHERE age = 30 using a histogram on the age column rather than assuming a uniform…
- A table has 1,000,000 rows, and a column's selectivity (distinct values / total rows) is estimated as 1/100,000. Roughly how many rows…
- A B+ tree index on a column is said to have a 'fan-out' of 100 (each internal node has up to 100 children). For a table with 10,000,000…
- Which of these is the best reason a database might choose to use a bitmap index rather than a B+ tree index on a column?
- Two transactions, T1 and T2, both want to update the same row. T1 acquires a shared (read) lock, then later tries to upgrade to an…