SQL - Table RelationshipsWhat is the main purpose of a junction table in a many-to-many relationship?ATo store pairs of related records from two tables using foreign keysBTo store all data from both tables in one placeCTo replace one of the original tables completelyDTo create a one-to-one relationship between tablesCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand many-to-many relationshipsMany-to-many means each record in one table can relate to many records in another table, and vice versa.Step 2: Role of junction tableA junction table holds pairs of foreign keys from both tables to link related records without duplicating data.Final Answer:To store pairs of related records from two tables using foreign keys -> Option AQuick Check:Junction table = pairs of foreign keys [OK]Quick Trick: Junction tables link two tables with pairs of keys [OK]Common Mistakes:MISTAKESThinking junction table stores all data from both tablesConfusing junction table with a single main tableAssuming junction table creates one-to-one links
Master "Table Relationships" in SQL9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More SQL Quizzes GROUP BY and HAVING - Why grouping is needed - Quiz 1easy INNER JOIN - INNER JOIN with table aliases - Quiz 7medium LEFT and RIGHT JOIN - Multiple LEFT JOINs in one query - Quiz 5medium LEFT and RIGHT JOIN - Finding unmatched rows with LEFT JOIN - Quiz 11easy Set Operations - Why set operations are needed - Quiz 5medium Subqueries - Subquery in FROM clause (derived table) - Quiz 9hard Subqueries - Subquery vs JOIN performance trade-off - Quiz 12easy Table Constraints - Foreign key ON DELETE behavior - Quiz 13medium Views - Querying through views - Quiz 12easy Views - Querying through views - Quiz 15hard