Bird
0
0

Consider a table Sales(OrderID, ProductID, ProductName, Quantity) with composite key (OrderID, ProductID). Which column causes violation of 2NF?

medium📝 query result Q5 of 15
SQL - Database Design and Normalization
Consider a table Sales(OrderID, ProductID, ProductName, Quantity) with composite key (OrderID, ProductID). Which column causes violation of 2NF?
AQuantity
BProductName
COrderID
DProductID
Step-by-Step Solution
Solution:
  1. Step 1: Identify dependencies

    ProductName depends only on ProductID, part of composite key.
  2. Step 2: Check 2NF violation

    Partial dependency of ProductName on part of key violates 2NF.
  3. Final Answer:

    ProductName -> Option B
  4. Quick Check:

    Partial dependency breaks 2NF [OK]
Quick Trick: Columns depending on part of composite key break 2NF [OK]
Common Mistakes:
  • Assuming Quantity causes violation
  • Ignoring composite key parts
  • Confusing primary key columns with non-key columns

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes