You are on page 1of 19

UNI

T1

I
ntr
oduct
ion:Dat
abaseSy
stem Appl
i
cat
ions,dat
abaseSy
stem VSf
il
eSy
stem,Adv
ant
agesofa
DBMSViewofData,Dat
aAbst
ract
ion,
inst
ancesandSchemas,
dat
aModel
s,t
heERModel
,Rel
ati
onal
Model
,OtherModel
s

I
ntr
oduct
ionofDat
abaseManagementSy
stem
Int oday’scompetit
ive envi
ronmentdata and i
tseffi
cientmanagementi sthe cri
ti
calbusi
ness
objectiveofanorgani
zation.I
tisadif
fi
cul
tt asktogettherighti
nfor
mationatt
herightti
metotake
ri
ghtdeci si
on.Theref
oret hesuccessofanor gani
zati
oni snow mor ethanev
erdependentonits
abil
itytoacquireaccurate,rel
iabl
eandtimel ydat
aabouti t
sbusinessoroperat
ionforeff
ecti
ve
decision-maki
ngprocess.
Databasesy
stem i
satoolthatsi
mpl
i
fiest
heabov
etasksofmanagi
ngt
hedat
aandext
ract
ingusef
ul
i
nformati
oninati
melyfashi
on.
I
nf actdatabaseanddat
abasemanagementsyst
em (DBMS)hav esomeessentialf
ormanagi
ngour
business,gover
nment
s,banks,el
ect
roni
ccommerce,engi
neer
ing,l
aw,educat
ion,medi
calandev
ery
otherkindofhumanendeavor
.

Data 
maybedefinedasaknownf actt
hatcanber ecor
dedandthathav
eimpl
i
citmeani
ng.For
example,
names,
telephonenumber
sandaddr
essesofthepeopl
e.

Database 
i
sacollect
ionofrel
ateddat
aordat
abasei
sani
ntegr
atedcol
l
ect
ionofdat
arecor
ds,f
il
es
andotherdat
abaseobject
s.

Database ManagementSystem  i
sacol l
ecti
onofpr
ogramsthatenabl
esuser
sto creat
eand
maintai
nadatabase.Thepr
imarygoalofaDBMSistoprovi
deawayt
ostoreandr
etr
iev
edatabase
i
nformati
onthati
sbothconv
enientandef
fi
cient
.

TheDBMSi shenceageneral
-pur
posesoftwaresyst
em t
hatfaci
li
tatest
heprocessesofdef
ini
ng,
const
ruct
ing,mani
pul
ati
ngandsharingdat
abasesamongvari
oususersandappl
i
cati
on.
 Def
ini
ng:
 speci
fyi
ngt
hedat
aty
pes,
str
uct
ures,
andconst
rai
ntsf
ort
hedat
a.

 Const
ruct
ing:i
ncl
udesst
ori
ngt
hedat
ait
sel
fonsomest
oragemedi
um.

 Manipul
ating:i
ncl
udesquer
yingthedatabasetor
etr
iev
especi
fi
cdat
a,updat
ingt
hedat
ato
r
efl
ectchangesi
ndata,
gener
atingrepor
tsfr
om dat
a.

 Shar
ing:
 al
l
owsmul
ti
pleuser
stoaccesst
hedat
abaseconcur
rent
ly.

Appl
i
cat
ionsofDBMS
Dat
abasesar
ewi
del
yused.Thesomeoft
her
epr
esent
ati
veappl
i
cat
ionsar
e:
1. Banki
ng:
 forcust
omeri
nfor
mat
ion,
account
sandl
oansandbanki
ngt
ransact
ions.

2.Uni
ver
sit
ies:
 forst
udentr
egi
str
ati
onsandgr
ades.

3.Onli
neshoppi
ng:
 Ev
ery
onewant
stoshopf
rom home.Every
daynewproduct
sar
eaddedand
sol
donl
ywitht
hehel
pofDBMS.Pur
chasei
nfor
mation,
invoi
cebi
ll
sandpayment
,al
loft
hese
1
ar
edonewi
tht
hehel
pofDBMS.

4.Ai
rli
nes:
 forr
eser
vat
ionsandschedul
einf
ormat
ion.
5. Cr
edi
tcar
dtr
ansact
ions:
 forpur
chasesoncr
edi
tcar
dsandgener
ati
onofmont
hly
st
atement
s.
6. Li
brar
yManagementSyst
em:
 mai
ntai
nal
lthei
nfor
mat
ionr
elat
etobooki
ssuedat
es,
name
oft
hebook,
aut
horandav
ail
abi
l
ityoft
hebook.
7. Tel
ecommuni
cat
ions:
 for keepi
ng r
ecor
ds of cal
l made, gener
ati
ng mont
hly bi
l
ls,
mai
ntai
ningbal
ancesonpr
epai
dcal
l
ingcar
ds.
8. Sal
es:
 forcust
omer
,pr
oductandpur
chasei
nfor
mat
ion.
9. Fi
nance:
 
forst
ori
ngi
nfor
mat
ionabouthol
dings,
sal
es,
andpur
chasesoff
inanci
ali
nst
rument
s
suchasst
ocksandbonds.
10.Manuf
act
uri
ng:
 formanagementofsuppl
ychai
nandf
ort
racki
ngpr
oduct
ionofi
temsi
n
f
act
ori
es,
inv
ent
ori
esofi
temsandor
der
sfori
tems.
11.HumanResour
ce:
 
fori
nfor
mat
ionaboutempl
oyees,
sal
ari
es,
pay
rol
ltaxesandbenef
it
s.

Dat
abaseSy
stem v
ersusFi
l
eSy
stem
DBMS Fi
lePr
ocessi
ngSy
stem
Mi
nimal
dat
aredundancypr
obl
em i
nDBMS Dat
aRedundancypr
obl
em exi
ts
Dat
aInconsi
stencydoesnotex
ist Dat
aInconsi
stencyexi
sther
e
Accessi
ngdat
abasei
seasi
er Accessi
ngi
scompar
ati
vel
ydi
ff
icul
t
Thepr
obl
em ofdat
ai sol
ati
oni
snotf
oundi
n Dat
aisscatt
eredi
nvar
iousfi
l
esandfil
esmaybeof
database di
ff
erentf
ormat,
sodatai
solat
ionpr
oblem exi
sts
Tr
ansact
ionsl
i
kei
nsert
,del
ete,
view,
updat
ing,
etc
I
nfi
l
esy
stem,
transact
ionsar
enotpossi
ble
ar
epossi
blei
ndatabase
Concur
rentaccessandrecover
yispossi
blei
n
Concur
rentaccessandr
ecov
eryi
snotpossi
ble
database
Secur
it
yofdat
a Secur
it
yofdat
aisnotgood
Adatabasemanager(admi
nist
rator)stor
esthe Af
il
emanagerisusedt
ostor
eallrel
ati
onshi
psi
n
r
elati
onshi
pinfor
m ofst
ructuraltabl
es dir
ectori
esi
nfi
l
esy st
ems.

Adv
ant
agesofDBMS
1.Cont
rol
l
ingofRedundancy
:
Datar edundancyr ef
erst othedupli
cat i
onofdat a( i
.est
ori
ngsamedat amultipl
etimes)
.I na
databasesy st
em,byhav i
ngacentral
izeddat abaseandcent
ral
izedcont
rolofdatabytheDBAt he
unnecessarydupli
cationofdatai
sav oided.Ital
soeli
minat
estheextr
atimeforprocessi
ngthelar
ge
vol
umeofdat a.I
tresult
sinsavi
ngthest oragespace.

2.I
mpr
ovedDat
aShar
ing:
2
DBMSal
l
owsausert
oshar
ethedat
ainanynumberofappl
i
cat
ionpr
ogr
ams.

3.Dat
aInt
egr
ity:
Int
egr
it
ymeanst hatthedataint
hedatabaseisaccur
ate.Centr
ali
zedcont
rolofthedatahelpsin
permi
tt
ingtheadmini
str
atort
odefi
neintegr
it
yconst
rai
ntstothedatai
nthedatabase.Forexample:
i
ncustomerdatabasewecanenforceanint
egri
tyt
hati
tmustacceptthecustomeronlyfr
om Noida
andMeerutci
ty.

4.Secur
ity:
Havi
ngcompl et
eauthori
tyovert
heoper
ati
onaldata,
enablestheDBAi
nensur
ingthatt
heonlymean
ofaccesstothedatabaseisthr
oughpr
operchannels.TheDBAcandefi
neauthori
zat
ioncheckst
o
becarr
iedoutwheneveraccesst
osensi
ti
vedataisattempted.

5.Dat
aConsi
stency:
Byeli
minati
ngdataredundancy,wegreatl
yr educetheopportunit
iesfori
nconsi
stency.Forexample:
i
sacust omeraddressisstor
edonlyonce,wecannothav edisagreementonthestoredv al
ues.Al
so
updat
ingdatavaluesisgreatl
ysimpl
ifiedwheneachv alueisstoredinoneplaceonl y.Fi
nall
y,we
avoi
dthewastedstoragethatr
esul
tsfrom redundantdatastorage.

6.Ef
fici
entDat
aAccess:
I
nadatabasesyst
em,thedat
aismanagedbytheDBMSandal
laccesst
othedat
aist
hrought
he
DBMSprovi
dingakeyt
oeff
ect
ivedat
apr
ocessi
ng

7.Enf
orcement
sofSt
andar
ds:
Wit
hthecentr
ali
zedofdata,DBAcanestabl
ishandenf
orcet
hedat
ast
andar
dswhi
chmayi
ncl
ude
t
henamingconvent
ions,
dataqual
i
tyst
andardsetc.

8.Dat
aIndependence:
In a dat
abasesyst
em,thedatabasemanagementsystem provi
destheinterfacebet ween the
appli
cati
onprogr
amsandthedata.Whenchangesaremadet othedatarepresentat
ion,themet a
dataobtai
nedbytheDBMSischangedbutt
heDBMSi sconti
nuestoprov
idethedat atoapplicati
on
progr
am inthepr
evi
ousl
yusedway.TheDBMshandlest
hetaskoft r
ansf
ormationofdat awher ev
er
necessary
.

9.ReducedAppl
icat
ionDevel
opmentandMai
ntenanceTi
me:
DBMSsupport
smanyi
mpor
tantf
uncti
onsthatar
ecommont omanyapplicat
ions,accessi
ngdat
a
st
oredi
ntheDBMS,
whi
chf
acil
i
tat
esthequi
ckdevel
opmentofappl
i
cat
ion.

Di
sadv
ant
agesofDBMS
1. I
ncr
easedCompl
exi
ty
2. Requi
rementofNewandSpeci
ali
zedManpower
3. Lar
geSi
zeofDBMS

Dat
aAbst
ract
ion

3
Forthesy
stem tobeusabl
e,i
tmustretr
ievedataef
fi
cient
ly.Theneedf oreff
ici
encyhasleddesi
gner
s
tousecomplexdatast
ruct
urest
orepresentdatai
nthedat abase.Devel
opershidethecomplexi
ty
fr
om user
sthroughsever
all
evel
sofabstract
iontosi
mpl i
fyusersinter
acti
onswi t
hthesystem.

Phy
sical
Lev
el:
 
Thel
owestl
evel
ofabst
ract
iondescr
ibes 
how 
thedat
aar
eact
ual
l
yst
ored.

Logi
calLevel

Thenext
-hi
gherl
evelofabstr
acti
ondescr
ibes 
what
 dat
aar
est
oredi
nthedat
abase,
andwhatrel
ati
onshi
psexi
stamongthosedata.

ViewLevel
:
 Thehighestlevelofabstr
acti
ondescri
besonl
ypartoft
heenti
redat
abase.Thev
iewl
evel
ofabst
ract
ionexist
stosi mpli
fythei
rint
eract
ionwi
ththesyst
em.Thesyst
em mayprovi
demanyvi
ew
fort
hesamedat abase.

Example:Let
’ssaywearestori
ngcustomerinf
ormati
oninacustomertabl
e.At 
physi
call
evel
 
these
recor
dscanbedescr i
bedasblocksofstor
age( by
tes,gi
gaby
tes,t
eraby
teset
c.)inmemory.These
detai
l
sareoftenhi
ddenfr
om theprogr
ammers.

Atthe 
logi
callevel
 t
heserecordscanbedescri
bedasfi
eldsandat t
ri
butesal
ongwi
ththei
rdataty
pes,
thei
rrel
ationshi
pamongeachot hercanbelogi
cal
lyi
mpl emented.Theprogr
ammersgeneral
lywor
k
atthi
slevelbecausetheyareawareofsuchthi
ngsaboutdatabasesyst
ems.

At v
iewlevel
,userj
usti
nter
actwit
hsyst
em wi
ththehel
pofGUIandenterthedetai
l
satthescr
een,
theyarenotawareofhowt hedat
aisstor
edandwhatdat
aisst
ored;suchdetai
l
sar ehi
ddenf
rom
them.

Dat
aIndependence
DataIndependencecanbedefinedasthecapaci
tyt
ochanget heschemaatonel
evelofadat
abase
syst
em withouthavi
ngtochangetheschemaatthenexthi
gherlev
el.
DataIndependenceoccur
sbecausewhent heschemaischangedatsomelev
el,t
heschemaatt
he
nexthi
gherlevelr
emainsunchanged;
onl
ythemappingbet
weenthetwolev
elsi
schanged.
Ther
ear
etwot
ypesofdat
aindependence:

1.Logi
cal
Dat
aIndependence

4
2.Phy
sical
Dat
aIndependence

Logi
cal
Dat
aIndependence
Iti
st hecapaci
tytochanget
heconcept
ualschemawi
thouthav
ingt
ochangeext
ernalschemasor
appl
icati
onprogr
am.
Wemaychanget
heconcept
ualschemat
oex
pandt
hedat
abase,t
ochangeconst
rai
nts,ort
oreduce
t
hedat
abase.

Phy
sical
Dat
aIndependence
I
tisthecapacit
ytochanget
heinter
nalschemawithouthavi
ngt
ochanget
heconcept
ualschema.
Hence,
theexter
nal
schemaneedsnottobechangedaswell.
Changest
othei
nter
nal
schemamaybeneededbecausesomephy
sical
fil
eshadt
ober
eor
gani
zed.

Dat
abaseSchema
Adatabaseschemaistheskel
etonst
ruct
uret
hatrepr
esent
sthelogi
cal
viewoft
heent i
redat
abase.I
t
def
ineshowthedataisorgani
zedandhowtherel
ati
onsamongthem ar
eassoci
ated.
Adatabaseschemadoesnotcont
ainanydat
aori
nfor
mat
ion.I
tfor
mul
atesal
ltheconst
rai
ntst
hat
ar
etobeappliedont
hedat
a.
Adat
abaseschemacanbedi
vi
dedbr
oadl
yint
otwocat
egor
ies:
1. Physi
calDatabaseSchema: Thisschemaper
tai
nstotheact
ualstor
ageofdat
aandi
tsform
ofst
oragel
i
kef i
l
es,i
ndi
ces,
etc.Itdefi
neshowthedat
awill
bestoredi
nasecondar
yst
orage.

2. Logi
calDatabaseSchema: Thi
sschemadef i
nesal
lthelogi
calconstrai
ntst
hatneedt
obe
appl
i
edonthedatast
ored.I
tdefi
nest
ables,
views,
andint
egrit
yconstr
aints.

Dat
abaseI
nst
ance
Thedat
ainthedat
abaseatapar t
icul
armomentintimeiscall
eda  dat
abasest
ateorsnapshot
.Iti
s
al
socal
ledt
hecurr
entsetofoccur
rencesor
 i
nst
ances i
nthedatabase.
I
nagi
vendat
abasest
ate,
eachschemaconst
ructhasi
tsowncur
rentsetofi
nst
ances.
TheDBMSstorest
hedescr
ipt
ionsoftheschemaconstr
uctsandconst
rai
ntsalsocal
ledmet
adat
ain
theDMBScat
alogsot
hatDBMSsof t
warecanref
ertotheschemawheneveritneedst
o.

Ty
pesofDat
aModel
s
DBMSDat abaseModel s
ADatabasemodeldef inesthelogicaldesi
gnandstruct
ureofadatabaseanddef
ineshowdata
wil
lbestored,accessedandupdat edinadatabasemanagementsy st
em.Whil
et he 
Rel
ati
onal
Model 
i
sthemostwi delyuseddatabasemodel,ther
eareothermodelstoo:

 Hi
erar
chi
cal
Model
 Net
wor
kModel
 Ent
it
y-r
elat
ionshi
pModel
 Rel
ati
onal
Model

5
Dat
aModelsar
ethecol
l
ect
ionofconceptt
odescr
ibet
hest
ruct
ureofdat
abase.Thet
ypesofdat
a
model
sar
e:

Hi
erar
chi
cal
Dat
abaseModel
Thi
sistheoldestf
orm ofdat
abase.Thi
sdatamodelor
gani
zest
hedatai
nthetr
eest
ruct
urei.
e.each
chi
ldnodecanhaveonlyoneparentnodeandatt
hetopoft
hestr
uct
ure,
ther
eisasi
ngl
eparenthesi
s
node.
Inthi
smodeladat
abaserecor
disat r
eethatconsi
stsofoneormoregroupi
ngsoffiel
dscall
ed
segment
s,whi
chmakeupt
heindi
vi
dual
nodesofthetr
ee.Thi
smodel
use 
one-t
o-manyr
elati
onshi
p
Advantage:
 Dat
aaccessi
squi
tepr
edi
ctabl
einst
ruct
ureandr
etr
iev
alandupdat
escanbehi
ghl
y
opt
imizedbyaDBMS.
Disadvant
age:
 Thel
i
nki
sper
manent
lyest
abl
i
shedandcannotbemodi
fi
edwhi
chmakest
hismodel
r
igid.

Net
wor
kDat
abaseModel
TheNetworkdatabasemodelwasdev el
opedasanalternati
vet othehi
erar
chi
caldatabase.This
modelexpandsonthehier
archi
calmodelbypr
ovi
dingmulti
plepathsamongsegmentsi.
e.mor et
han
oneparent-
chi
ldrel
ati
onship.Hencethismodelall
ows one-to-
one,one-to-
manyand many- to-
manyrelati
onships

Suppor
ti
ngmulti
plepat
hsi
nthedatastr
uctur
eel
i
minat
essomeoft
hedr
awbacksoft
hehi
erar
chi
cal
model;
thenet
workmodeli
snotver
ypracti
cal
.
Di
sadvant
age:
 I
tcanbequi
tecompl
i
cat
edt
omai
ntai
nal
lthel
i
nks.

6
Rel
ati
onalDat
abaseModel
Thekeydif
fer
encesbet
weenpr
evi
ousdat
abasemodel
sandr
elat
ionaldat
abasemodeli
sint
ermsof
fl
exi
bil
i
ty.
Ar elat
ionaldatabaser epresentsalldataint hedatabaseassimpletwo-di
mensionalt
ablescal
l
ed
r
elations.Eachr ow ofar elati
onaltable,cal
ledtuple,repr
esent
sadat aent
it
ywithcolumnsoft he
t
abl erepresent
ingattr
ibutes(fi
elds)
.Theallowablevaluesfort
heseat
tri
but
esarecall
edthe 
domain

Eachrow i
nar elat
ionalt
abl
emusthaveauniquepr
imar
ykeyandal
sohassomesecondar
ykey
s
whichcor
respondwithpri
marykey
sinot
hert
ables
age:
Advant  
Provi
des flexibi
l
itythatal
lows changes t
ot he database struct
uret
o be easi
l
y
accommodated.I
tfaci
l
itatesmult
ipl
evi
ewsofthesamedat abasefordiff
erentuser
s.

e:COLLEGEt
Forexampl abl
ehasBat
ch_
Yearaspr
imar
ykeyandhassecondarykey
sSt
udent
_IDand
Cour
se_I
D,t
hesekeysser
veaspr
imar
ykeysf
orSTUDENTandCOURSEtables.

St
udentTabl
e

St
udent
_ID St
udent
_Name

101 Shubham

102 Raj
at

Cour
seTabl
e

Cour
se_
ID Cour
se_
Name

14 Jav
a

16 Andr
oid

Col
legeTabl
e

Bat
ch_
Year St
udent
_ID Cour
se_
ID Teacher
_Name Teacher
_Number

2012-
16 101 14 Jack 9876543

2013-
17 102 16 Tom 9823451

Ent
it
y–r
elat
ionshi
pmodel
:

An 
Enti
ty–r
elat
ionshi
pmodel(
ERmodel) 
descr
ibest
hestruct
ureofadatabasewi
tht
hehel
pof
adiagr
am,whi chisknownas Ent
it
yRel
ati
onshipDiagr
am (ERDiagr
am) .AnERmodelisa
7
desi
gnorbluepr
intofadatabasethatcanlaterbeimplement
edasadat
abase.Themai
n
component
sofE-Rmodel
are:enti
tysetandr
elati
onshi
pset.

AnERdi agr
am showst herel
ationshi
pamongent i
tysets.Anenti
tysetisagr oupofsi mi l
ar
enti
ti
esandtheseentit
iescanhav eattr
ibutes.Inter
msofDBMS, anentit
yisat ableorattr
ibute
ofatablei
ndatabase,sobyshowi ngrelati
onshipamongt abl
esandthei
rattr
ibutes,ERdiagram
showsthecompletelogicalst
ructureofadat abase.Let
shav eal
ookatasimpl eERdi agr
am t o
underst
andthi
sconcept .

TheEnt i
tyrel
ationshi
pdat amodelst ructurebasedont heimpressionoft herealwor l
dent i
ti
es
andtheexisti
ngr elat
ionshipbetweent hem.I nthe pr
ocessofdesi gning therealworldscenar i
o
i
ntot hedatabasemodelt heEnt it
yset sar ecr eat
edint hebegi nningandt henthemodeli s
dependentont het wobel owv it
althingswhi char eenti
tiesconsistingoft heattr
ibutesandt he
rel
ati
onshipthatexi stsamongt heent i
ti
es.Anent i
tycont ai
nsar eal
-worldpropertycal l
ed
att
ri
bute.Attr
ibutesaredef inedbyasetofv aluesknownasdomai ns.Forex ample,inanof fi
ce
theemployeei sanent it
y,theof f
iceist hedatabase,empl oyeeID,namear etheattr
ibutes.The
l
ogicalassoci
ationbet weent hediff
erentent i
ti
esar eknownast her elati
onshipamongt hem.

Asi
mpl
eERDi
agr
am:

Inthefol
lowingdiagram wehavetwoent
iti
esStudentandCol
legeandtheirr el
ati
onshi
p.The
rel
ati
onshipbetweenStudentandCol
l
egeismanyt ooneasacollegecanhav emanyst udent
s
howeverast udentcannotstudyinmult
ipl
ecol l
egesatthesamet ime.St udententi
tyhas
att
ri
butessuchasSt u_I
d,St
u_Name&Stu_AddrandColl
egeent
it
yhasattr
ibutessuchasCol _I
D
&Col_Name.

Her
earethegeomet r
icshapesandt hei
rmeaninginanE- RDi
agr
am.Wewi lldi
scusst
hese
t
ermsindetai
linthenextsect
ion(Component
sofaERDi agr
am)oft
hisgui
desodon’
tworr
ytoo
muchabouttheseter
msnow, justgothr
oughthem once.

Rectangle:RepresentsEnt i
tysets.
El
lipses:Attr
ibutes
Diamonds: RelationshipSet
Li
nes: Theylinkat t
ri
but estoEntitySet
sandEnt
it
yset
stoRel
ati
onshi
pSet
DoubleEl l
i
pses: Mul t
ivaluedAttri
butes
DashedEl l
ipses: Deri
vedAt tri
butes
DoubleRect angles:WeakEnt it
ySets

8
Doubl
eLi
nes:
Tot
alpar
ti
cipat
ionofanent
it
yinar
elat
ionshi
pset

Component
sofaERDi
agr
am

Asshownintheabov
edi
agr
am,
anERdi
agr
am hast
hreemai
ncomponent
s:
1.Ent
ity
2.Att
ri
bute
3.Rel
ati
onshi
p

1.Ent
it
y

Anent i
tyisanobj ectorcomponentofdat a.Anenti
tyisrepr
esentedasr ect
angleinanER
diagr
am.
Forexample:Inthef oll
owingERdi agram wehavetwoenti
ti
esStudentandCol l
egeandthese
twoentit
ieshavemanyt ooner elat
ionshi
pasmanystudentsst
udyinasi nglecol
lege.Wewil
l
readmoreaboutr el
ationshi
pslater,
fornowfocusonent
it
ies.

WeakEnt
it
y:

Anentitythatcannotbeuniquel
yidenti
fi
edbyitsownattributesandr
eli
esonther elat
ionship
withotherenti
tyi
scalledweakenti
ty.Theweakentit
yisrepresent
edbyadoublerectangle.For
example–abankaccountcannotbeuni quel
yident
if
iedwithoutknowi
ngthebanktowhi cht he
accountbelongs,sobankaccounti
saweakent it
y.

9
2.At
tri
but
e

Anatt
ri
but
edescr
ibestheproper
tyofanent
it
y.Anat
tri
but
eisr
epr
esent
edasOv
ali
nanER
di
agr
am.Ther
earefourt
ypesofatt
ri
but
es:

1.Keyattr
ibute
2.Composi t
eattr
ibute
3.Mult
ival
uedat t
ribut
e
4.Deri
vedattri
bute

1.Keyat
tri
but
e:

A keyatt
ri
but
ecanuni quelyi
dent
ifyanenti
tyfrom anenti
tyset.Forexampl
e,studentrol
l
numbercanuniquel
yident
if
yastudentfr
om asetofstudent
s.Keyattr
ibut
eisr
epresentedby
ovalsameasotherat
tr
ibut
eshowevert
he t
extofkeyat
tri
but
eisunderl
i
ned.

2.Composi
teat
tr
ibut
e:

Anattr
ibut
ethatisacombi nat
ionofotherattr
ibut
esisknownascomposi
teat
tri
but
e.For
exampl
e,Instudententit
y,thestudentaddressisacomposit
eatt
ri
but
easanaddr essis
composedofotherat
tr
ibutessuchaspincode,st
ate,
count
ry.

10
3.Mul
ti
val
uedat
tr
ibut
e:

Anat t
ri
but
ethatcanholdmulti
plev al
uesi
sknownasmulti
val
uedat
tri
but
e.I
tisrepr
esent
ed
wit
h doubl
eoval
s i
nanERDi agram.Forexample–Apersoncanhavemorethanonephone
numberssothephonenumberattr
ibutei
smult
ival
ued.

4.Der
ivedat
tri
but
e:

A deri
vedattr
ibuteisonewhosev al
uei sdynamicandder iv
edfrom anotherat
tri
but
e.Iti
s
repr
esentedby dashedoval
 
inanERDiagram.Forexample–Per sonageisader i
vedatt
ri
but
e
asitchangesovertimeandcanbeder
ivedfr
om anotherat
tri
bute(
Dateofbir
th).

E-
Rdi
agr
am wi
thmul
ti
val
uedandder
ivedat
tri
but
es:

3.Rel
ati
onshi
p

Arel
ationshi
pisr
epresentedbydi
amondshapeinERdi
agr
am,
itshowst
her
elat
ionshi
pamong
ent
it
ies.Ther
earefourtypesofr
elat
ionshi
ps:
1.Onet oOne
2.Onet oMany
3.Manyt oOne
4.Manyt oMany

1.Onet
oOneRel
ati
onshi
p

Whenasingl
einst
anceofanenti
tyisassoci
atedwi
thasingl
einstanceofanotherent
it
ytheni
t
i
scal
ledonetoonerel
ati
onshi
p.Forexample,
apersonhasonlyonepassportandapassporti
s

11
gi
vent
ooneper
son.

2.Onet
oManyRel
ati
onshi
p

Whenasingl
einst
anceofanenti
tyisassociat
edwithmoret
hanonei
nstancesofanot
herent
it
y
t
heniti
scall
edonet omanyrel
ati
onship.Forexample–acust
omercanplacemanyorder
sbut
aor
dercannotbeplacedbymanycustomers.

3.Manyt
oOneRel
ati
onshi
p

Whenmor ethanoneinstancesofanenti
tyisassoci
atedwit
hasi
ngleinstanceofanot
herenti
ty
theniti
scall
edmanyt ooner el
ati
onshi
p.Forexample–manyst udentscanstudyinasingle
coll
egebutastudentcannotstudyi
nmanycol l
egesatthesamet
ime.

4.Manyt
oManyRel
ati
onshi
p

Whenmor ethanonei nstancesofanenti


tyisassoci
atedwit
hmor ethanonei
nst
ancesof
anot
herenti
tytheni
tiscal l
edmanyt omanyrel
ati
onshi
p.Forexampl
e,acanbeassi
gnedto
manyproj
ectsandaprojectcanbeassi
gnedtomanystudent
s.

12
Tot
alPar
ti
cipat
ionofanEnt
it
yset

ATot alpart
ici
pat
ionofanent i
tysetr
epresent
st hateachenti
tyi
nenti
tysetmusthaveatl
east
oner el
ati
onshi
pinar el
ati
onshi
pset.Forexample:Inthebel
owdiagr
am eachcol
legemusthave
at-
leastoneassociat
edStudent.

Thr
eenewconcept
swer
eaddedt
otheexi
sti
ngERModel
,theywer
e:

1.Gener
ali
zat
ion

2.Speci
ali
zat
ion

3.Aggr
egat
ion

Let
'sunder
standwhatt
heyar
e,andwhywer
etheyaddedt
otheexi
sti
ngERModel
.

Gener
ali
zat
ion
Generali
zati
on i
sabot t
om- upappr
oachinwhi chtwolowerl
evelent
it
iescombi
netoform ahigher
l
evelentit
y.Ingenerali
zati
on,thehi
gherl
evelenti
tycanal
socombinewithot
herl
owerl
evelent
it
iesto
makef urt
herhigherlevelenti
ty.
It
'smorelikeSupercl
assandSubclasssystem,butt
heonl
ydif
ferencei
stheapproach,whi
chi s
bott
om-up.Hence,ent
it
iesarecombinedtof or
m amoregener
ali
zedenti
ty,i
notherwords,sub-
cl
assesarecombinedt
of or
m asuper
-cl
ass.

13
Forexample,
 
Saving 
and 
Curr
ent 
accounttypes ent
it
ies can be gener
ali
zed and an ent
it
y wi
th
name 
Account 
canbecreat
ed,whi
chcov er
sboth.
Speci
ali
zat
ion
Special
i
zation 
i
sopposit
etoGenerali
zat
ion.I
tisatop-
downappr oachi
nwhichonehigherl
evelent
it
y
canbebr okendowni nt
otwolowerlevelent
ity.I
nspeci
ali
zat
ion,ahigherl
evelent
it
ymaynothav e
anylower-
levelent
it
yset
s,i
t'
spossibl
e.

Aggr
egat
ion
Aggr
egat
ioni
sapr
ocesswhenr
elat
ionbet
weent
woent
it
iesi
str
eat
edasa 
singl
eent
it
y.

I
nthedi
agr
am abov e,t
her el
ati
onshi
pbetween Cent
er 
and 
Course 
toget
her,isact
ingasanEnt i
ty,
whi
chi
sinr
elat
ionshipwit
hanotherenti
ty 
Visi
tor
.Nowinrealworl
d,ifaVisi
tororaStudentv
isi
tsa
14
CoachingCenter
,he/shewil
lneverenqui
reaboutt
hecent
eronl
yorj
ustaboutt
hecour
se,r
ather
he/shewil
laskenqui
reaboutbot
h.

OTHERMODELSFORDBMS:

Obj
ect
-Or
ient
edDat
abaseModel
Anobj ect
-ori
ent
eddat
amodelisoneofthemostdev
elopeddatamodel
swhichcontai
nsv i
deo,
graphi
calf i
l
es,andaudi
o.Thi
sconsistsofthedat
api eceandthemethodsinthef or
m of
databasemanagementsyst
em i
nst
ruct
ions.

Therelat
ionaldatabasemodelhasawidel
yvari
etyofappl
i
cat
ions.Howeveri
tdoesnoteasil
y
supportthedistr
ibuti
onofonedatabaseacrossanumberofser vers.Duetothi
s,object
-
ori
enteddatabasemanagementsyst
em wasdevel
oped.
Int
hesedat
abases,t
heuser
scandefi
neowndat aaccessmet hods,t
herepr
esent
ati
onofdat
a
andthemet
hodofmanipul
ati
ngi
t.Anobj
ect
-or
ienteddatabasestor
esandmaintai
nsobj
ect
s.
Example:Theclasspopulati
onisther ootofclasshi erar
chy,whichincl
udest
heNati
onclass.
ThePopulati
onclassisalsotherootoftwosub- cl
ass, menandwomen.TheNat ioncl
assi
sthe
rootofothersub-
classescountr
y1,countr
y2,country3.Not ethateachcl
asshasit
sownsetof
attr
ibut
esapartfr
om therootcl
ass'sat
tri
butes.

Recor
dbaseDat
aModel
Recor
dbasemodelisusedtospeci
fytheover
allst
ructur
eofthedatabaseandi
nthi
sther
ear
e
manyrecor
dty
pes.Eachrecor
dtypehasfi
xedno.offiel
dshav
ingthefixedl
engt
h.

Obj
ectr
elat
ionDat
aModel
Objectr
elat
ionmodeli
sav er
ypowerf
ulmodelbutcomingtoit’
sdesigniti
squietcomplex.Thi
s
complexi
tyi s notpr
obl
em because itgi
ves ef
fi
cientresul
ts and widespread wi
th huge
appli
cat
ions.Ithasaf
eat
urewhichal
lowsworki
ngwithothermodelslikeworki
ngwi t
ht hever
y
knownrelati
onmodel.

Recor
d-baseddat
amodel

15
Therecor
d-baseddatamodelisusedtodeterminetheover
alldesi
gnofthedat
abase.Thisdat
a
modelcontai
nsdiff
erentki
ndsofrecor
dtypes.Eachoftherecordt
ypeshasafi
xedlengthanda
fi
xednumberoffiel
ds.

Semi
str
uct
uredDat
aModel
Semistruct
ureddatamodelisaselfdescr
ibi
ngdatamodel
,inthi
sthei
nfor
mati
onthati
s
normal
lyassociat
edwithaschemei
scontai
nedwit
hint
hedataandthi
spr
opert
yiscal
l
edas
thesel
fdescri
bingpr
opert
y.

Associ
ati
veDat
aModel
Associ
at i
vemodelhasadivisi
onproperty
,thi
sdivi
destherealworldthi
ngsaboutwhi
chdatais
tober ecordedintwosort
si .
e.betweenenti
ti
esandassoci at
ions.Thus,t
hismodeldoesthe
div
isi
onf ordiv
idi
ngther
ealworlddatatotheent
it
iesandassociati
ons.

Cont
extDat
aModel
Contextdat
amodelisaf l
exibl
emodelbecauseiti
sacoll
ect
ionofmanydat amodels.Itisa
col
lecti
onofthedat
amodel sli
keobjectori
ent
eddatamodel
,net
wor kmodel,semist
ructur
ed
model.So,i
nthi
sdif
fer
enttypesofworkscanbedoneduet
otheversati
l
ityofi
t.

Cont
extModel

Therefore,t
hissuppor
tdif
fer
enttypesofuser sanddiff
erbythei
nteracti
onofusersi
ndatabase
andal sothedatamodelsinDBMSbr oughtar ev
oluti
onar
ychangeini ndust
ri
esbythehandl
ing
ofr el
evantdata.Thedat amodel sinDBMS ar ethesystemsthathel ptouseandcr eate
databases,aswehav eseentherearediff
erenttypesofdatamodelsanddependingonthekind
ofstructur
eneededwecansel ectthedatamodel i
nDBMS.  

Aswesaidthatwewi l
lprov
ideyouaf
reepdff
il
eofDat
aModel
sandi
tst
ypes,sol
i
nkt
o
downl
oadt
hispdff
il
eisgiv
enbelow.

DBMSAr
chi
tect
ure
o TheDBMSdesi
gndependsuponi
tsar
chi
tect
ure.Thebasi
ccl
i
ent
/ser
verar
chi
tect
urei
susedt
odeal
wit
hal
arge
numberofPCs,
webser
ver
s,dat
abaseser
ver
sandot
hercomponent
sthatar
econnect
edwi
thnet
wor
ks.

16
o Thecl
i
ent
/ser
verar
chi
tect
ureconsi
stsofmanyPCsandawor
kst
ati
onwhi
char
econnect
edv
iat
henet
wor
k.
o DBMSar
chi
tect
uredependsuponhowuser
sar
econnect
edt
othedat
abaset
ogett
hei
rrequestdone.

Ty
pesofDBMSAr
chi
tect
ure

