Tutorial4 Sol
Tutorial4 Sol
Problem 1
A university database contains information about professors (identied by social security number, or SSN) and
courses (identied by courseid). Professors teach courses; each of the following situations concerns the Teaches
relationship set. For each situation, draw an ER diagram that describes it (assuming no further constraints hold).
1. Professors can teach the same course in several semesters, and each oering must be recorded
2. Professors can teach the same course in several semesters, and only the most recent such oering needs to be
recorded (Assume this condition applies in all subsequent questions)
3. Every professor must teach some course
4. Every professor teaches exactly one course (no more, no less)
5. Every professor teaches exactly one course (no more, no less), and every course must be taught by some
professor
6. Now suppose that certain courses can be taught by a team of professors jointly, but it is possible that no
one professor in a team can teach the course. Model this situation, introducing additional entity sets and
relationship sets if necessary
Problem 2
A company database needs to store information about employees (identied by ssn, with salary and phone as attributes), departments (identied by dno, with dname and budget as attributes), and children of employees (with
name and age as attributes). Employees work in departments; each department is managed by an employee; a child
must be identied uniquely by name when the parent (who is an employee; assume that only one parent works for
the company) is known. We are not interested in information about a child once the parent leaves the company.
Draw an ER diagram that captures this information (only major attribures shown).
Problem 3
The Motor Vehicle Branch administers driving tests and issues driver's licenses. Any person who wants a driver's
license must rst take a learner's exam at any Motor Vehicle Branch in the province. If he/she fails the exam, he
can take the exam again any time after a week of the failed exam date, at any branch. If he passes the exam, he is
issued a license (type = learner's) with a unique license number. A learner's license may contain a single restriction
on it. The person may take his driver's exam at any branch any time before the learner's license expiry date (which
is usually set at six months after the license issue date). If he passes the exam, the branch issues him a driver's
license. A driver's license must also record if the driver has completed driver's education, for insurance purposes.
Draw an ER diagram that captures this information (only major attributes shown).