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 DB Design Required Please :)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-14-05, 13:12
coxy coxy is offline
Registered User
 
Join Date: Oct 2005
Posts: 18
Help with DB Design Required Please :)

Hi All,

I am creating my ERM for the initial design of my RELATIONAL database but I'm running into problems regarding my table relationships:

The tour table will have the following entries:

TourID (PK)
StartDate
EndDate
PickUpPoint
DropOffPoint
StudentsTakingPart (List of Student IDs - Multiple Attributes so need to deal with this)

The student table will have the following entries:

StudentID (PK)
SchoolID (FK)
Forename
Surname
DOB
AddressLine1
AddressLine2
AddressLine3
Postcode

Now my problem lies with the many to many relationship of many tours having many students and vice versa so I thought Id introduce a StudentGroup table with the following attributes:

StudentGroupID (PK)
StudentID (FK)

hence changing the Tour table to:

TourID (PK)
StartDate
EndDate
PickUpPoint
DropOffPoint
StudentGroupID (FK)

So now a Tour only has one Studentgroup but I'm still stuck with a M:M relationship between StudentGroup and Students as:

- Many Student Groups may contain many students
- Many Students may be in many Student Groups

Please help me overcome this problem. Maybe I am misinterpreting my relationships ?

Thanks in advance

Greg
Reply With Quote
  #2 (permalink)  
Old 10-15-05, 19:31
B Jarvis B Jarvis is offline
Registered User
 
Join Date: Sep 2005
Posts: 22
Many to Many

You need to uniquely identify student with tour
eg:

Tour
---
TourID PK
starts
pickup
ends
drop_off

Tour_Student
------------
TourID
StudentID
PK(TourID,StudentID)

Student
-------
StudentID PK
....

Tour:Tour_Student 1:M
Student:Tour_Student 1:M
Tour_Student is unique for StudentY,TourZ
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