Hw3 - 1. Suppose we have the following requirements for a...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1. Suppose we have the following requirements for a university database that is used to keep track of students’ transcripts: a. The university keeps track of each student's name (Sname), student number (Snum), social security number (Ssn), current address (Sc_addr) and phone (Sc_phone), permanent address (Sp_addr) and phone (Sp_phone), birthdate (Bdate), sex (Sex), class (Class) (freshman, sophomore, ..., graduate), major department (Major_code), minor department (Minor_code) (if any), and degree program (Prog) (B.A., B.S., ..., Ph.D.). Both ssn and student number have unique values for each student. b. Each department is described by a name (Dname), department code (Dcode), office number (Doffice), office phone (Dphone), and college (Dcollege). Both name and code have unique values for each department. c. Each course has a course name (Cname), description (Cdesc), code number (Cnum), number of semester hours (Credit), level (Level), and offering department (Cdept). The value of code number is unique for each course. d. Each section has an instructor (Iname), semester (Semester), year (Year), course (Sec_course), and section number (Sec_num). Section numbers distinguish different sections of the same course that are taught during the same semester/year; its values are 1, 2, 3, ...; up to the number of sections taught during each semester. e. A grade record refers to a student (Ssn), refers to a particular section, and grade (Grade). Design a relational database schema for this database application. First show all the functional dependencies that should hold among the attributes. Then, design relation schemas for the database that are each in 3NF or BCNF. Specify the key attributes of each relation. Note any unspecified requirements, and make appropriate assumptions to make the specification complete. 2. Consider the universal relation R = {A, B, C, D, E, F, G, H, I, J} and the set of functional dependencies F = {{A, B} {C}, {A} {D, E}, {B} {F}, {F} {G, H}, {D} {I, J}}. What is the key for R? Decompose R into 2NF, then 3NF relations 3. Repeat exercise 2 for the following different set of functional dependencies G = { {A, B} {C}, {B, D} {E, F}, {A, D} {G, H}, {A} {I}, {H} {J} }. 4. This exercise asks you to converting business statements into dependencies. Consider the following relation Disk_Drive(Serial_number, Manufacturer, Model, Batch, Capacity, Retailer). Each tuple in the relation Disk_Drive contains information about a disk drive with a unique Serial_number, made by a manufacturer, with a particular model, released in a certain batch, which has a certain storage capacity, and is sold by a certain retailer. For example, the tuple Disk_Drive(‘1978619’, ‘WesternDigital’, ‘A2235X’, ‘765234’, 500, ‘CompUSA’) specifies that WesternDigital made a disk drive with serial number 1978619, model number A2235X in batch 765235 with 500GB that is sold by CompUSA. Write each of the following dependencies as an FD: i. The manufacturer and serial number uniquely identifies the drive ii. A model number is registered by a manufacturer and hence can’t be used by another manufacturer. iii. All disk drives in a particular batch are the same model. iv. All disk drives of a particular model of a particular manufacturer have exactly the same capacity. 5. Show that, if the matrix S resulting from Algorithm 15.3 does not have a row that is all a symbols, projecting S on the decomposition and joining it back will always produce at least one spurious tuple. 6. Show that the relation schemas produced by Algorithm 15.5 are in BCNF. 7. Consider universal relation R(A,B,C,D,E,F,G,H,I,J) of Exercise 14.24. Determine for each of the following decompositions whether (i) the dependencies are preserved, (ii) the lossless join property holds, and (iii) determine which normal form the decomposition is in. a. D1 = {R1, R2, R3, R4, R5}, R1 = {A,B,C}, R2 = {A,D,E}, R3 = {B,F}, R4 = {F,G,H}, R5 = {D,I,J} b. D2 = {R1, R2, R3}, R1 = {A,B,C,D,E}, R2 = {B,F,G,H}, R3 = {D,I,J} c. D3 = {R1, R2, R3, R4, R5}, R1 = {A,B,C,D}, R2 = {D,E}, R3 = {B,F}, R4 = {F,G,H}, R5 = {D,I,J} ...
View Full Document

Ask a homework question - tutors are online