Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven NoSQL Databases In A Week Get Up And Running With The Fundamentals And Functionalities Of Seven Of The Most Popular NoSQL Databases

Authors: Aaron Ploetz ,Devram Kandhare ,Sudarshan Kadambi ,Xun Wu

1st Edition

1787288862, 978-1787288867

More Books

Students also viewed these Databases questions