Lab3 Solved Dani
Lab3 Solved Dani
Lab 3 Exercise
1. A university registrar’s office maintains data about the following entities: (a) courses,
including number, title, credits, syllabus, and prerequisites; (b) course offerings, including
course number, year, semester, section number, instructor(s), timings, and classroom; (c)
students, including student-id, name, and program; and (d) instructors, including
identification number, name, department, and title. Further, the enrollment of students in
courses and grades awarded to students in each course they are enrolled in must be
appropriately modeled.
Construct an E-R diagram for the registrar’s office. Document all assumptions that you make
about the mapping constraints.
2. Suppose you are given the following requirements for a simple database for the National
Hockey League (NHL):
The NHL has many teams,
Each team has a name, a city, a coach, a captain, and a set of players,
Each player belongs to only one team,
Each player has a name, a position (such as left-wing or goalie), a skill level, and a
set of injury records,
A team captain is also a player,
A game is played between two teams (referred to as host_team and guest_team) and
has a date (such as May 11th, 1999) and a score (such as 4 to 2).
Construct a clean and concise ER diagram for the NHL database using the Chen notation as in
your textbook. List your assumptions and indicate the cardinality mappings as well as any
role indicators in your ER diagram.
3. Draw an ER diagram (include cardinalities) for the following ternary relationship. The three
entities are PART, VENDOR, and WAREHOUSE. The business rules are
Each vendor can supply many parts to any number of warehouses but need not supply
any part.
Each part can be supplied by any number of vendors to more than one warehouse, but
each part must be supplied by at least one vendor to a warehouse.
Each warehouse can be supplied with any number of parts from more than one
vendor, but each warehouse must be supplied with at least one part.
4. Draw and explain an ER Diagram for the following situation. You can make additional
assumptions if needed, clearly state them for each situation.
A university has a large number of courses in its catalog. Attribute of COURSE
include Course_No (identifier), Course_Name, and Units.
Each course may have one or more different courses as prerequisites, or may have no
prerequisites.
Similarly, a particular course may be a prerequisite for any number of courses, or
may not be prerequisite for any other course.
5. Draw an ER Diagram for the following situation. You can make additional assumptions if
needed, clearly state them for each situation.
A hospital has a large number of registered physicians. Attribute of PHYSICIAN
include Physician_Id (identifier) and Speciality.
Patients are admitted to the hospital by physicians. Attributes of PATIENT include
Patient_Id (identifier) and PName.
Any patient who is admitted must have exactly one admitting physician.
A physician may optionally admit any number of patients.
Once admitted, a given patient must be treated by at least one physician.
A particular physician may treat any number of patients, or may not treat any patient.
Whenever a patient is treated by a physician, the hospital wishes to record the details
of treatment (Treatement_Detail). Components of Treatement_Detail include Date,
Time, and Results. Draw more than one relationship between patient and physician.