Junction table

  • Thread starter Thread starter Fred Blair
  • Start date Start date
F

Fred Blair

I have been reading about junction tables for two tables that have a many to
many relationship.

In the case of the examples of student and course tables with a junction
table with the primary key from each table to create the junction table.

When a student signs up for a class, then is that the time that the junction
table is populated with a new row for that student and that course?

Thanks,
Fred
 
I have been reading about junction tables for two tables that have a many to
many relationship.

In the case of the examples of student and course tables with a junction
table with the primary key from each table to create the junction table.

When a student signs up for a class, then is that the time that the junction
table is populated with a new row for that student and that course?

Thanks,
Fred

Yes, exactly.

And that junction table (say tblEnrollment in this example) can have
other fields (e.g. EnrollmentDate), and it's own child table (e.g.
tblEnrollmentGrades).

And it often makes sense to have a unique index defined on the two
foreign keys (Student and Class in this case) so that you can't have
duplicates.

Hope this helps,

Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 
Back
Top