ER Model Example
ER Model Example
ER Model Example
1 : Suppose you are given the following requirements for a simple database for the
National Hockey League (NHL):
3:
(a) Construct an E-R diagram for a car-insurance company whose customers own one or more
cars each. Each car has associated with it zero to any number of recorded accidents.
Answer :
4:
(a) Construct an E-R diagram for a hospital with a set of patients and a set of medical doctors.
Associate with each patient a log of the various tests and examinations conducted.
Answer :
5: Consider a database used to record the marks that students get in different exams of different
course offerings.
a) Construct an E-R diagram that models exams as entities, and uses a ternary relationship, for
the above database.
Answer a :
b) Construct an alternative E-R diagram that uses only a binary relationship between students
and course-offerings. Make sure that only one relationship exists between a particular student
and course-offering pair, yet you can represent the marks that a student gets in different exams of
a course offering.
Answer b:
6: Design an E-R diagram for keeping track of the exploits of your favorite sports team. You
should store the matches played, the scores in each match, the players in each match and
individual player statistics for each match. Summary statistics should be modeled as derived
attributes.
Answer :
7 :Extend the E-R diagram of the previous question to track the same information for all teams in
a league.
Answer :
8 : Draw the E-R diagram which models an online bookstore.
Answer :
9 : Consider a university database for the scheduling of classrooms for -final exams. This
database could be modeled as the single entity set exam, with attributes course-name, section-
number, room-number, and time. Alternatively, one or more additional entity sets could be
defined, along with relationship sets to replace some of the attributes of the exam entity set, as
course with attributes name, department, and c-number
section with attributes s-number and enrollment, and dependent as a
weak entity set on course
room with attributes r-number, capacity, and building
Show an E-R diagram illustrating the use of all three additional entity sets listed.
Answer :
10 : Construct an ER Diagram for Company having following details :
Company organized into DEPARTMENT. Each department has unique name
and a particular employee who manages the department. Start date for the manager is
recorded. Department may have several locations.
A department controls a number of PROJECT. Projects have a unique name,
number and a single location.
Company’s EMPLOYEE name, ssno, address, salary, sex and birth date
are recorded. An employee is assigned to one department, but may work for several
projects (not necessarily controlled by her dept). Number of
hours/week an employee works on each project is recorded; The immediate supervisor
for the employee.
Employee’s DEPENDENT are tracked for health insurance purposes (dependent
name, birthdate, relationship to employee).
Answer :