In a many-to-many relationship, the rows of the junction table contain the primary keys of T1 and T2 as values.

Study for the SQL Basics Test. Improve your knowledge with multiple choice questions and detailed explanations. Prepare effectively to master SQL concepts!

Multiple Choice

In a many-to-many relationship, the rows of the junction table contain the primary keys of T1 and T2 as values.

Explanation:
In a many-to-many relationship, a junction table is used to connect records from the two tables. Each row in that junction stores two values: the identifier of a row in the first table and the identifier of a row in the second table. Those identifiers are the primary keys from their respective tables, and in the junction table they act as foreign keys pointing back to T1 and T2. Together, these two keys identify a specific relationship between a row from T1 and a row from T2, and they often form the composite primary key of the junction. The junction does not carry all attributes from T1 or T2; it only holds the keys that link the records. Therefore, storing the primary keys of T1 and T2 as the values in the junction row best captures how the relationship is modeled.

In a many-to-many relationship, a junction table is used to connect records from the two tables. Each row in that junction stores two values: the identifier of a row in the first table and the identifier of a row in the second table. Those identifiers are the primary keys from their respective tables, and in the junction table they act as foreign keys pointing back to T1 and T2. Together, these two keys identify a specific relationship between a row from T1 and a row from T2, and they often form the composite primary key of the junction. The junction does not carry all attributes from T1 or T2; it only holds the keys that link the records. Therefore, storing the primary keys of T1 and T2 as the values in the junction row best captures how the relationship is modeled.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy