Advantages and disadvantages of er model in DBMS. Types of database models ..

1,774 views 12 slides Jun 14, 2020
Slide 1
Slide 1 of 12
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12

About This Presentation

Types of database models
Hierarchical database model.
Relational model.
Network model.
Object-oriented database model.
Entity-relationship model.
Document model.
Entity-attribute-value model.
Star schema.


Slide Content

AdvantagesandDisadvantagesofERModel
inDBMS
ERmodelisalogicalrepresentationofanenterprisedata.ERmodelisadiagrammatic
representationoflogicalstructureofdatabase.
ERmodeldescribesrelationshipamongentitiesandattributes.
ERdiagramisfirstlydevelopedbyPeterChenin1976.
AdvantagesofERModel
Conceptuallyitisverysimple:ERmodelisverysimplebecauseifweknow
relationshipbetweenentitiesandattributes,thenwecaneasilydrawanERdiagram.
Bettervisualrepresentation:ERmodelisadiagrammaticrepresentationofany
logicalstructureofdatabase.ByseeingERdiagram,wecaneasilyunderstand
relationshipamongentitiesandrelationship.
Effectivecommunicationtool:Itisaneffectivecommunicationtoolfordatabase
designer.
Highlyintegratedwithrelationalmodel:ERmodelcanbeeasilyconvertedinto
relationalmodelbysimplyconvertingERmodelintotables.
Easyconversiontoanydatamodel:ERmodelcanbeeasilyconvertedintoanother
datamodellikehierarchicaldatamodel,networkdatamodelandsoon.
DisadvantagesofERModel
Limitedconstraintsandspecification
Lossofinformationcontent:SomeinformationbelostorhiddeninERmodel
Limitedrelationshiprepresentation:ERmodelrepresentslimitedrelationshipas
comparedtoanotherdatamodelslikerelationalmodeletc.

Norepresentationofdatamanipulation:Itisdifficulttoshowdatamanipulationin
ERmodel.
Popularforhighleveldesign:ERmodelisverypopularfordesigninghighlevel
design
Adatabasemodelisatypeofdatamodelthatdeterminesthelogicalstructureofadatabaseand
fundamentallydeterminesinwhichmannerdatacanbestored,organizedandmanipulated.The
mostpopularexampleofadatabasemodelistherelationalmodel,whichusesatable-based
format.
Typesofdatabasemodels
Hierarchicaldatabasemodel.
Relationalmodel.
Networkmodel.
Object-orienteddatabasemodel.
Entity-relationshipmodel.
Documentmodel.
Entity-attribute-valuemodel.
Starschema
Anentityisareal-worldobjectthatarerepresentedindatabase.Itcanbeany
object,place,personorclass.Dataarestoredaboutsuchentities.
Indbmswestoredataintheformoftablecontaininginformationaboutentitytype
likestudents,teachers,employeesetc.Inaschooldatabase,atablecontaining
informationaboutallthestudents,studentshereareentitieslikeJoseph,Allenin
belowfigure
Anentitycanbeareal-worldobject,eitheranimateorinanimate,thatcanbeeasily
identifiable.Forexample,inaschooldatabase,students,teachers,classes,andcourses
offeredcanbeconsideredasentities.Alltheseentitieshavesomeattributesorproperties
thatgivethemtheiridentity

Anentitysetisacollectionofsimilartypesofentities.Anentitysetmaycontainentitieswith
attributesharingsimilarvalues.Forexample,aStudentssetmaycontainallthestudentsof
aschool;likewiseaTeacherssetmaycontainalltheteachersofaschoolfromallfaculties.
Entitysetsneednotbedisjoint
LetusnowlearnhowtheERModelisrepresentedbymeansofanERdiagram.Any
object,forexample,entities,attributesofanentity,relationshipsets,andattributesof
relationshipsets,canberepresentedwiththehelpofanERdiagram.
Entity
Entitiesarerepresentedbymeansofrectangles.Rectanglesarenamedwiththeentity
settheyrepresent.
Attributes
Attributesarethepropertiesofentities.Attributesarerepresentedbymeansofellipses.
Everyellipserepresentsoneattributeandisdirectlyconnectedtoitsentity(rectangle).

Iftheattributesarecomposite,theyarefurtherdividedinatreelikestructure.Every
nodeisthenconnectedtoitsattribute.Thatis,compositeattributesarerepresentedby
ellipsesthatareconnectedwithanellipse.
Multivaluedattributesaredepictedbydoubleellipse.

Derivedattributesaredepictedbydashedellipse.
Relationship
Relationshipsarerepresentedbydiamond-shapedbox.Nameoftherelationshipis
writteninsidethediamond-box.Alltheentities(rectangles)participatinginarelationship,
areconnectedtoitbyaline.

BinaryRelationshipandCardinality
Arelationshipwheretwoentitiesareparticipatingiscalledabinaryrelationship.
Cardinalityisthenumberofinstanceofanentityfromarelationthatcanbeassociated
withtherelation.
One-to-one−Whenonlyoneinstanceofanentityisassociatedwiththe
relationship,itismarkedas'1:1'.Thefollowingimagereflectsthatonlyone
instanceofeachentityshouldbeassociatedwiththerelationship.Itdepictsone-
to-onerelationship.
One-to-many−Whenmorethanoneinstanceofanentityisassociatedwitha
relationship,itismarkedas'1:N'.Thefollowingimagereflectsthatonlyone
instanceofentityontheleftandmorethanoneinstanceofanentityontheright
canbeassociatedwiththerelationship.Itdepictsone-to-manyrelationship.
Many-to-one−Whenmorethanoneinstanceofentityisassociatedwiththe
relationship,itismarkedas'N:1'.Thefollowingimagereflectsthatmorethanone
instanceofanentityontheleftandonlyoneinstanceofanentityontherightcan
beassociatedwiththerelationship.Itdepictsmany-to-onerelationship.

Many-to-many−Thefollowingimagereflectsthatmorethanoneinstanceofan
entityontheleftandmorethanoneinstanceofanentityontherightcanbe
associatedwiththerelationship.Itdepictsmany-to-manyrelationship.
ParticipationConstraints
TotalParticipation−Eachentityisinvolvedintherelationship.Total
participationisrepresentedbydoublelines.
Partialparticipation−Notallentitiesareinvolvedintherelationship.Partial
participationisrepresentedbysinglelines.

EntitySetinDBMS-
Beforeyougothroughthisarticle,makesurethatyouhavegonethroughthepreviousarticleon
IntroductiontoERDiagrams.
Anentitysetisasetofsametypeofentities.
Anentityreferstoanyobjecthaving-
Eitheraphysicalexistencesuchasaparticularperson,office,houseorcar.
Oraconceptualexistencesuchasaschool,auniversity,acompanyorajob.
InERdiagram,
Attributesareassociatedwithanentityset.
Attributesdescribethepropertiesofentitiesintheentityset.
Basedonthevaluesofcertainattributes,anentitycanbeidentifieduniquely.
TypesofEntitySets-
Anentitysetmaybeofthefollowingtwotypes-
1.Strongentityset
2.Weakentityset
1.StrongEntitySet-

Astrongentitysetisanentitysetthatcontainssufficientattributestouniquelyidentifyallits
entities.
Inotherwords,aprimarykeyexistsforastrongentityset.
Primarykeyofastrongentitysetisrepresentedbyunderliningit.
SymbolsUsed-
Asinglerectangleisusedforrepresentingastrongentityset.
Adiamondsymbolisusedforrepresentingtherelationshipthatexistsbetweentwostrongentity
sets.
Asinglelineisusedforrepresentingtheconnectionofthestrongentitysetwiththerelationship
set.
Adoublelineisusedforrepresentingthetotalparticipationofanentitysetwiththerelationship
set.
Totalparticipationmayormaynotexistintherelationship.
Example-
ConsiderthefollowingERdiagram-
InthisERdiagram,
Twostrongentitysets“Student”and“Course”arerelatedtoeachother.
StudentIDandStudentnamearetheattributesofentityset“Student”.
StudentIDistheprimarykeyusingwhichanystudentcanbeidentifieduniquely.
CourseIDandCoursenamearetheattributesofentityset“Course”.
CourseIDistheprimarykeyusingwhichanycoursecanbeidentifieduniquely.
DoublelinebetweenStudentandrelationshipsetsignifiestotalparticipation.
Itsuggeststhateachstudentmustbeenrolledinatleastonecourse.

SinglelinebetweenCourseandrelationshipsetsignifiespartialparticipation.
Itsuggeststhattheremightexistsomecoursesforwhichnoenrollmentsaremade.
2.WeakEntitySet-
Aweakentitysetisanentitysetthatdoesnotcontainsufficientattributestouniquelyidentifyits
entities.
Inotherwords,aprimarykeydoesnotexistforaweakentityset.
However,itcontainsapartialkeycalledasadiscriminator.
Discriminatorcanidentifyagroupofentitiesfromtheentityset.
Discriminatorisrepresentedbyunderliningwithadashedline.
NOTE-
Thecombinationofdiscriminatorandprimarykeyofthestrongentitysetmakesitpossibleto
uniquelyidentifyallentitiesoftheweakentityset.
Thus,thiscombinationservesasaprimarykeyfortheweakentityset.
Clearly,thisprimarykeyisnotformedbytheweakentitysetcompletely.
SymbolsUsed-
Adoublerectangleisusedforrepresentingaweakentityset.
Adoublediamondsymbolisusedforrepresentingtherelationshipthatexistsbetweenthestrong
andweakentitysetsandthisrelationshipisknownasidentifyingrelationship.
Adoublelineisusedforrepresentingtheconnectionoftheweakentitysetwiththerelationship
set.
Totalparticipationalwaysexistsintheidentifyingrelationship.
Example-

ConsiderthefollowingERdiagram-
InthisERdiagram,
Onestrongentityset“Building”andoneweakentityset“Apartment”arerelatedtoeachother.
Strongentityset“Building”hasbuildingnumberasitsprimarykey.
Doornumberisthediscriminatoroftheweakentityset“Apartment”.
Thisisbecausedoornumberalonecannotidentifyanapartmentuniquelyastheremaybe
severalotherbuildingshavingthesamedoornumber.
DoublelinebetweenApartmentandrelationshipsetsignifiestotalparticipation.
Itsuggeststhateachapartmentmustbepresentinatleastonebuilding.
SinglelinebetweenBuildingandrelationshipsetsignifiespartialparticipation.
Itsuggeststhattheremightexistsomebuildingswhichhasnoapartment.
Touniquelyidentifyanyapartment,
First,buildingnumberisrequiredtoidentifytheparticularbuilding.
Secondly,doornumberoftheapartmentisrequiredtouniquelyidentifytheapartment.
Thus,
PrimarykeyofApartment
=PrimarykeyofBuilding+Itsowndiscriminator
=Buildingnumber+Doornumber
DifferencesbetweenStrongentitysetandWeakentityset-

Strongentityset Weakentityset
Asinglerectangleisusedforthe
representationofastrongentityset.
Adoublerectangleisusedforthe
representationofaweakentityset.
Itcontainssufficientattributestoformits
primarykey.
Itdoesnotcontainsufficientattributestoform
itsprimarykey.
Adiamondsymbolisusedforthe
representationoftherelationshipthatexists
betweenthetwostrongentitysets.
Adoublediamondsymbolisusedforthe
representationoftheidentifyingrelationship
thatexistsbetweenthestrongandweakentity
set.
Asinglelineisusedfortherepresentationof
theconnectionbetweenthestrongentityset
andtherelationship.
Adoublelineisusedfortherepresentationof
theconnectionbetweentheweakentitysetand
therelationshipset.
Totalparticipationmayormaynotexistinthe
relationship.
Totalparticipationalwaysexistsinthe
identifyingrelationship.