0% found this document useful (0 votes)
91 views13 pages

ER Practice Questions

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)
91 views13 pages

ER Practice Questions

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/ 13

E-R Diagram Practice Questions

Question 1: Suppose you are given the following requirements for a simple database for the
Indian Premier League (IPL):

• The IPL 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, 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 result.
Construct a clean and concise ER diagram for the IPL database.
Answer:
Question 2: A university registrar’s office maintains data about the following entities:
(i) Courses, including number, title, credits, syllabus, and prerequisites;
(ii) Course offerings, including course number, year, semester, section number,
instructor(s), timings, and classroom;
(iii) Students, including student-id, name, and program;
(iv) Instructors, including identification number, name, department, and title.
Further, the enrolment of students in courses and grades awarded to students in each course
they are enrolled for must be appropriately modelled. Construct an E-R diagram for the
registrar’s office. Document all assumptions that you make about the mapping constraints.
Answer:
Question 3: 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:
Question 4: Consider a university database for the scheduling of classrooms for final exams.
This database could be modelled 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 enrolment, 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:
Question 5: 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/weeks 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:
Question 6: A university database contains information about professors (identified by social
security number) and courses (identified by courseid), professors teach courses; each of the
following situations concerns the teaches relationship set.
For each situation draw an E-R diagram:
(i) Professors can teach the same course in several semesters and each offering
must be recorded.
(ii) Professors can teach the same course in several semesters, and only the most
recent such offering needs to be recorded.
(iii) Every Professor must teach some course.
(iv) Every Professor teaches exactly one course.
(v) Every Professor teaches exactly one course and every course must be taught
by some professor.
Answer:

You might also like