Description of ER diagram:

A Bus Company owns a number of busses. Each bus is allocated to a particular route, although some routes may have several busses. Each route passes through a number of towns. One or more drivers are allocated to each stage of a route, which corresponds to a journey through some or all of the towns on a route. Some of the towns have a garage where busses are kept and each of the busses are identified by the registration number and can carry different numbers of passengers, since the vehicles vary in size and can be single or double-decked. Each route is identified by a route number and information is available on the average number of passengers carried per day for each route. Drivers have an employee number, name, address, and sometimes a telephone number

 

.dbdb

MAPPING OF ER DIAGRAM

 

Mapping of entities

 

Bus

 

Reg_no make Deck size No_pass
         
         
         

 

 

       Route

 

Route_no Ave_pass
   

 

 

      Garage

    

name Address
   

 

 

 

Driver

 

Emp_no Tel_no Name Address_id
       

 

Since address is a composite attribute, we can keep a separate table

 

Address_id Huse_no Street Place
       
       

 

 

Stage

 One or more drivers are allocated to each stage of a route, which corresponds to a journey through some or all of the towns on a route.

Stage_no Emp_no Town_name
     

 

Town

 

Each town has a route .Some of the towns have a garage where busses are kept.

T_Name G_Name Route_No

 

Mapping of relationships

 

Service

 Each route is serviced by a particular bus. Entities involved are bus and route.

 

Reg_no Route_no
   

 

Has

Each route has a particular stage. Entities involved are route and stage

 

Stage_no Route_no
   

 

Passed through

Each stage passes through a particular town. Entities involved are town and stage

 

Stage_no Town_name
   

 

 

Allocation

Each stage is allocated to a particular driver. Entities involved are stage and driver

 

Stage_no Emp_no
   

 

Garaged in and located in

Each bus is garaged in a particular garage which is located in a particular town. Entities involved are bus, garage and town

 

Reg_no G_name T_name
     

 

Advertisements