Question
Problem 1. Consider the following relational database: student ( student_number , name ) course ( course_number , year , semester , classroom ) take (
Problem 1. Consider the following relational database:
student ( student_number , name )
course ( course_number , year , semester , classroom )
take ( ? ? ? )
(a) (10 points) Identify an appropriate primary key for each of the student and course relations. Assume that (i) each student is assigned a unique number, (ii) for each combination of year and semester (e.g., 2018 Fall), each course is assigned a unique course number, and (iii) a course with a certain course number (e.g., CSI 508) may have been offered multiple times (e.g., 2017 Spring and 2017 Fall). Explain why the primary key that you have chosen for the course relation is a candidate key.
(b) (10 points) Given your choice of primary keys for the student and course relations, identify appropriate attributes for the take relation. This take relation must store data regarding the courses that each student has taken. Assume that a student may have taken a course (e.g., CSI 508) multiple times (e.g., 2017 Spring and 2017 Fall). Also, identify an appropriate primary key for the take relation.
(c) (10 points) Given your choice of primary keys, identify all of the foreign keys. For each foreign key, specify the referencing and referenced relations.
(d) (10 points) Describe a situation where an attempt to update the take relation violates a foreign key constraint. Explain why your answer is correct.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started