PART2RELATIONALDATABASESChapter2RelationalModelMarch2009DatabaseSystemConcepts-Chapter2RelationalModel-3IntroductiontoChapter2Relationaldatamodelrelationaldatastructure(syntax)integrityconstraints(semantic)constraintsonattributesofschemas,e.g.valuedomain,typeconstraintsondependenciesamongattributesofaschemaconstraintsondependenciesamongattributesofdifferentschemasrelationalnormalforms(范式,chapter7)operationsonthemodelMarch2009DatabaseSystemConcepts-Chapter2RelationalModel-4MainPartsinChapter2Relationaldatastructure(syntax,§2.1.1-2.1.3)basicelementsinrelationaldatamodel,i.e.tablesandattributes,andrelationshipsamongthemIntegrityconstraints(semantic)constraintsonkeysinrelationalschemaRelationalalgebra(关系代数,§2.2-2.5)(operationsonthemodel)fundamentaloperations(§2.2)additionaloperations(§2.3)extendedoperations(§2.4)Usingrelationalalgebraoperationstomodify(delete,insert,updating)database(§2.6)March2009DatabaseSystemConcepts-Chapter2RelationalModel-5CategoriesofrelationaloperationsMainPartsinChapter2(cont.)relationaloperations/arithmeticrelationalcalculustuplerelationalcalculusrelationalalgebradomainrelationalcalculustuplerelationalcalculus(元组关系演算,§5.1)domainrelationalcalculus(域关系演算,§5.2)March2009DatabaseSystemConcepts-Chapter2RelationalModel-6§2.1StructureofRelationalDatabasesArelationaldatabaseconsistsofacollectionofrelationaltablesarowinatablerepresentsarelationshipamongasetofvaluesatableissuchacollectionofrelationships.2.1.1BasicstructureGivensetsD1,D2,….Dn,arelationrisasubsetofD1╳D2╳…╳Dnr={(a1,a2,…,an)}D⊆1╳D2…..╳Dnrelationr={tuple}/*元组March2009DatabaseSystemConcepts-Chapter2RelationalModel-7AttributesofrelationrA1,A2,…,Andomainoftherelation’sattributesD1,D2,….DnthesetofallowedvaluesforeachattributeNotesrelationrinDBSisthelimitedset(有限集合)attributesintuplesarenon-oredered(无序性)e.g.(d1,d2,…,dn)=(d2,d1,…,dn)theorderinwhichthetuplesappearinarelationsisirr...