Re: Many to many relationships




"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


.



Relevant Pages

  • Re: The Right Taecher
    ... discussing joe pass as a teacher. ... a better student when you have the proper guidance from your ... jimmy is a great teacher and i highly ... willingness, ambition and desire. ...
    (rec.music.makers.guitar.jazz)
  • JBGI video format change...
    ... the Student Center that gives each member student his own area to post ... their videos and personal information, ... Jimmy keeps adding lessons (he's working on Jazz Blues ... Center feature is new, and is just getting started, but is already ...
    (rec.music.makers.guitar.jazz)
  • RE: product key
    ... Dont think ME comes with a product key,if it did/does,look on back of pc ... "Jimmy, IT student" wrote: ... OS that was installed from the factory tho. ...
    (microsoft.public.windowsxp.general)
  • Re: A Couple of My Unicycles
    ... Is that a DX 32 and Jimmy Cs on the trials? ... And what cover and foam are ... you using on the seat? ... Is that the Miyata rather than the KH style ...
    (rec.sport.unicycling)

Quantcast