What is a bridging table and when is it used?

Get ready for the GMetrix Data Modeling Test. Enhance your skills with flashcards and multiple choice questions, complete with hints and explanations. Prepare effectively for success!

Multiple Choice

What is a bridging table and when is it used?

Explanation:
The main idea is how to model many-to-many relationships with a bridging (junction) table. When two entities can relate to many of each other, you can’t capture all those connections with a single foreign key in either table. Instead, you create a separate bridging table that contains the primary keys of both entities as foreign keys. Each row represents one specific pairing, and you can also store attributes of that particular relationship in the bridge, such as a status, date, or other details relevant to that pairing. For example, think of students and courses: a bridging table called Enrollments would hold student_id and course_id, and might include a grade or enrollment date. This table links each student to each course they take, and the extra fields describe the enrollment itself, not the student or the course alone. Other options miss the purpose: a table storing a list of values that cannot be related isn’t about linking entities, a table storing a single entity’s attributes is just a normal entity table, and a table for derived attributes is about calculated data, not the explicit relationships between two entities.

The main idea is how to model many-to-many relationships with a bridging (junction) table. When two entities can relate to many of each other, you can’t capture all those connections with a single foreign key in either table. Instead, you create a separate bridging table that contains the primary keys of both entities as foreign keys. Each row represents one specific pairing, and you can also store attributes of that particular relationship in the bridge, such as a status, date, or other details relevant to that pairing.

For example, think of students and courses: a bridging table called Enrollments would hold student_id and course_id, and might include a grade or enrollment date. This table links each student to each course they take, and the extra fields describe the enrollment itself, not the student or the course alone.

Other options miss the purpose: a table storing a list of values that cannot be related isn’t about linking entities, a table storing a single entity’s attributes is just a normal entity table, and a table for derived attributes is about calculated data, not the explicit relationships between two entities.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy