SQL - Table RelationshipsWhat is the primary function of a junction table in relational databases when modeling many-to-many relationships?ATo enforce one-to-one relationships between tablesBTo store detailed information about one entity onlyCTo replace primary keys with surrogate keysDTo link two tables by storing pairs of foreign keysCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand many-to-many relationshipsMany-to-many relationships cannot be directly represented in relational databases without an intermediary.Step 2: Role of junction tableA junction table stores pairs of foreign keys from the two related tables, effectively linking them.Final Answer:To link two tables by storing pairs of foreign keys -> Option DQuick Check:Junction tables hold foreign key pairs [OK]Quick Trick: Junction tables link tables via foreign keys [OK]Common Mistakes:MISTAKESThinking junction tables store entity detailsConfusing junction tables with lookup tablesAssuming junction tables enforce one-to-one relations
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