Sei sulla pagina 1di 3

Database ERD practice cases

Country bus company


A Country bus Company owns a number of buses. Each bus is allocated to a particular route, although Some
routes may have Several buses. 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 buses are kept and each of the buses 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.
Entities

 Bus – Company owns buses and will hold information about them.
 Route – Buses travel on routes and will need described.
 Town – Buses pass through towns and need to know about them.
 Driver – Company employs drivers, personnel will hold their data.
 Stage – Routes are made up of Stages. Garage –
 Garage houses buses, and need to know where they are.

Relationships

 A bus is allocated to a route and a route may have several buses.


 Bus-route (m:1) is serviced by a route comprises of one or more stages.
 Route-Stage (1:m) Comprises One or more drivers are allocated to each stage.
 Driver-stage (m:1) is allocated A Stage passes through some or all of the towns on a route.
 Stage-town (min) passes-through. A route passes through some or all of the towns.
 Route-town (min) passes-through Some of the towns have a garage.
 Garage-town (1:1) is situated Agarage keeps buses and each bus has one home garage.
 Garage-bus (m:1) is garaged.

Airline Example
Major airlines companies that provide passenger services in Taiwan are: UniAir, TransAsia Airways, Far
Eastern Transport, Great China Airlines etc. Taiwan’s Federal Aviation Administration (TFAA) keeps a
database with lots of information on all airlines. This information is made accessible to all airlines in Taiwan
with the intention of helping the Companies assess their Competitive position in the domestic market. The
information kept consists of:

1. Each airpline has an identification number, name of the contact person and telephone number.
2. For each aircraft identification number, capacity and model is recorded.
3. Each employee has an employee identification number, name, address, birthday, sex, position with
the company and qualification.
4. Each route has a route identification number, origin, destination, classification (into domestic or
international route), distance of the route and price charged per passenger.
5. Each airline keeps information about their buy/sell transactions (for example, selling an airplane
ticket is a sell transaction, paying for maintenance is a buy transaction). Each transaction has a
transaction identification number, date, description and amount of money paid/received.

Automobile Distribution Center


Ford distribution centers provide automotive parts to authorized dealers and the dealers distribute the parts
to Customers throughout North America. Ford is faced with pressure to provide excellent Customer Service
at minimum Cost. Maintaining a well organized database of information, will contribute to achieving this
goal.
Ford keeps the following information about each of its distribution centers: identification number, location
(X longitude coordinate and Y latitude coordinate), address (city, state, zip code) and name of the Contact
person. The following information is kept about each dealer: identification number, dealer’s location (X
longitude Coordinate and Y latitude Coordinate), address (name of the city, State, zip Code), name of the
Contact person and the identification number of the primary distribution centers serve this dealer.
A distribution center sends a shipment to its dealers every week. The distribution centers keep the following
information about each shipment the date, an identification number of the product shipped, an
identification number of the dealer that receives the shipment.
The following information is kept about each product: a product identification number name, price, weight,
value.
Ford keeps the following information about the flow and cost data for all distribution centers to dealer
channels: distribution center identification number, dealer identification number, product identification
number, the number of miles between each distribution center and its dealers using the road network, the
quantity of products being shipped and the dollar value of the shipment.

Housing Society Example


The University Housing Office receives many applications from graduate and married students requesting
an apartment on campus. The housing villages are sited in five different locations and each village has about
500 apartments. Each apartment falls into one of the apartment categories. An apartment category is
determined based on village location, whether the apartment has dish washer or not, a single or double
bedroom, central or window unit air conditioner, furniture or not.
Housing officekeeps the following information about the Current residents: the SSN of the family head,
name, address, telephone number, marital status, the name of the major college and department in which
the family head is enrolled in.
Housing office keeps the following information about the students that have applied for in campus housing,
but have not been assigned to an apartment yet: SSN of the applicant, name, address, telephone number,
marital status, the name of the major college and department in which the family head is enrolled in, the
preference about the apartment category.
Draw an ER diagram for the University Housing Office database. State any assumptions you need to make in
order to develop a compete diagram.

institution Example
This database includes information about the course timetable of an academic institution. For each Course
the following information is recorded an identification number, name of the course, name of the teacher
assigned to teach the course, the number of periods each week it will be taught, the number of students.
For each teacher the following information is recorded: SSN, name, name of the department he/she works
with, skills, the yearly salary. For each class period the following information is recorded: period number,
starting time, ending time. For each room the following information is recorded: room number, room type
(classroom, office, auditorium, and computer lab), capacity.
The above information is used in order to make the right assignment of a teacher that teaches a particular
course to a time period and a classroom. Draw an E-R diagram for this database. State clearly any
assumptions you make.

Potrebbero piacerti anche