How to draw an E-R diagram?

Posted by Appy on Programmers See other posts from Programmers or by Appy
Published on 2012-03-27T12:35:08Z Indexed on 2012/03/27 17:43 UTC
Read the original article Hit count: 295

Filed under:

I am learning DBMS in my college. Recently I was given an assignment to draw a E-R Model of a Bus Reservation system which handles Reservations, Ticketing and cancellations.
I understand the theory about E-R model when I study from a book, but it gets confusing when I try to draw one from scratch.
How should one proceed? There seem to be a lot of ways to model a E-R diagram for a particular requirement. It's really confusing.
Can anyone explain taking Bus reservation System as an example?

Here is the model I made (But I am not confident with it because at every step, I could think of many more alternatives!) -

Entity_Set Passenger(passengerID,name,age,gender)

Entity_Set Ticket(ticketID,status)

//Status is either WaitingList , Confirmed or Cancelled

Entity_Set Bus (busID,MaxSeats,Type)

//Type is Ac or Non-AC

Entity_Set Route(routeID,ArrivalTime,DepartureTime,Source,Destination)

And a Ternary relationship between Passenger, Ticket and Bus with attributes as passengerID, ticketID, busID .
Binary relationship between Bus and Route with attributes as busID, routeID .

I have few doubts regarding -
1 . Should we take Time as a composite attribute with Arrival and Departure as its attributes (What's the difference if we take that way?)
2 . The same with Source and Destination. Should they be made into a composite attribute "Place" or something like "Location"?
3. Are there any weak entity sets here? Can you please 'create' a weak entity set and explain? Because I have no idea at all what to take as a Weak entity set?

© Programmers or respective owner

Related posts about dbms