Bird
0
0

A company has a table:

hard📝 Application Q15 of 15
SQL - Database Design and Normalization
A company has a table:

InvoiceID | ProductID | ProductName | SupplierID | SupplierName

To convert this table into Third Normal Form (3NF), which of the following is the best approach?
ARemove SupplierName column from the table.
BAdd ProductName and SupplierName as primary keys.
CKeep all columns in one table but add unique constraints.
DCreate separate tables for Products and Suppliers, linking them by IDs.
Step-by-Step Solution
Solution:
  1. Step 1: Identify transitive dependencies

    ProductName depends on ProductID, and SupplierName depends on SupplierID, both non-key columns, causing 3NF violation.
  2. Step 2: Normalize by splitting tables

    Creating separate Product and Supplier tables linked by IDs removes these dependencies and achieves 3NF.
  3. Final Answer:

    Create separate tables for Products and Suppliers, linking them by IDs. -> Option D
  4. Quick Check:

    Split related entities into tables to achieve 3NF [OK]
Quick Trick: Split entities into tables linked by keys for 3NF [OK]
Common Mistakes:
  • Trying to keep all data in one table
  • Using names as primary keys
  • Removing columns without restructuring

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes