A-Relational-Model-of-Data-for-Large-Shared-Data-B

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

1ARelationalModelofDataforLargeSharedDataBanksE.F.CoddIBMResearchLaboratory,1970PresentedbyQingminLiu*Getslideson“~liuqmin/cs757.ppt”2Including......IntroductionRelationalModelNormalFormOperationsonRelationsRedundancyConsistencySummary3IntroductionFutureusersoflargedatabasemustbeprotectedfromhavingtoknowhowthedataisorganizedintheinternalrepresentation.Apromptingservicewhichsuppliessuchinformationisnotasatisfactorysolution.Activitiesofusersofterminalsandmostapplicationprogramsshouldremainunaffectedwhentheinternalrepresentationofdataischangedandevenwhensomeaspectsoftheexternalrepresentationarechanged.Changesindatarepresentationwilloftenbeneededasaresultofchangesinquery,update,andreporttrafficandnaturalgrowthintypesofstoredinformation.4IntroductionTherelationalmodelissuperiorinseveralrespectstothegraphornetworkmodel:–Itprovidesameansofdescribingdatawithitsnaturalstructureonly,thatis,withoutsuperimposinganyadditionalstructureformachinerepresentationpurposes.–Itformsasoundbasisfortreatingderivability,redundancy,andconsistencyofrelations.–Itpermitsaclearerevaluationofthescopeandlogicallimitationsofpresentformatteddatasystems,andalsotherelativemeritsofcompetingrepresentationsofdatawithinasingesystem.5RelationalModelWhyRelationalModel?–Varietyofdatarepresentationcharacteristicswhichcanbechangedwithoutlogicallyimpairingsomeapplicationprograms.–Toremovethreeoftheprincipalkindsofdatadependencies:Orderingdependence:confusedbysystemandapplicationIndexingdependence:slowdownresponsetoinsertion,deletions.Accesspathdependence:impairedapplicationprogramsiftreeornetworkdataarechangedinstructure.6RelationalModelWhatRelationalModel?–Risarelationonnsets(S1,S2,…Sn)ifitisasetofntupleseachofwhichhasitsfirstelementfromS1,secondelementfromS2,andsoon.–SjisreferredasthejthdomainofrelationR.–Rissaidtohavedegreen.Degree1–unaryDegree2–binaryDegree3–ternaryDegreen–n-ary7RelationalModelPropertiesofn-aryrelationR–Eachrowrepresentsann-tupleofR.–Theorderingofrowsisimmaterial.–Allrowsaredistinct.–Theorderingofcolumnsissignificant.–Thesignificanceofeachcolumnispartiallyconveyedbylabelingitwiththenameofthecorrespondingdomain.8RelationalModelExampleof4-aryrelationSupply(supplierpartprojectquantity)12517135232379275441112RelationNameDomainNameAtupleDegree49RelationalModelConcepts–Primarykey:onedomain(orcombination)hasvalueswhichuniquelyidentifyeachelementoftherelation.It’snon-redundant.–Foreignkey:adomainthatisnottheprimarykeyofRbutitselementsarevaluesoftheprimarykeyofsomerelationS.–Simpledomain:itselementisatomicvalue.–Non-simpledomain:itselementisnonatomic.10NormalFormNormalformisawaytoestablishrelationalmodel.Arelationwhosedomainsareallsimplecanberepresentedinstoragebyatwodimensionalcolumn-homogeneousarrayasdiscussedabove.Somemorecomplicateddatastructureisnecessaryforarelationwithoneormorenonsimpledomains.11NormalFormNormalization:–Eliminationprocedureofnonsimpledomains.Procedure:–Startwiththerelationatthetopofthetree,takeitsPKandexpandeachoftheimmediatelysubordinaterelationsbyinsertingthisPKdomainordomaincombination.–ThePKofeachexpandedrelationconsistsofthePKbeforeexpansionaugmentedbythePKcopieddownfromtheparentrelation.–Strikeoutfromtheparentrelationallnonsimpledomains,removethetopnodeofthetree.–Repeatthesamesequenceoneachremainingsubtree.12NormalFormNormalizationExample–Unnormalizedsetofrelationemployeeemployee(man#,name,birthday,jobhistory,children)jobhistory(jobdate,title,salaryhistory)salaryhistory(salarydate,salary)children(childrenname,birthdate)–Normalizedsetofemployeeemployee’(man#,name,birthday)jobhistory’(man#,jobdate,title)salaryhistory’(man#,jobdate,salarydate,salary)children’(man#,childrenname,birthdate)employeejobhistorychildrensalaryhistory13OperationsonRelationsSelect()–SelectsalltuplesthatsatisfytheselectionconditionfromrelationR.selectcondition(R).Project()–ProducesanewrelationwithonlysomeoftheattributesofR,andremovesduplicatetuples.attributelist(R)Cartesianproduct()–ProducearelationthathastheattributesofR1andR2andincludesastuplesallpossiblecombinationsoftuplesfromR1andR2.R1R2.14OperationsonRelationsSetOperationsUnioncompatible:R(A1,A2,…An)andS(B1,B2,…Bn)areunioncompatibleifRandShavesamedegreen,anddom(Ai)=dom(Bi)–Union():producearelationthatincludesallthetuplesinR1orR2orbothR1andR2.R1R2.–Intersection():producearelationthatincludesallthetuplesinbothR1andR2.R1R2.–Difference():producearelationthatincludesallthetuplesinR1thatarenotinR2.R1R2.Join–Thetajoin():produceallcombinationsoftuplesfromR1andR2thatsatisfythejoinconditions(=:equijoin,,,,,).R1cR2.–Naturaljoin(*):sameasequijoinexceptthatthejoinattributesofR2arenotincludedintheresultingrelation.R1*R2.15RedundancyStrongRedundancy–Asetofrelationsisstronglyredundantifitcontainsatleastonerelationthatpossessesaprojectionwhichisderivablefromotherprojectionsofrelationsintheset.–Existenceofstrongredundanciesisuserconvenience,whichenablesasystemordatabaseadministratorgreaterfreedomintheselectionofstoredrepresentationtocopemoreefficientlywithcu

1 / 18
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功