欢迎来到天天文库
浏览记录
ID:51969287
大小:1.04 MB
页数:77页
时间:2020-03-26
《数据库系统英第三版课件衷宜2011版 relation(2).ppt》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、Chapter2TheRelationalModelofData第2章关系数据模型2TheRelationalModelofDataWhatisadatamodel?Whatisarelationaldatamodel?HowtodefinearelationschemainSQL?Whichoperationscanbeintherelationalmodel?Whataretheresultoftheseoperations?Theoperationsintherelationalmodelcanbeexpr
2、essedineitheranalgebra,called“relationalalgebra”.Relationalalgebracanexpressnotonlyoperations,butalsoconstraintsonrelations.关系数据模型关系代数约束2.1AnOverviewofDataModelsWhatisadatamodel?Mathematicalrepresentationofdata.Examples:relationalmodel=tables;semistructuredmo
3、del=trees/graphs.Operationsondata.Constraints.2.1AnOverviewofDataModelsSeveraldatamodelsTherelationalmodel,includingobject-relationalextensionsThesemistructured-datamodel,includingXMLandrelatedstandardsThehierarchicalmodel层次模型Thenetworkmodel网状模型2.2Basicsofthe
4、RelationalModelRelation关系Atwo-dimensionaltablecalledarelation.titleyearlengthfilmTypeStarWarsWayne’sWorldMightyDucks…197719921991…12495104…colorcolorcolor…Movies2.2BasicsoftheRelationalModelWhyRelations?Verysimplemodel.Oftenmatcheshowwethinkaboutdata.Abstract
5、modelthatunderliesSQL,themostimportantdatabaselanguagetoday.2.2.1AttributesAttribute属性Namesforthecolumnsoftherelation,describethemeaningofentriesinthecolumnbelow.SuchaslengthofMovies.Anattributehaveaname.Anytwoattributesofarelationcan’thavesamename.titleyearl
6、engthfilmTypeStarWarsWayne’sWorldMightyDucks…197719921991…12495104…colorcolorcolor…Attributes(columnheaders)2.2.2SchemasRelationschema=relationnameandattributelist.Optionally:typesofattributes.Database=collectionofrelations.Databaseschema=setofallrelationsche
7、masinthedatabase.Example:Movies(title,year,length,filmtype)orMovies(title:string,year:int,length:int,filmtype:string)关系模式2.2.3TuplesTuples元组Therowsofarelation,otherthantheheaderrowcontainingtheattributes,arecalledtuples.Theremaybenotupleinarelation.Atuplehaso
8、necomponentforeachattributeoftherelation.titleyearlengthfilmTypeStarWarsWayne’sWorldMightyDucks…197719921991…12495104…colorcolorcolor…Tuples(rows)分量2.2.3TuplesHowtodescribeatuple?Usecomma
此文档下载收益归作者所有