资源描述:
《浙江大学2007–2008学年春季学期》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、浙江大学2007–2008学年春季学期《数据库系统原理》课程期末试卷解答开课学院:计算机学院,考试形式:闭卷,允许带_1张A4纸笔记___入场考试时间:2008年4月19日,所需时间:120分钟,任课教师_________1.Entity-RelationshipModel(15points)TransformthefollowingERdiagramintoaminimumnumberofrelationschemaswithnecessarynormalization.Listallcandidatekeysforeachrelationschema.CityStreetPostCode
2、SexStartDateDnoBdatephonesNameAddressLocationNameWorkForEmployeeEidDepartmentManageDependOfPrControlStartdateWorkOnPrDependentProjectHoursNameBirthDateSexNamePnoLevelRelationship2.RelationalAlgebra(8points)Considerthefollowingschemas:Student(Sid,Name,Department);ProjectTeam(TeamName,Sid).Thekeyattr
3、ibutesareunderlined.Writerelationalalgebraexpressionsforthefollowingqueries.(1)FindtheNamesofstudentswhoareintheteamwithTeamName’RedStar’.(2)FindtheSidofstudentswhohavenotbeeninanyteamyet.3.SQL(28points)Considerthefollowingrelationsabouttheonlinebookstore.Underlinedattributesarekeysofthoserelations
4、.TheattributescidandisbninBuyrelationareforeignkeysreferringCustomerandBookrespectively.Book(isbn,title,publisher,price,year);Customer(cid,name,address,postcode);Buy(bid,cid,isbn,NumberOfCopies,year,month,day).//customercidbuysanumberofcopiesofthebookisbn,i.t.NumberOfCopies≥1(1)Listeachcustomer’sci
5、d,thetotalnumberofcopiesofthebookswhichhe/sheboughtfromtheonlinebookstore.(2)Findthenameofcustomerswhospentmorethan$1000tobuybooksinyear2007.(3)Findoutthemonthduringwhichthebookstoresoldoutthemaximumnumberofbookswithinyear2007.(4)Findoutthebookswhichhaveneverbeenboughtfromthebookstore.(5)Cutdownthe
6、pricetothe50%ofthebookswhichwerepublishedbeforeyear2003andhadnotbeenboughtanycopiesfromthebookstoreinthelastthreeyears.4.ArmstrongAxiom(6points)(1)UseArmstrong’saxiomstoprovethedecompositionrule.Thatis:ifA→BCholds,thenA→BholdsandA→Cholds.(2)ProvewhetherthefollowingruleistrueusingArmstrong'saxiomsor
7、rejectitbycounterexamplerelations.If(A→C)and(AB→C),then(B→C)5.FunctionalDependenciesandNormalForms(15points)Considerthefollowingrelationschemasandfunctionaldependencies:R(A,B,C,D,E)withthefollowingfunctiona