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 > Stumped on design of a database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-29-07, 16:26
amol0010 amol0010 is offline
Registered User
 
Join Date: Jul 2007
Location: United Kingdom
Posts: 2
Stumped on design of a database

Hi

I was stuck on the designing a database.

It goes something like this -


Many buses can access many bus stops.

e.g. there are 5 bus -stops , and bus numbers are 22, 11, 13, 77.

Each of these buses would/could access any of the 5 bus stops.

In order to resolve this many -many relationship, I made a 3rd entity
bus_journey with two primary keys busstopID and BusID initially
considering, that each bus journey would be uniquely associated with a
bus with only a single bus stop.

However, this fails, since in a bus journey, a bus can access multiple
bus stations.

e.g. in a bus journey, Bus no 11 can travel around and access bus stations 1,2, and 3.

I am out of ideas on the design of this relation between them..

How could you relate these two entities in an ERD ?

Any suggestions would be very helpful


Here's the database design

[img=http://img266.imageshack.us/img266/2008/untitledpr5.th.jpg]

Best regards
Reply With Quote
  #2 (permalink)  
Old 07-29-07, 17:20
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by amol0010
How could you relate these two entities in an ERD ?
just like you did already in the database diagram

oh, wait -- is the reason you're asking about ERDs because you need to hand in an ERD for this assignment?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 07-29-07, 17:51
amol0010 amol0010 is offline
Registered User
 
Join Date: Jul 2007
Location: United Kingdom
Posts: 2
^No actually its because I need to use this database to feed in real data sourced from the local travel company and display it on my webpage..

I need to use this db in MySQL.
Reply With Quote
  #4 (permalink)  
Old 07-30-07, 06:22
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
Go back to basics for this one...
Try expanding on this
Quote:
Originally Posted by amol
Many buses can access many bus stops.
One line statements for the relationships between each of your objects and post them all back here - this should help clarify the problem and lead you to a solution!
__________________
George
Twitter | Blog
Reply With Quote
  #5 (permalink)  
Old 07-30-07, 06:50
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,246
..or even a route comprises many stops
..many routes may use one stop
..many buses may service one route
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
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