Chapter 5, exercises and answers

Exercises
1. In a course registration system, for the event student registers for
classes, create an event table entry listing the event, trigger, source,
activity, response(s), and destination(s). For the event time to produce
grade reports, create another event table entry.
2. Consider the entity-relationship diagram shown in the figure on nest
page, the refined ERD showing course enrollment with an associative
entity. Does this model allow a student to enroll in more than one course
section at a time? Does the model allow a course section to contain more
than one student? Does the model allow a student to enroll in several
sections of the same course and get a grade for each enrollment? Does
the model store information about all grades earned by all students in all
sections?
Course
Student
course number*
title
creit hours
student ID*
name
major
Course Section
section number*
start time
room number
Course Enrollment
grade
3. Again consider the entity-relationship diagram shown in the figure up . Add
the following to the diagram and list any assumptions you had to make. A
faculty member usually teaches many course sections, but some semesters
they don't teach any. Each course section must have at least one faculty
number teaching it, but sometimes course sections are taught by teams.
Further, to make sure all course sections are similar, one faculty member is
assigned as course coordinator to oversee the course, and each faculty
member can be coordinator of many courses.
4. If the entity relationship diagram you drew in exercise 3 above
showed a many-to-many relationship between faculty and course
section, a further look at the relationship might reveal some additional
information might need to be stored. What might this information
include? (Hint: does the instructor have specific office hours for each
course section? Do you give an instructor some sort of evaluation for
each course section?) Expand the ERD to allow this additional
information to be stored.
5. Draw a class diagram for the course enrollment system completed
in question number 4 above (Use association class notation)
Event
Student
registers for
classes
Time to
produce
grade
reports
Yes to all.
Trigger
Registration
request data
Source
Student
Activity
Enroll
student
Response Destination
New
Student
schedule
“3 days after
final grades
due deadline
each
semester”
(no source
Produce Grade
for temporal semeste report
event)
r grade
reports
Student
The relationship between faculty and course is “coordinates”
The relationship between faculty member and course section is “teaches”
Faculty Member
faculty ID*
name
rank
Course
Student
course number*
title
creit hours
student ID*
name
major
Course Section
section number*
start time
room number
Course
Enrollment
grade
The many-to-many relationship “teaches” is expanded to an associative entity “Faculty Section,” which stores the role
(lead teacher, co-teacher) the office hours for the section, and the final evaluation score for the section. Note the key
to the associative entity is the faculty ID plus the section ID. The key for grade is not shown in the text or in this
example, but it would be student ID plus section ID in a relational database. Some instructors will want the keys,
others will not see a need for it in an associative entity.
Faculty Member
faculty ID*
name
rank
Course
Student
course number*
title
creit hours
student ID*
name
major
Faculty Section
Course Section
fac ID + sec #*
role
office hours
evaluation score
section number*
start time
room number
Course Enrollment
stu ID + sec #*
grade
FacultyMember
facultyID
name
rank
1
0..
.*
0.
.*
FacultySection
role
officeHours
evalScore
Course
Student
courseNumber
title
creditHours
studentID
name
major
0.
.*
1
0.
.*
0..
.*
CourseSection
sectionNumber
startTime
roomNumber
0.
.*
CourseEnrollment
grade