Re: Many to many relationships
- From: "Amy Blankenship" <Amy_nospam@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 29 Apr 2007 22:57:25 -0500
"Jeff Boyce" <JeffBoyce_IF@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:uEWOx%23LiHHA.4676@xxxxxxxxxxxxxxxxxxxxxxx
Tazzy
The generic approach to handling this is to first create the
"junction"/"resolver"/"relation" table that sits between the two you've
done. In this new table, you'll have every valid combination of student
and
placement, using the ID from each, plus whatever other data is significant
about that relation. For example (just guessing here), you might want to
know that Jimmy was in Math, starting 5/1/2007, taught by Instructor
Jones.
(notice that by adding instructor, you just used the table to resolve a
3-way many-many-many).
Although really that would be poor database design, since presumably this
instructor would be teaching the exact same class at the exact same time to
more than just Jimmy. Trying to store the instructor and date with the
student/class information would result in a lot of redundancy and confusing
data (what if Jimmy quit after one week, yet Mary took the whole class?).
So, you'd actually want to store all that information together and then link
to *that* in the junction table. You'd know that it was Math because the
Subject ID would be a foreign key in the Class table.
A better example of information about a junction that would be stored in the
junction table would be what seat Jimmy is assigned to for the semester for
that class. In other classes, Jimmy would have a different seat, and in
other semesters or other times of the same class, a different student is in
the same seat... So it relates only to the intersection between Jimmy and
Math 101 taught by Instructor Jones in Spring of 07 at 8 am on Tuesdays and
Thursdays.
HTH;
Amy
.
- Follow-Ups:
- Re: Many to many relationships
- From: Tazzy via AccessMonster.com
- Re: Many to many relationships
- References:
- Many to many relationships
- From: Tazzy via AccessMonster.com
- Re: Many to many relationships
- From: Jeff Boyce
- Many to many relationships
- Prev by Date: Re: Database design
- Next by Date: Re: Database design
- Previous by thread: Re: Many to many relationships
- Next by thread: Re: Many to many relationships
- Index(es):
Relevant Pages
|