Re: Why are Junction Tables necessary?
- From: "Jeff Boyce" <JeffBoyce_IF@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 13 Sep 2006 04:57:19 -0700
I'll try by way of an example...
You have students. If you want to add another student, you just add him/her
to the tblStudent.
You have classes (i.e., a classroom, a topic, an instructor). If you want
to add another class, just add it to the tblClass.
Now, how do you show which student is enrolled in which class?
You can't really add that as a field in the tblStudent unless you are only
allowing your students to enroll in a single class, and are not interested
in any previous class they took. Ditto for why you couldn't add a student
to the tblClass. But you described a "many-to-many" relationship, so
neither of these is appropriate.
Now create a third table, trelEnrollment. Put one StudentID and one ClassID
in a new row, plus any other "facts" about the enrollment, like
DateEnrolled.
Does it make any more sense with an example?
--
Regards
Jeff Boyce
Microsoft Office/Access MVP
http://mvp.support.microsoft.com/
Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
Microsoft Registered Partner
https://partner.microsoft.com/
"VT" <VT@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C421D267-08FD-4E57-8968-E805A1A5FA99@xxxxxxxxxxxxxxxx
I have been reading about databases for just a few hours, so think of meas a
complete muppet for the purpose of explanation...why
I don't understand why many-to-many relationships are not possible, and
we need two tables, each with a one-to-many relationship with a thirdtable.
Thanks for your help.
.
- Prev by Date: Re: Why are Junction Tables necessary?
- Next by Date: RE: DO ALL TABLES/FORMS DATA NEED TO BE ENTERED TO CREATE SUBFORMS
- Previous by thread: Re: Why are Junction Tables necessary?
- Next by thread: Starting Defaults
- Index(es):
Relevant Pages
|