资源描述:
《Chapter3-TheRelationalDataModel.ppt》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、1DatabasePrinciples2Chapter3TheRelationalDataModelRelationalModelFunctionalDependencies3Contents3.1BasicsoftheRelationalModel3.3FromE/RdiagramstoRelationalDesigns3.5FunctionalDependencies3.7DesignofRelationalDatabaseSchemasReadingGuideExercise4Thethin
2、gsyoushouldknow…ThebasicprincipleofrelationaldatabaseisproposedbyE.F.Coddin1970.ThefirstRDBMSproductionisSystemRThemostpopularRDBMSDB2,Oracle,Ingres,Sybase,Informix,…53.1BasicoftheRelationalModelTherelationalmodelgivesusasinglewaytorepresentdata:asatw
3、o-dimensionaltablecalledarelation.6Attributes(属性)Attributesofarelationserveusasnamesforthecolumnsoftherelation.Usually,theattributesdescribesthemeaningofentriesinthecolumnbelow.7Schemas(模式)Thenameofarelationandthesetofattributesforarelationiscalledthe
4、schemaforthatrelation.Weshowtheschemafortherelationwiththerelationnamefollowedbyaparenthesizedlistofitsattributes.8Tuples(元组)Therowsofarelation,otherthantheheaderrowcontainingtheattributes,arecalledtuple.Forexample:Relations,however,aresetsoftuples,an
5、ditisimpossibleforatupletoappearmorethanonceinagivenrelation.9Domains(域)Therelationalmodelrequiresthateachcomponentofeachtuplebeatomic;thatis,itmustbeofsomeelementarytypesuchasintegersorstring.Eachattributesofarelationhasparticularelementarytype,thusd
6、omainisdecided.10EquivalentRepresentationsofaRelationTheattributesoftherelationcanbereorderedwithoutchangetherelation.11RelationInstance(关系实例)Arelationaboutmoviesisnotstatic;rather,relationschangeovertime.Itisnotcommonfortheschemaofarelationtochange.W
7、eshallcallasetoftuplesforagivenrelationaninstanceofthatrelation.12AnExampleofRelationInstanceRelation:Person(Name,Address,Telephone)RelationInstance:NameAddressTelephoneBob123MainSt555-1234Bob128MainSt555-1235Pat123MainSt555-1235Harry456MainSt555-2221
8、Sally456MainSt555-2221Sally456MainSt555-2223Pat12StateSt555-123513More…Relation(Instance)=asetoftuplesDatabase=collectionofrelationsRelationschema=relationname+attributesExample:Movies(title,year,length,fileType)Databaseschema=asetofallrelatio