next up previous
Next: About this document

centering17

Consider a slightly different relational database for a university registrar's office (different from the last homework assignment, that is). The relations are student, class, instructor, teaches, and taking. The schemes of these relations are:

Student-scheme = (name, standing, student-num)
Class-scheme = (schedule-num, semester, department, number, days, time, place, enrollment)
Instructor-scheme = (name, department, office)
Teaches-scheme = (name, office, schedule-num, semester)
Taking-scheme = (student-num, schedule-num, semester, grade)

where the value of attribute standing is one of {freshman, sophomore, junior, senior}, and the schedule-num attribute of Class-scheme, Teaches-scheme and Taking-scheme is a unique number used to identify a particular section of a course (i.e. each course or section of a course has a unique schedule number), and the semester attribute of these relations identifies the year and semester of the course (i.e. Spring 1997). The teaches relation is intended to represent relationships between instructors and classes, and the taking relation is intended to represent relationships between students and classes.

  1. (8 pts) Compare this database design with the design used in Homework 2. Are there any ways in which this new design is better? Justify your answer.

    Write relational algebra expressions for each of the following queries:

  2. (4 pts) Find the name and standing of all students who are taking or have taken a course taught by Tim Wahls.
  3. (8 pts) Find the student-num of all students who have taken or are taking ALL classes ever taught by Tim Wahls.
  4. (4 pts) Find the name and standing of all students who have taken or are taking ALL classes ever taught by Tim Wahls.




Tim Wahls
Tue Feb 4 14:16:21 EST 1997