Bird
0
0

Why is it important to use a composite primary key in a junction table instead of a single surrogate key?

hard📝 Conceptual Q10 of 15
SQL - Table Relationships
Why is it important to use a composite primary key in a junction table instead of a single surrogate key?
AComposite keys make queries run faster in all cases.
BSurrogate keys are not allowed in junction tables by SQL standards.
CComposite keys prevent duplicate pairs and enforce relationship uniqueness.
DSurrogate keys cause data loss in many-to-many relationships.
Step-by-Step Solution
Solution:
  1. Step 1: Understand uniqueness in junction tables

    Each pair of foreign keys must be unique to represent a valid relationship.
  2. Step 2: Role of composite primary key

    Composite primary key enforces uniqueness of pairs, preventing duplicates.
  3. Final Answer:

    Composite keys prevent duplicate pairs and enforce relationship uniqueness. -> Option C
  4. Quick Check:

    Composite key = uniqueness enforcement [OK]
Quick Trick: Composite keys ensure unique pairs in junction tables [OK]
Common Mistakes:
MISTAKES
  • Believing surrogate keys are disallowed
  • Thinking composite keys always improve speed
  • Assuming surrogate keys cause data loss

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes