Bird
0
0

A table has columns: ProductID, SupplierID, SupplierName, where SupplierName depends on SupplierID. How to fix the 3NF violation?

medium📝 Debug Q7 of 15
SQL - Database Design and Normalization
A table has columns: ProductID, SupplierID, SupplierName, where SupplierName depends on SupplierID. How to fix the 3NF violation?
AMake SupplierName nullable
BAdd SupplierName as part of the primary key
CRemove SupplierID from the table
DCreate a separate Supplier table with SupplierID as primary key
Step-by-Step Solution
Solution:
  1. Step 1: Identify transitive dependency

    SupplierName depends on SupplierID, a non-key attribute, causing 3NF violation.
  2. Step 2: Normalize by splitting tables

    Move SupplierID and SupplierName to a separate Supplier table to remove transitive dependency.
  3. Final Answer:

    Create a separate Supplier table with SupplierID as primary key -> Option D
  4. Quick Check:

    Separate related data to fix 3NF violations [OK]
Quick Trick: Fix 3NF by splitting tables to remove transitive dependencies [OK]
Common Mistakes:
  • Adding non-key attributes to primary key
  • Removing foreign keys incorrectly
  • Making columns nullable to fix normalization

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes