Sei sulla pagina 1di 2

Homework#7:RelationalDatabaseDesign CS122A:IntroductiontoDataManagement MichaelJ.Carey,Winter2013(100ptstotal) DueDate:Thu,March13,9PM Submission[Duedate:Wed,March13,9:00PM] All homework assignments should be submitted to the corresponding dropbox in EEE.

Homework #7 shouldbe submitted to the dropboxnamed[CS122A]Homework#7.Pleaseuse the following naming scheme for your submission file: studentID_HW7.pdf. For example, 12345_HW7.pdf,ifyourstudentID12345.Thehomeworkmustbedoneindividually. Question1.(50pts)SchemaRefinementandNormalForms Consider the attribute set R=ABCDEGH and the FD set F={AB>C, AC>B, AD>E, B>D, BC>A,E>G}. 1.1. (25 pts) For each of the following attribute sets, do the following: (i) Compute the set of dependencies that hold over the set. (ii) Name the strongest normal form that is not violated by the relation containing these attributes. (iii) Decompose it into a collectionof BCNFrelationsifit isnotinBCNF. (a)ABC (b)ABCD (c)ABCEG (d)DCEGH (f)ACEH 1.2. (25 pts) Which of the following decomposition of R=ABCDEG, with the same set of dependenciesF,is(1)dependencypreserving?(2)losslessjoin? (a){AB,BC,ABDE,EG} (b){ABC,ACDE,ADG} Question2.(50pts)PhysicalDatabaseDesign Consider the following BCNF relational schema for a portion of a university database (type informationisnotrelevanttothisquestionandisomitted) Prof(ssno,pname,office,age,sex,specialty,dept_did) Dept(did,dname,budget,num_majors,chair_ssno) Suppose you know that the following queries are the five mostcommonqueriesintheworkload forthisuniversityandthatallfiveareroughlyequivalentinfrequencyandimportance: List the names, ages, and offices of professors of auserspecifiedsex(maleorfemale) who have a userspecified research specialty (e.g., recursive query processing).

Assume that the university has a diverse set of faculty members, making it very uncommonformorethanafewprofessorstohavethesameresearchspeciality. List all the department information for departments with professors in a userspecified agerange. List the department id, department name, and chairperson name for departmentswitha userspecifiednumberofmajors. Listthelowestbudgetforadepartmentintheuniversity. Listalltheinformationaboutprofessorswhoaredepartmentchairpersons.

These queries occurmuch more frequently than updates,soyoushouldbuildwhateverindexes you need to speed up these queries. However, you should not build any unnecessary indexes, asupdateswilloccur(andwouldbesloweddownbyunnecessaryindexes). Assume that B+ trees are supported by the DBMS and that both single and multipleattribute index search keys are permitted. Specify your physical design by identifying the attributes you recommendindexingon,indicatingwhethereachindexshouldbeclusteredorunclustered.

Potrebbero piacerti anche