ER Practice Questions
ER Practice Questions
Question 1: Suppose you are given the following requirements for a simple database for the
Indian Premier League (IPL):
• 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: