《数据库系统概念教学》ch课件_第1页
《数据库系统概念教学》ch课件_第2页
《数据库系统概念教学》ch课件_第3页
《数据库系统概念教学》ch课件_第4页
《数据库系统概念教学》ch课件_第5页
已阅读5页,还剩199页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Chapter7:Entity-RelationshipModel.Chapter7:Entity-RelationshiChapter7:Entity-RelationshipModelDesignProcessModelingConstraintsE-RDiagramDesignIssuesWeakEntitySetsExtendedE-RFeaturesDesignoftheBankDatabaseReductiontoRelationSchemasDatabaseDesignUMLChapter7:Entity-RelationshiModelingAdatabasecanbemodeledas:acollectionofentities,relationshipamongentities.Anentity

isanobjectthatexistsandisdistinguishablefromotherobjects.Example:specificperson,company,event,plantEntitieshaveattributesExample:peoplehavenamesandaddresses Anentitysetisasetofentitiesofthesametypethatsharethesameproperties.Example:setofallpersons,companies,trees,holidaysModelingAdatabasecanbemodeEntitySetsinstructorandstudentinstructor_IDinstructor_namestudent-IDstudent_nameEntitySetsinstructorandstuRelationshipSetsArelationshipisanassociationamongseveralentities Example:

44553(Peltier)

advisor 22222(Einstein)

studententity relationshipset instructorentityArelationshipsetisamathematicalrelationamongn

2entities,eachtakenfromentitysets {(e1,e2,…en)|e1E1,e2E2,…,enEn}

where(e1,e2,…,en)isarelationshipExample: (44553,22222)advisorRelationshipSetsArelationshiRelationshipSetadvisorRelationshipSetadvisorRelationshipSets(Cont.)Anattributecanalsobepropertyofarelationshipset.Forinstance,theadvisorrelationshipsetbetweenentitysetsinstructorandstudentmayhavetheattributedatewhichtrackswhenthestudentstartedbeingassociatedwiththeadvisorRelationshipSets(Cont.)AnatDegreeofaRelationshipSetbinaryrelationshipinvolvetwoentitysets(ordegreetwo).mostrelationshipsetsinadatabasesystemarebinary.Relationshipsbetweenmorethantwoentitysetsarerare.Mostrelationshipsarebinary.(Moreonthislater.)Example:studentsworkonresearchprojectsundertheguidanceofaninstructor.relationshipproj_guideisaternaryrelationshipbetweeninstructor,student,andprojectDegreeofaRelationshipSetbiAttributesAnentityisrepresentedbyasetofattributes,thatisdescriptivepropertiespossessedbyallmembersofanentityset.Example:

instructor=(ID,name,street,city,salary)

course=(course_id,title,credits)Domain–thesetofpermittedvaluesforeachattributeAttributetypes:Simpleandcompositeattributes.Single-valuedandmultivaluedattributesExample:multivaluedattribute:phone_numbersDerivedattributesCanbecomputedfromotherattributesExample:age,givendate_of_birthAttributesAnentityisrepreseCompositeAttributesCompositeAttributesMappingCardinalityConstraintsExpressthenumberofentitiestowhichanotherentitycanbeassociatedviaarelationshipset.Mostusefulindescribingbinaryrelationshipsets.Forabinaryrelationshipsetthemappingcardinalitymustbeoneofthefollowingtypes:OnetooneOnetomanyManytooneManytomanyMappingCardinalityConstraintMappingCardinalitiesOnetooneOnetomanyNote:SomeelementsinAandBmaynotbemappedtoanyelementsintheothersetMappingCardinalitiesOnetoonMappingCardinalitiesManytooneManytomanyNote:SomeelementsinAandBmaynotbemappedtoanyelementsintheothersetMappingCardinalitiesManytoKeysAsuperkeyofanentitysetisasetofoneormoreattributeswhosevaluesuniquelydetermineeachentity.AcandidatekeyofanentitysetisaminimalsuperkeyIDiscandidatekeyofinstructorcourse_idiscandidatekeyofcourseAlthoughseveralcandidatekeysmayexist,oneofthecandidatekeysisselectedtobetheprimarykey.KeysAsuperkeyofanentitysKeysforRelationshipSetsThecombinationofprimarykeysoftheparticipatingentitysetsformsasuperkeyofarelationshipset.(s_id,i_id)isthesuperkeyofadvisorNOTE:thismeansapairofentitysetscanhaveatmostonerelationshipinaparticularrelationshipset.

Example:ifwewishtotrackmultiplemeetingdatesbetweenastudentandheradvisor,wecannotassumearelationshipforeachmeeting.WecanuseamultivaluedattributethoughMustconsiderthemappingcardinalityoftherelationshipsetwhendecidingwhatarethecandidatekeysNeedtoconsidersemanticsofrelationshipsetinselectingtheprimarykeyincaseofmorethanonecandidatekeyKeysforRelationshipSetsTheRedundantAttributesSupposewehaveentitysetsinstructor,withattributesincludingdept_namedepartmentandarelationshipinst_deptrelatinginstructoranddepartmentAttributedept_nameinentityinstructorisredundantsincethereisanexplicitrelationshipinst_deptwhichrelatesinstructorstodepartmentsTheattributereplicatesinformationpresentintherelationship,andshouldberemovedfrominstructorBUT:whenconvertingbacktotables,insomecasestheattributegetsreintroduced,aswewillsee.RedundantAttributesSupposeweE-RDiagramsRectanglesrepresententitysets.Diamondsrepresentrelationshipsets.AttributeslistedinsideentityrectangleUnderlineindicatesprimarykeyattributesE-RDiagramsRectanglesrepreseEntityWithComposite,Multivalued,andDerivedAttributesEntityWithComposite,MultivaRelationshipSetswithAttributesRelationshipSetswithAttribuRolesEntitysetsofarelationshipneednotbedistinctEachoccurrenceofanentitysetplaysa“role”intherelationshipThelabels“course_id”and“prereq_id”arecalledroles.RolesEntitysetsofarelationCardinalityConstraintsWeexpresscardinalityconstraintsbydrawingeitheradirectedline(),signifying“one,”oranundirectedline(—),signifying“many,”betweentherelationshipsetandtheentityset.One-to-onerelationship:AstudentisassociatedwithatmostoneinstructorviatherelationshipadvisorAstudentisassociatedwithatmostonedepartmentviastud_deptCardinalityConstraintsWeexprOne-to-OneRelationshipone-to-onerelationshipbetweenaninstructorandastudentaninstructorisassociatedwithatmostonestudentviaadvisor

andastudentisassociatedwithatmostoneinstructorviaadvisorOne-to-OneRelationshipone-to-One-to-ManyRelationshipone-to-manyrelationshipbetweenaninstructorandastudentaninstructorisassociatedwithseveral(including0)studentsviaadvisorastudentisassociatedwithatmostoneinstructorviaadvisor,One-to-ManyRelationshipone-toMany-to-OneRelationshipsInamany-to-onerelationshipbetweenaninstructorandastudent,aninstructor

isassociatedwithatmostonestudentviaadvisor,andastudentisassociatedwithseveral(including0)instructorsviaadvisorMany-to-OneRelationshipsInaMany-to-ManyRelationshipAninstructorisassociatedwithseveral(possibly0)studentsviaadvisorAstudentisassociatedwithseveral(possibly0)instructorsviaadvisor

Many-to-ManyRelationshipAninParticipationofanEntitySetinaRelationshipSetTotalparticipation(indicatedbydoubleline):everyentityintheentitysetparticipatesinatleastonerelationshipintherelationshipsetE.g.,participationofsectioninsec_courseistotaleverysectionmusthaveanassociatedcoursePartialparticipation:someentitiesmaynotparticipateinanyrelationshipintherelationshipsetExample:participationofinstructorinadvisorispartialParticipationofanEntitySetAlternativeNotationforCardinalityLimitsCardinalitylimitscanalsoexpressparticipationconstraintsAlternativeNotationforCardiE-RDiagramwithaTernaryRelationshipE-RDiagramwithaTernaryRelCardinalityConstraintsonTernaryRelationshipWeallowatmostonearrowoutofaternary(orgreaterdegree)relationshiptoindicateacardinalityconstraintE.g.,anarrowfromproj_guidetoinstructorindicateseachstudenthasatmostoneguideforaprojectIfthereismorethanonearrow,therearetwowaysofdefiningthemeaning.E.g.,aternaryrelationshipRbetweenA,BandCwitharrowstoBandCcouldmean1.eachAentityisassociatedwithauniqueentityfromBandCor 2.eachpairofentitiesfrom(A,B)isassociatedwithauniqueCentity,andeachpair(A,C)isassociatedwithauniqueBEachalternativehasbeenusedindifferentformalismsToavoidconfusionweoutlawmorethanonearrowCardinalityConstraintsonTerHowaboutdoinganERdesigninteractivelyontheboard?

Suggestanapplicationtobemodeled..HowaboutdoinganERdesigniWeakEntitySetsAnentitysetthatdoesnothaveaprimarykeyisreferredtoasaweakentityset.TheexistenceofaweakentitysetdependsontheexistenceofaidentifyingentitysetItmustrelatetotheidentifyingentitysetviaatotal,one-to-manyrelationshipsetfromtheidentifyingtotheweakentitysetIdentifyingrelationshipdepictedusingadoublediamondThediscriminator

(orpartialkey)ofaweakentitysetisthesetofattributesthatdistinguishesamongalltheentitiesofaweakentityset.Theprimarykeyofaweakentitysetisformedbytheprimarykeyofthestrongentitysetonwhichtheweakentitysetisexistencedependent,plustheweakentityset’sdiscriminator.WeakEntitySetsAnentitysetWeakEntitySets(Cont.)Weunderlinethediscriminatorofaweakentitysetwithadashedline.Weputtheidentifyingrelationshipofaweakentityinadoublediamond.Primarykeyforsection–(course_id,sec_id,semester,year)WeakEntitySets(Cont.)WeundWeakEntitySets(Cont.)Note:theprimarykeyofthestrongentitysetisnotexplicitlystoredwiththeweakentityset,sinceitisimplicitintheidentifyingrelationship.Ifcourse_idwereexplicitlystored,sectioncouldbemadeastrongentity,butthentherelationshipbetweensectionandcoursewouldbeduplicatedbyanimplicitrelationshipdefinedbytheattributecourse_idcommontocourseandsectionWeakEntitySets(Cont.)Note:E-RDiagramforaUniversityEnterpriseE-RDiagramforaUniversityEReductiontoRelationalSchemasReductiontoRelationalSchemaReductiontoRelationSchemasEntitysetsandrelationshipsetscanbeexpresseduniformlyasrelationschemasthatrepresentthecontentsofthedatabase.AdatabasewhichconformstoanE-Rdiagramcanberepresentedbyacollectionofschemas.Foreachentitysetandrelationshipsetthereisauniqueschemathatisassignedthenameofthecorrespondingentitysetorrelationshipset.Eachschemahasanumberofcolumns(generallycorrespondingtoattributes),whichhaveuniquenames.ReductiontoRelationSchemasERepresentingEntitySetsWithSimpleAttributesAstrongentitysetreducestoaschemawiththesameattributes

student(ID,name,tot_cred)Aweakentitysetbecomesatablethatincludesacolumnfortheprimarykeyoftheidentifyingstrongentityset

section(course_id,sec_id,sem,year)RepresentingEntitySetsWithRepresentingRelationshipSetsAmany-to-manyrelationshipsetisrepresentedasaschemawithattributesfortheprimarykeysofthetwoparticipatingentitysets,andanydescriptiveattributesoftherelationshipset.Example:schemaforrelationshipsetadvisor

advisor=(s_id,i_id)RepresentingRelationshipSetsRedundancyofSchemasMany-to-oneandone-to-manyrelationshipsetsthataretotalonthemany-sidecanberepresentedbyaddinganextraattributetothe“many”side,containingtheprimarykeyofthe“one”sideExample:Insteadofcreatingaschemaforrelationshipsetinst_dept,addanattributedept_nametotheschemaarisingfromentitysetinstructorRedundancyofSchemasMany-to-oRedundancyofSchemas(Cont.)Forone-to-onerelationshipsets,eithersidecanbechosentoactasthe“many”sideThatis,extraattributecanbeaddedtoeitherofthetablescorrespondingtothetwoentitysetsIfparticipationispartialonthe“many”side,replacingaschemabyanextraattributeintheschemacorrespondingtothe“many”sidecouldresultinnullvaluesTheschemacorrespondingtoarelationshipsetlinkingaweakentitysettoitsidentifyingstrongentitysetisredundant.Example:Thesectionschemaalreadycontainstheattributesthatwouldappearinthesec_courseschemaRedundancyofSchemas(Cont.)FCompositeandMultivaluedAttributesCompositeattributesareflattenedoutbycreatingaseparateattributeforeachcomponentattributeExample:givenentitysetinstructorwithcompositeattributenamewithcomponentattributesfirst_nameandlast_nametheschemacorrespondingtotheentitysethastwoattributesname_first_nameandname_last_namePrefixomittedifthereisnoambiguityIgnoringmultivaluedattributes,extendedinstructorschemaisinstructor(ID,

first_name,middle_initial,last_name,

street_number,street_name,

apt_number,city,state,zip_code,

date_of_birth)CompositeandMultivaluedAttrCompositeandMultivaluedAttributesAmultivaluedattributeMofanentityEisrepresentedbyaseparateschemaEMSchemaEMhasattributescorrespondingtotheprimarykeyofEandanattributecorrespondingtomultivaluedattributeMExample:Multivaluedattributephone_numberofinstructorisrepresentedbyaschema:

inst_phone=(

ID,phone_number)

EachvalueofthemultivaluedattributemapstoaseparatetupleoftherelationonschemaEMForexample,aninstructorentitywithprimarykey22222andphonenumbers456-7890and123-4567mapstotwotuples:

(22222,456-7890)and(22222,123-4567)

CompositeandMultivaluedAttrMultivaluedAttributes(Cont.)Specialcase:entitytime_slothasonlyoneattributeotherthantheprimary-keyattribute,andthatattributeismultivaluedOptimization:Don’tcreatetherelationcorrespondingtotheentity,justcreatetheonecorrespondingtothemultivaluedattributetime_slot(time_slot_id,day,start_time,end_time)Caveat:time_slotattributeofsection(fromsec_time_slot)cannotbeaforeignkeyduetothisoptimizationMultivaluedAttributes(Cont.)DesignIssuesUseofentitysetsvs.attributes

Useofphoneasanentityallowsextrainformationaboutphonenumbers(plusmultiplephonenumbers)DesignIssuesUseofentitysetDesignIssuesUseofentitysetsvs.relationshipsets

PossibleguidelineistodesignatearelationshipsettodescribeanactionthatoccursbetweenentitiesDesignIssuesUseofentitysetDesignIssuesBinaryversusn-aryrelationshipsets

Althoughitispossibletoreplaceanynonbinary(n-ary,forn>2)relationshipsetbyanumberofdistinctbinaryrelationshipsets,an-aryrelationshipsetshowsmoreclearlythatseveralentitiesparticipateinasinglerelationship.Placementofrelationshipattributes

e.g.,attributedateasattributeofadvisororasattributeofstudentDesignIssuesBinaryversusn-aBinaryVs.Non-BinaryRelationshipsSomerelationshipsthatappeartobenon-binarymaybebetterrepresentedusingbinaryrelationshipsE.g.,Aternaryrelationshipparents,relatingachildtohis/herfatherandmother,isbestreplacedbytwobinaryrelationships,fatherandmotherUsingtwobinaryrelationshipsallowspartialinformation(e.g.,onlymotherbeingknow)Buttherearesomerelationshipsthatarenaturallynon-binaryExample:proj_guideBinaryVs.Non-BinaryRelationConvertingNon-BinaryRelationshipstoBinaryFormIngeneral,anynon-binaryrelationshipcanberepresentedusingbinaryrelationshipsbycreatinganartificialentityset.ReplaceRbetweenentitysetsA,BandC

byanentitysetE,andthreerelationshipsets: 1.RA,relatingEandA2.RB,relatingEandB

3.RC,relatingEandCCreateaspecialidentifyingattributeforEAddanyattributesofRtoEForeachrelationship(ai,bi,ci)inR,create 1.anewentityei

intheentitysetE2.add(ei,ai)toRA 3.add(ei,bi

)toRB

4.add(ei,ci)toRCConvertingNon-BinaryRelationConvertingNon-BinaryRelationships(Cont.)AlsoneedtotranslateconstraintsTranslatingallconstraintsmaynotbepossibleTheremaybeinstancesinthetranslatedschemathat

cannotcorrespondtoanyinstanceofRExercise:addconstraintstotherelationshipsRA,RBandRCtoensurethatanewlycreatedentitycorrespondstoexactlyoneentityineachofentitysetsA,BandCWecanavoidcreatinganidentifyingattributebymakingEaweakentityset(describedshortly)identifiedbythethreerelationshipsetsConvertingNon-BinaryRelationExtendedERFeaturesExtendedERFeaturesExtendedE-RFeatures:SpecializationTop-downdesignprocess;wedesignatesubgroupingswithinanentitysetthataredistinctivefromotherentitiesintheset.Thesesubgroupingsbecomelower-levelentitysetsthathaveattributesorparticipateinrelationshipsthatdonotapplytothehigher-levelentityset.DepictedbyatrianglecomponentlabeledISA(E.g.,instructor“isa”person).Attributeinheritance–alower-levelentitysetinheritsalltheattributesandrelationshipparticipationofthehigher-levelentitysettowhichitislinked.ExtendedE-RFeatures:SpecialSpecializationExampleSpecializationExampleExtendedERFeatures:GeneralizationAbottom-updesignprocess–combineanumberofentitysetsthatsharethesamefeaturesintoahigher-levelentityset.Specializationandgeneralizationaresimpleinversionsofeachother;theyarerepresentedinanE-Rdiagraminthesameway.Thetermsspecializationandgeneralizationareusedinterchangeably.ExtendedERFeatures:GeneraliSpecializationandGeneralization(Cont.)Canhavemultiplespecializationsofanentitysetbasedondifferentfeatures.E.g.,permanent_employeevs.temporary_employee,inadditiontoinstructorvs.secretaryEachparticularemployeewouldbeamemberofoneofpermanent_employeeortemporary_employee,andalsoamemberofoneofinstructor,secretaryTheISArelationshipalsoreferredtoassuperclass-subclass

relationshipSpecializationandGeneralizatDesignConstraintsonaSpecialization/GeneralizationConstraintonwhichentitiescanbemembersofagivenlower-levelentityset.condition-definedExample:allcustomersover65yearsaremembersofsenior-citizenentityset;senior-citizenISAperson.user-definedConstraintonwhetherornotentitiesmaybelongtomorethanonelower-levelentitysetwithinasinglegeneralization.Disjointanentitycanbelongtoonlyonelower-levelentitysetNotedinE-Rdiagrambyhavingmultiplelower-levelentitysetslinktothesametriangleOverlappinganentitycanbelongtomorethanonelower-levelentitysetDesignConstraintsonaSpeciaDesignConstraintsonaSpecialization/Generalization(Cont.)Completenessconstraint--specifieswhetherornotanentityinthehigher-levelentitysetmustbelongtoatleastoneofthelower-levelentitysetswithinageneralization.total:anentitymustbelongtooneofthelower-levelentitysetspartial:anentityneednotbelongtooneofthelower-levelentitysetsDesignConstraintsonaSpeciaAggregationConsidertheternaryrelationshipproj_guide,whichwesawearlierSupposewewanttorecordevaluationsofastudentbyaguideonaprojectAggregationConsidertheternaAggregation(Cont.)Relationshipsetseval_forandproj_guiderepresentoverlappinginformationEveryeval_forrelationshipcorrespondstoaproj_guiderelationshipHowever,someproj_guiderelationshipsmaynotcorrespondtoanyeval_forrelationshipsSowecan’tdiscardtheproj_guiderelationshipEliminatethisredundancyviaaggregationTreatrelationshipasanabstractentityAllowsrelationshipsbetweenrelationshipsAbstractionofrelationshipintonewentityAggregation(Cont.)RelationshiAggregation(Cont.)Withoutintroducingredundancy,thefollowingdiagramrepresents:AstudentisguidedbyaparticularinstructoronaparticularprojectAstudent,instructor,projectcombinationmayhaveanassociatedevaluationAggregation(Cont.)WithoutintRepresentingSpecializationviaSchemasMethod1:Formaschemaforthehigher-levelentityFormaschemaforeachlower-levelentityset,includeprimarykeyofhigher-levelentitysetandlocalattributes

schema

attributes

person ID,name,street,city

student ID,tot_cred

employee ID,salaryDrawback:gettinginformationabout,anemployeerequiresaccessingtworelations,theonecorrespondingtothelow-levelschemaandtheonecorrespondingtothehigh-levelschemaRepresentingSpecializationviRepresentingSpecializationasSchemas(Cont.)Method2:Formaschemaforeachentitysetwithalllocalandinheritedattributes

schema

attributes

person ID,name,street,city

student ID,name,street,city,tot_cred

employee ID,name,street,city,salaryIfspecializationistotal,theschemaforthegeneralizedentityset(person)notrequiredtostoreinformationCanbedefinedasa“view”relationcontainingunionofspecializationrelationsButexplicitschemamaystillbeneededforforeignkeyconstraintsDrawback:name,streetandcitymaybestoredredundantlyforpeoplewhoarebothstudentsandemployeesRepresentingSpecializationasSchemasCorrespondingtoAggregationTorepresentaggregation,createaschemacontainingprimarykeyoftheaggregatedrelationship,theprimarykeyoftheassociatedentitysetanydescriptiveattributesSchemasCorrespondingtoAggreSchemasCorrespondingtoAggregation(Cont.)Forexample,torepresentaggregationmanagesbetweenrelationshipworks_onandentitysetmanager,createaschema

eval_for(s_ID,project_id,i_ID,evaluation_id)Schemaproj_guideisredundantprovidedwearewillingtostorenullvaluesforattributemanager_nameinrelationonschemamanagesSchemasCorrespondingtoAggreE-RDesignDecisionsTheuseofanattributeorentitysettorepresentanobject.Whetherareal-worldconceptisbestexpressedbyanentitysetorarelationshipset.Theuseofaternaryrelationshipversusapairofbinaryrelationships.Theuseofastrongorweakentityset.Theuseofspecialization/generalization–contributestomodularityinthedesign.Theuseofaggregation–cantreattheaggregateentitysetasasingleunitwithoutconcernforthedetailsofitsinternalstructure.E-RDesignDecisionsTheuseofHowaboutdoinganotherERdesigninteractivelyontheboard?.HowaboutdoinganotherERdesSummaryofSymbolsUsedinE-RNotationSummaryofSymbolsUsedinE-RSymbolsUsedinE-RNotation(Cont.)SymbolsUsedinE-RNotation(AlternativeERNotations

Chen,IDE1FX,…AlternativeERNotationsChen,AlternativeERNotationsChenIDE1FX(Crowsfeetnotation)AlternativeERNotationsUML UML:UnifiedModelingLanguageUMLhasmanycomponentstographicallymodeldifferentaspectsofanentiresoftwaresystemUMLClassDiagramscorrespondtoE-RDiagram,butseveraldifferences.UML UML:UnifiedModelingLangERvs.UMLClassDiagrams*NotereversalofpositionincardinalityconstraintdepictionERvs.UMLClassDiagrams*NoteERvs.UMLClassDiagramsERDiagramNotationEquivalentinUML*Generalizationcanusemergedorseparatearrowsindependentofdisjoint/overlappingERvs.UMLClassDiagramsERDiUMLClassDiagrams(Cont.)BinaryrelationshipsetsarerepresentedinUMLbyjustdrawingalineconnectingtheentitysets.Therelationshipsetnameiswrittenadjacenttotheline.Theroleplayedbyanentitysetinarelationshipsetmayalsobespecifiedbywritingtherolenameontheline,adjacenttotheentityset.Therelationshipsetnamemayalternativelybewritteninabox,alongwithattributesoftherelationshipset,andtheboxisconnected,usingadottedline,tothelinedepictingtherelationshipset.UMLClassDiagrams(Cont.)BinaEndofChapter7

.EndofChapter7

.Figure7.01Figure7.01Figure7.02Figure7.02Figure7.03Figure7.03Figure7.04Figure7.04Figure7.05Figure7.05Figure7.06Figure7.06Figure7.07Figure7.07Figure7.08Figure7.08Figure7.09Figure7.09Figure7.10Figure7.10Figure7.11Figure7.11Figure7.12Figure7.12Figure7.13Figure7.13Figure7.14Figure7.14Figure7.15Figure7.15Figure7.17Figure7.17Figure7.18Figure7.18Figure7.19Figure7.19Figure7.20Figure7.20Figure7.21Figure7.21Figure7.22Figure7.22Figure7.23Figure7.23Figure7.24Figure7.24Figure7.25Figure7.25Figure7.26Figure7.26Figure7.27Figure7.27Figure7.28Figure7.28Figure7.29Figure7.29Chapter7:Entity-RelationshipModel.Chapter7:Entity-RelationshiChapter7:Entity-RelationshipModelDesignProcessModelingConstraintsE-RDiagramDesignIssuesWeakEntitySetsExtendedE-RFeaturesDesignoftheBankDatabaseReductiontoRelationSchemasDatabaseDesignUMLChapter7:Entity-RelationshiModelingAdatabasecanbemodeledas:acollectionofentities,relationshipamongentities.Anentity

isanobjectthatexistsandisdistinguishablefromotherobjects.Example:specificperson,company,event,plantEntitieshaveattributesExample:peoplehavenamesandaddresses Anentitysetisasetofentitiesofthesametypethatsharethesameproperties.Example:setofallpersons,companies,trees,holidaysModelingAdatabasecanbemodeEntitySetsinstructorandstudentinstructor_IDinstructor_namestudent-IDstudent_nameEntitySetsinstructorandstuRelationshipSetsArelationshipisanassociationamongseveralentities Example:

44553(Peltier)

advisor 22222(Einstein)

studententity relationshipset instructorentityArelationshipsetisamathematicalrelationamongn

2entities,eachtakenfromentitysets {(e1,e2,…en)|e1E1,e2E2,…,enEn}

where(e1,e2,…,en)isarelationshipExample: (44553,22222)advisorRelationshipSetsArelationshiRelations

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论