Junction table

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
 
A

Armen Stein

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top