0% found this document useful (0 votes)
116 views7 pages

Case Study Solution 07-Feb-06

The document describes a case study for designing a database for a county bus company. The database needs to track buses, routes, towns, stages, drivers, and garages. The entities include buses, routes, towns, stages, drivers, and garages. Buses are allocated to routes, routes pass through towns, stages correspond to parts of routes, drivers are allocated to stages, and buses and towns have garages. The document outlines the relationships between entities and includes an ERD diagram and proposed relational schema to model the database design.

Uploaded by

shaheena rani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
116 views7 pages

Case Study Solution 07-Feb-06

The document describes a case study for designing a database for a county bus company. The database needs to track buses, routes, towns, stages, drivers, and garages. The entities include buses, routes, towns, stages, drivers, and garages. Buses are allocated to routes, routes pass through towns, stages correspond to parts of routes, drivers are allocated to stages, and buses and towns have garages. The document outlines the relationships between entities and includes an ERD diagram and proposed relational schema to model the database design.

Uploaded by

shaheena rani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Case Study Solution

Case Study Solution Database Design using MySQL 07-Feb-06 : [1]


Entities
“A county bus company owns a number of buses and has
asked you to create a database to keep track of their
business. Each bus is allocated to a particular route, with
some routes having several allocated buses. Each route
passes through a number of towns. One or more drivers
are allocated to each stage of the route, which
corresponds to a journey through some or all of the towns
on a route. Some of the towns have a garage where
buses can be kept, each bus having one ‘home’ garage.”

Case Study Solution Database Design using MySQL 07-Feb-06 : [2]


Relationships
‘Each bus is allocated to a particular route, with some routes having several allocated buses’
BUS [many-to-one] ROUTE
‘Each route passes through a number of towns’
ROUTE [many-to-many] TOWN
‘each stage of the route’
ROUTE [one-to-many] STAGE
‘One or more drivers are allocated to each stage’
DRIVER [many-to-one] STAGE
‘[a stage] corresponds to a journey through some or all of the towns on a route’
STAGE [many-to-many] TOWN
‘Some of the towns have a garage’
TOWN [one-to-one] GARAGE
‘each bus having one ‘home’ garage’
BUS [many-to-one] GARAGE

Case Study Solution Database Design using MySQL 07-Feb-06 : [3]


Attributes

BUS (registration, num_pass)


ROUTE (number, avg_pass)
TOWN (name, pop)
STAGE (number)
DRIVER (emp_num, name, phone)
GARAGE (name)

Case Study Solution Database Design using MySQL 07-Feb-06 : [4]


EAR Diagram

BUS ROUTE

GARAGE STAGE DRIVER

TOWN

Case Study Solution Database Design using MySQL 07-Feb-06 : [5]


Relational Table Schema
TABLE bus (reg, passengers, route, garage)
TABLE route (number, avg_pass)
TABLE stage (number, route)
TABLE town (name, population)
TABLE garage (name, town)
TABLE driver (emp_id, name, phone, stage)
TABLE map (stage, town)

Case Study Solution Database Design using MySQL 07-Feb-06 : [6]


Review
• Practised designing a database from a
real life specification:
– Define entities, relationships and attributes.
– Draw up an EAR diagram.
– Map this EAR diagram to a normalised
relational table schema.

Case Study Solution Database Design using MySQL 07-Feb-06 : [7]

You might also like