Sunteți pe pagina 1din 4

CSC 341: Homework #3

E-R Design for College Registrar’s Database

Recall: The following table headers represent a possible (considerably simplified) design
for a University Registrar’s database. In this database we need to keep track of student
records, courses and their sections, instructors assigned to teach these course sections, and,
most importantly, which students are enrolled in which sections.

Students
stu_id l_name f_name m_name major phone address GPA class

Primary key : stu_id


Courses
course id credits title department description

Foreign key :

Locations
bldg room_num room_type num_seats

Foreign key :

Instructors
instr_id l_name f_name department bldg room_num phone email

Foreign key : (bldg, room_num)

Course_Sections

sect_id course_id schedule capacity num_stu bldg room_num instr_id

Foreign key : course_id


Foreign key : (bldg, room_num)
Foreign key : instr_id

Enrollment
stu_id sect_id

Foreign key :

The following diagram (see next page) represents incomplete E-R design for the above
database. This design is unfinished:
 Names of attributes and relationships are missing
 Some of the relationships between entities in the database are not shown at all
 Cardinalities of relationship and attributes are not shown

1. Your first task is to complete the design by providing these missing elements.
Please note: foreign key attributes in the tables do not show up as ovals attached to the
corresponding rectangles; for example, the box representing Course_Sections should
not have an oval for course_id (foreign key into Courses) attached to it.
m_name

l_name f_name

name

course_id
stu_id

Students Courses

have
enroll_in
instr_id

sect_id
Course_ Instructors
Sections

name

fname
lname

bldg Locations

roomNum

The following is required:


− Show the missing relationships (add more diamonds to the diagram)
− Provide names for all attributes and relationships
− For each relationship, mark both minimum and maximum cardinalities of each
entity participating in the relationship, by placing a comma-separated pair of
values next to each corresponding connector. Recall: the only possible cardinality
pairs are (0, 1), (1, 1), (0, N), and (1, N).
2. Your second task is to modify the design (provide a separate E-R diagram) as follows:
− One student should be able to have multiple majors, so make major a multi-
valued attribute in the design
− Courses usually have prerequisites, i.e., other (possibly multiple) courses that a
student must take before enrolling in a particular course section. Add a recursive
(loop) relationship connecting an instance of Courses to other instances of
Courses; label the sides of this relationship and show corresponding cardinalities
− Make Course_Sections a weak entity, attached to the strong entity Courses; show
the change in the diagram by using appropriate symbols/markings
− A student enrolled in a course section should be assigned a grade at the end of the
semester. Please add grade attribute to the design; consider carefully where the
attribute should be “attached”, so that it does not become multi-valued.
(HINT: grade is a characteristic of Student - Course_Section pairing)
− Show table headers (similar to the ones on the first page) for all the new tables
resulting from the changes in the design, as well as the pre-existing tables that are
affected by the changes. (Do not show headers for tables that are not changed in
any way.)

This is an individual assignment, no collaboration between students is allowed. Any such


collaboration will be considered a violation of Academic Honesty policy, and all parties involved
will face serious consequences, as described in the course syllabus.
Submit your results in the form of the MS Word file named ER_design.doc via the assignment
link on Moodle; this assignment is due by midnight on Monday, March 5.

S-ar putea să vă placă și