Dat
abasearchit
ectur
ecanbeseenasasi
ngl
eti
erormul
ti
-t
ier
.Butl
ogi
cal
l
y,dat
abasear
chi
tect
urei
soft
wot
ypesl
i
ke:
 
2-t
ier
ar
chit
ect
ure and 
3-ti
erar
chi
tect
ure.

1-
TierAr
chi
tect
ure
o I
nthi
sar
chi
tect
ure,t
hedat
abasei
sdi
rect
lyav
ail
abl
etot
heuser
.Itmeanst
heusercandi
rect
lysi
tont
heDBMS
andusesi
t.
o Anychangesdoneher
ewi
l
ldi
rect
lybedoneont
hedat
abasei
tsel
f.I
tdoesn'
tpr
ovi
deahandyt
ool
forenduser
s.
o The 1-
Tierar
chi
tect
urei
s used f
ordev
elopmentoft
he l
ocalappl
i
cat
ion,wher
e pr
ogr
ammer
s can di
rect
ly
communi
cat
ewi
tht
hedat
abasef
ort
hequi
ckr
esponse.

2-
TierAr
chi
tect
ure
o The2-
Tierar
chi
tect
urei
ssameasbasi
ccl
i
ent
-ser
ver
.Int
het
wo-
ti
erar
chi
tect
ure,appl
i
cat
ionsont
hecl
i
entend
candi
rect
lycommuni
cat
ewi
tht
hedat
abaseatt
heser
versi
de.Fort
hisi
nter
act
ion,API
'
sli
ke:
 
ODBC,
 
JDBC 
are
used.
o Theuseri
nter
facesandappl
i
cat
ionpr
ogr
amsar
erunont
hecl
i
ent
-si
de.
o Theser
versi
dei
sresponsi
blet
opr
ovi
det
hef
unct
ional
i
tiesl
i
ke:
quer
ypr
ocessi
ngandt
ransact
ionmanagement
.
o Tocommuni
cat
ewi
tht
heDBMS,
cli
ent
-si
deappl
i
cat
ionest
abl
i
shesaconnect
ionwi
tht
heser
versi
de.

Fi
g:2-
ti
erAr
chi
tect
ure
17
3-
TierAr
chi
tect
ure
o The3-
Tierar
chi
tect
urecont
ainsanot
herl
ayerbet
weent
hecl
i
entandser
ver
.Int
hisar
chi
tect
ure,cl
i
entcan'
t
di
rect
lycommuni
cat
ewi
tht
heser
ver
.
o Theappl
i
cat
ionont
hecl
i
ent
-endi
nter
act
swi
thanappl
i
cat
ionser
verwhi
chf
urt
hercommuni
cat
eswi
tht
he
dat
abasesy
stem.
o Enduserhasnoi
deaaboutt
heexi
stenceoft
hedat
abasebey
ondt
heappl
i
cat
ionser
ver
.Thedat
abaseal
sohasno
i
deaaboutanyot
heruserbey
ondt
heappl
i
cat
ion.
o The3-
Tierar
chi
tect
urei
susedi
ncaseofl
argewebappl
i
cat
ion.

Fi
g:3-
ti
erAr
chi
tect
ure

(
OR)
DBMSThr
eeLev
elAr
chi
tect
ureDi
agr
am:

Thisarchit
ecturehast
hreel
evel
s:
1.Externall
evel
2.Conceptual l
evel
3.I
nternallev
el

18
1.Ext
ernal
lev
el

Itisal
socal l
ed vi
ew l
evel
.Thereasonthisl
eveliscall
ed“ v
iew”i
sbecausesever
aluser
scan
viewtheirdesi
reddatafr
om thi
slev
elwhichi
sinternal
l
yf et
chedfr
om dat
abasewit
hthehelpof
conceptualandint
ernall
evel
mapping.

Theuserdoesn’ tneedtoknow thedatabaseschemadet ai


l
ssuchasdat astr
uct
ure,t
abl
e
defi
nit
ionetc.userisonl
yconcer
nedaboutdatawhichiswhatretur
nedbackt
othevi
ewlevel
aft
erithasbeenfetchedf
rom dat
abase(
presentatt
heint
ernall
evel
).

Ext
ernal
lev
eli
sthe“
topl
evel
”oft
heThr
eeLev
elDBMSAr
chi
tect
ure.

2.Concept
ual
lev
el

Iti
salsocal
l
ed l
ogical
lev
el.Thewhol
edesi
gnoft
hedat
abasesuchasr
elat
ionshi
pamongdat
a,
schemaofdataetc.ar
edescri
bedint
hisl
evel
.

Dat
abaseconst
rai
ntsandsecuri
tyar
ealsoimplement
edi
nthi
slev
elofar
chi
tect
ure.Thi
slev
el
i
smaintai
nedbyDBA(databaseadmi
nist
rat
or)
.

3.I
nter
nal
lev
el

Thisl
evelisal
soknownasphy si
callev
el.Thi
sleveldescr
ibeshowthedataisact
uall
ystor
edin
thest
oragedevices.Thi
slevelisalsoresponsi
bleforall
ocati
ngspacetothedata.Thi
sisthe
l
owestleveloft
hearchit
ect
ure.

ht
tp:
//t
utor
ial
4begi
nner
s.com/dbms-
funct
ional
-dependency
ht
tps:
//begi
nner
sbook.
com/
2018/
11/
dbms-
thr
ee-
lev
el-
archi
tect
ure/

19

You might also like