Bird
0
0

Which of the following best describes the primary key setup in a junction table?

easy📝 Conceptual Q2 of 15
SQL - Table Relationships
Which of the following best describes the primary key setup in a junction table?
AA single auto-incrementing primary key column.
BA primary key that duplicates one of the original table's keys.
CA composite primary key made of foreign keys from both tables.
DNo primary key is needed in a junction table.
Step-by-Step Solution
Solution:
  1. Step 1: Understand keys in junction tables

    Junction tables link two tables, so they use keys from both as identifiers.
  2. Step 2: Composite primary key concept

    Combining foreign keys from both tables as a composite primary key ensures uniqueness of each pair.
  3. Final Answer:

    A composite primary key made of foreign keys from both tables. -> Option C
  4. Quick Check:

    Junction table keys = Composite of foreign keys [OK]
Quick Trick: Use composite keys from both tables as primary key [OK]
Common Mistakes:
MISTAKES
  • Using a single auto-increment key instead of composite keys
  • Not defining any primary key in junction table
  • Duplicating only one table's key as primary key

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes