Question: Problem 2. (40 points) Consider the following relational database: branch (branch name, branch_city) customer (customer_number, customer_name, customer_city) loan (loan_number, branch_name, amount) borrower (customer_number, loan_number) (a)
Problem 2. (40 points) Consider the following relational database: branch (branch name, branch_city) customer (customer_number, customer_name, customer_city) loan (loan_number, branch_name, amount) borrower (customer_number, loan_number) (a) (10 points) Identify an appropriate primary key for each of the above relations. Assume that (i) each branch is assigned a unique name, (ii) each customer is assigned a unique number, (iii) each loan is assigned a unique number, (iv) a customer may have multiple loans and a loan may be shared by multiple customers. (b) (10 points) Using the schema of the customer relation, provide an example of a superkey which is not a candidate key. Explain why your answer is correct. (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. 1 (d) (10 points) For one of the foreign keys identified above, explain a situation where deleting a record/tuple causes a violation of the foreign key constraint (referential integrity constraint)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
