SQL - Table RelationshipsWhich 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.Check Answer
Step-by-Step SolutionSolution:Step 1: Understand keys in junction tablesJunction tables link two tables, so they use keys from both as identifiers.Step 2: Composite primary key conceptCombining foreign keys from both tables as a composite primary key ensures uniqueness of each pair.Final Answer:A composite primary key made of foreign keys from both tables. -> Option CQuick Check:Junction table keys = Composite of foreign keys [OK]Quick Trick: Use composite keys from both tables as primary key [OK]Common Mistakes:MISTAKESUsing a single auto-increment key instead of composite keysNot defining any primary key in junction tableDuplicating only one table's key as primary key
Master "Table Relationships" in SQL9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More SQL Quizzes Aggregate Functions - Aggregate with NULL handling - Quiz 4medium GROUP BY and HAVING - WHERE vs HAVING mental model - Quiz 13medium GROUP BY and HAVING - GROUP BY multiple columns - Quiz 15hard INNER JOIN - Why joins are needed - Quiz 11easy LEFT and RIGHT JOIN - LEFT JOIN with NULL result rows - Quiz 15hard LEFT and RIGHT JOIN - Finding unmatched rows with LEFT JOIN - Quiz 10hard LEFT and RIGHT JOIN - LEFT JOIN execution behavior - Quiz 7medium Set Operations - Set operations with ORDER BY - Quiz 7medium Subqueries - Nested subqueries - Quiz 2easy Table Constraints - CHECK constraint - Quiz 10hard