资源描述:
《数据库系统英第三版课件2012版 Database Systems(2).ppt》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、2TheRelationalModelofDataAnOverviewofDataModelsBasicsoftheRelationalModelDefiningaRelationSchemainSQL*AnAlgebraicQueryLanguageConstraintsonRelations2.1AnOverviewofDataModelsAdatamodelisanotation(符号)fordescribingdataorinformation.Conceptualmodel(概念模型)Databasedatamodel:thedescrip
2、tiongenerallyconsistsofthreeparts:Structureofthedatarelationalmodel=tables;networkandhierarchicalmodels=graphs/trees.OperationsonthedataConstraints(约束)onthedata2.1AnOverviewofDataModelsImportantDataModels:TheRelationalModel,includingobject-relationalextensions;TheSemistructured
3、-dataModel,includingXML(扩展标记语言)andrelatedstandards;NetworkandHierarchicaldataModelsHigh-LevelDataModelTheEntity/RelationshipModelObjectDefinitionLanguagetitleyearlengthgenreGoneWiththeWind1939231dramaStarWars1977124sciFiWayne’sWorld199295comedy2.2BasicsoftheRelationalModelRelat
4、ion:Therelationalmodelgivesusasinglewaytorepresentdata.Atwo-dimensionaltablecalledarelation.Eachrelationhasaname.Movies2.2BasicsoftheRelationalModelWhyRelations?Providesasimple,limitedapproachtostructuringdata.Providesalimited,yetuseful,collectionofoperationsondata.Theyallowust
5、oimplementlanguages,suchasSQL,thatenabletheprogrammertoexpresstheirwishesataveryhighlevel.2.2.1AttributesAttribute(属性):Thecolumnsofarelationarenamedbyattributes.Eachattributeofarelationhasaname,describesthemeaningofentriesinthecolumnbelow.Anytwoattributesofarelationcan’thavesam
6、ename.titleyearlengthgenreGoneWiththeWind1939231dramaStarWars1977124sciFiWayne’sWorld199295comedyMoviesAttributes(columnheaders)2.2.2Schemas(模式)Relationschema=relationnameandthesetofattributes.Example:Movies(title,year,length,genre)orMovies(title:string,year:integer,length:inte
7、ger,genre:string)Wecanreordertheattributesofarelation,withoutchangingtherelation.Example:Movies(year,title,length,genre)2.2.2Schemas(模式)Relationaldatabaseschema=setofallrelationschemasinthedatabase.Relationaldatabase=collectionofrelations.titleyearlengthgenreGoneWiththeWind1939
8、231dramaStarWars1977124sciFiWayne’sWorld199295comedy2.