Bird
0
0

Which SQL table design violates Second Normal Form (2NF)?

easy📝 Syntax Q12 of 15
SQL - Database Design and Normalization
Which SQL table design violates Second Normal Form (2NF)?
CREATE TABLE Orders (OrderID INT, ProductID INT, ProductName VARCHAR(50), Quantity INT, PRIMARY KEY (OrderID, ProductID));
AOrderID and ProductID together form the primary key.
BQuantity depends on both OrderID and ProductID.
CProductName depends only on ProductID, not the whole key.
DThe table has a composite primary key.
Step-by-Step Solution
Solution:
  1. Step 1: Identify dependencies in the table

    ProductName depends only on ProductID, which is part of the composite key (OrderID, ProductID).
  2. Step 2: Check 2NF violation

    Since ProductName depends on part of the key, this violates 2NF which forbids partial dependencies.
  3. Final Answer:

    ProductName depends only on ProductID, not the whole key. -> Option C
  4. Quick Check:

    Partial dependency = 2NF violation [OK]
Quick Trick: Check if non-key columns depend on part of composite key [OK]
Common Mistakes:
  • Assuming composite key alone ensures 2NF
  • Ignoring partial dependencies
  • Confusing primary key with foreign key

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes