



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Final Exam Name: Major: SSN (last 4 digits): Answer the following questions. Be brief and precise, please. You have 2 hours to finish the exam. Undergraduate students !!! Answer only question for a total of 85, that is, you may drop any full or sub-questions for the total of 15 points.
1. 15 points Consider a university database for the scheduling of classrooms for final exams. This database could be modeled as the single entity set EXAM , with attributes course, section, room , and time. Alternatively, one or more additional entity sets could be defined, along with relationship sets to replace some of the attributes of the EXAM entity set as follows: COURSE with name, department, c-number SECTION with s-number, enrollment , as a dependent weak entity set on COURSE. ROOM with building, r-number, and capacity. For these two design alternatives: (10) Show ER diagram illustrating the use of all three additional entity sets. (5) Explain what application characteristics would influence a decision to include or not to include one or more of the additional entity sets. (Exercise from H.F. Korth & A. Silberschatz)
2. 10 points (5) Let R=(A,B,C,D) and functional dependencies (1) A C , (2) AB D. What is the closure of {A,B}? (5) Explain the connection between closure of attributes and keys of a relation.
4. 20 points Consider the following two transactions: T1: r1[B] (if B <=100 then B:=B+100) w1[B] T2: r2[B] (if B <=100 then B:=B+100) w2[B] The consistency requirement is that (B<=200). Let B = 50 be the initial value. (5) Show that every serial execution involving T1 and T2 preserves consistency of the database. (5) Show a concurrent execution of T1 and T2 that produces a nonserializable schedule. (5) Is the final result of your nonserializable schedule satisfies the consistency requirement? Is it correct? Why or why not?
(5) Add locks to the transactions and show how strict 2-phase locking would prevent your nonserializable execution.
5. 15 points Given relation schema R(A,B,C,D,E,F,G) and functional dependencies (1) E ACB , (2) A CD , and (3) CD F (4) D G You need to decompose the relation such that the decomposition Reduces redundancies Lossless join and Dependency preserving Show your decomposition and establish its correctness based on the concepts of BCNF, 3NF, lossless join, and dependency preserving. You may not be able to find a decomposition that satisfies all requirements. Justify your preferences.
(5) Consider the following B+-tree with n=3. Show the insertion of search-key 12. Bonus Question 5 points You are asked to design a database system for a health club. The database would contain data about customers, their training, contact numbers, etc. Show the main steps you would perform for designing and implementing the database. (Don’t show the actual schemas!)