If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Help with Many to Many Relationships

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-24-11, 00:07
alpinegroove alpinegroove is offline
Registered User
 
Join Date: Mar 2011
Posts: 11
Help with Many to Many Relationships

Hello,
I am a novice and am trying to develop a database for managing course and instructor information.

I have courses, instructors, TAs, and readers.

Each course can have more than one instructor, TA, or reader (for example,
1 instructor, 2 TAs, 1 reader or 2 instructors, 1 TA, and 2 readers or one instructor without TAs or readers).

All courses have instructors, but some of them don't have a TA or a reader
or have only one of them.

Each instructor can teach more than one course. So I think this creates a
many to many relationship.

It gets complicated (for me, at least) because an instructor of a course can also serve
as the reader for that course and/or as the TA as well, so I don't even
know what to call that kind of relationship.

Additionally, an instructor in one course can serve as a TA in a different course that has a different instructor.

I tried to model this but got stuck creating the relationships.
I first created four tables: Courses, Instructors, TAs, and Readers.
Then I created a junction/link table to accommodate the many to many situation, but I couldn't figure out how to handle the relationships between each of my staff tables and the Courses tables.

Would it help to have one Instructional Staff table instead of a separate
table for instructors, TAs, and readers?

Do I even need the junction/link table? Do I need more junction tables?

Thanks!
Reply With Quote
  #2 (permalink)  
Old 03-24-11, 05:48
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by alpinegroove View Post
Would it help to have one Instructional Staff table instead of a separate
table for instructors, TAs, and readers?
absolutely, yes

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 03-24-11, 06:22
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,246
yup
one table to hold all instructional staff
an intersection table to associate members of staff to a course (and in that course intersectin tbael optionally store the role that member of staff has. Im assumign a member of staff cannot have more than one role is any one course.

the wrinkle is if an organisation may run courses, but allocate staff as required to specific instances of a course.

eg say the course runs monthly, and in months 1...6 it run by Fred Bloggs, month 7 he's off to be replaced by B.B.Named.... do you need to know which member of staff actuall taught on a specifric instance of a course
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #4 (permalink)  
Old 03-24-11, 08:58
alpinegroove alpinegroove is offline
Registered User
 
Join Date: Mar 2011
Posts: 11
Quote:
Originally Posted by healdem View Post
yup
Im assumign a member of staff cannot have more than one role is any one course.
This is part of my problem. It gets complicated (for me, at least) because an instructor of a course can also serve as the reader for that same course and/or as the TA as well, so I don't even know what to call that kind of relationship.

1. So the instructor/ta/reader are sometimes the same person and other times three different people.

Also, an instructor from one course can be the TA in another course, which is taught by a different instructor.

2. How do I create the relationships with the interaction table?
Wouldn't I have to make the PK from tblnstructionalStaff the FK in multiple places in the intersection table (Instructor1, Instructor2, TA1, TA2, Reader1, Reader2)?

I suppose that is my main challenge.

Thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On