Fundamentals of Database Systems Detailed Notes
Fundamentals of Database Systems Detailed Notes
ver
sit
y
AI
T
FCT
CS
Fundament
alsofDat
abaseSy
stemsLect
ureNot
es
(
HandoutI
nst
eadofSl
ides)
1
Chapt
erOne
1.
1. I
ntr
oduct
iont
oDat
abasesy
stem
Dat
abaseSy
stem
Dat
abasesy
stemsar
edesi
gnedt
omanagel
argedat
aseti
nanor
gani
zat
ion.The
dat
amanagementi
nvol
vesbot
hdef
ini
ti
onandt
hemani
pul
ati
onoft
hedat
a
whi
ch r
anges f
rom si
mpl
erepr
esent
ati
on oft
he dat
ato consi
der
ati
ons of
st
ruct
uresf
ort
hest
orageofi
nfor
mat
ion.Thedat
amanagemental
soconsi
der
t
hepr
ovi
sionofmechani
smsf
ort
hemani
pul
ati
onofi
nfor
mat
ion.
Today
,Dat
abasesar
eessent
ialt
oev
erybusi
ness.Theyar
eusedt
omai
ntai
n
i
nter
nalr
ecor
ds,t
opr
esentdat
atocust
omer
sandcl
i
ent
sont
heWor
ld-
Wide-
Web,andt
osuppor
tmanyot
hercommer
cialpr
ocesses.Dat
abasesar
eli
kewi
se
f
oundatt
hecor
eofmanymoder
nor
gani
zat
ions.
Thepowerofdat
abasescomesf
rom abodyofknowl
edgeandt
echnol
ogyt
hat
hasdev
elopedov
ersev
eraldecadesandi
sembodi
edi
nspeci
ali
zedsof
twar
e
cal
l
edadat
abasemanagementsy
stem,orDBMS.ADBMSi
sapower
fult
oolf
or
cr
eat
ingandmanagi
ngl
argeamount
sofdat
aef
fi
cient
lyandal
l
owi
ngi
ttoper
sist
ov
erl
ongper
iodsoft
ime,saf
ely
.Thesesy
stemsar
eamongt
hemostcompl
ex
t
ypesofsof
twar
eav
ail
abl
e.
Thus,f
orourquest
ion:Whati
sadat
abase? I
nessenceadat
abasei
snot
hing
mor
ethanacol
l
ect
ionofshar
edi
nfor
mat
iont
hatexi
stsov
eral
ongper
iodof
t
ime,of
ten manyy
ear
s.I
n common di
alect
,thet
erm dat
abaser
efer
stoa
col
l
ect
ionofdat
athati
smanagedbyaDBMS.
Thust
heDBcour
sei
sabout
:
2
Howt
oor
gani
zedat
a
Suppor
ti
ngmul
ti
pleuser
s
Ef
fi
ci
entandef
fect
ivedat
aret
ri
eval
Secur
edandr
eli
abl
est
orageofdat
a
Mai
ntai
ningconsi
stentdat
a
Maki
ngi
nfor
mat
ionusef
ulf
ordeci
si
onmaki
ng
Dat
amanagementpassest
hrought
hedi
ff
erentl
evel
sofdev
elopmental
ongwi
th
t
he dev
elopmenti
ntechnol
ogy and ser
vices.These l
evel
s coul
d bestbe
descr
ibed bycat
egor
izi
ng t
hel
evel
sint
othr
eel
evel
sofdev
elopment
.Ev
en
t
hought
her
eisanadv
ant
ageandapr
obl
em ov
ercomeateachnew l
evel
,al
l
met
hodsofdat
ahandl
i
ngar
einuset
osomeext
ent
.Themaj
ort
hreel
evel
sar
e;
1.Manual
Appr
oach
2.Tr
adi
ti
onal
Fil
eBasedAppr
oach
3.Dat
abaseAppr
oach
1.
2. Manual
Appr
oach
I
nthemanualappr
oach,dat
ast
orageandr
etr
iev
alf
oll
owst
hepr
imi
ti
veand
t
radi
ti
onalwayofi
nfor
mat
ionhandl
i
ngwher
ecar
dsandpaperar
eusedf
ort
he
pur
pose.Thedat
ast
orageandr
etr
iev
alwi
l
lbeper
for
medusi
nghumanl
abour
.
Fi
l
esf
orasmanyev
entandobj
ect
sast
heor
gani
zat
ionhasar
eusedt
o
st
orei
nfor
mat
ion.
Eachoft
hef
il
escont
aini
ngv
ari
ouski
ndsofi
nfor
mat
ioni
slabel
l
edand
st
oredi
noneor
emor
ecabi
net
s.
Thecabi
net
scoul
dbekepti
nsaf
epl
acesf
orsecur
it
ypur
posebasedon
t
hesensi
ti
vi
tyoft
hei
nfor
mat
ioncont
ainedi
nit
.
I
nser
ti
onandr
etr
iev
ali
sdonebysear
chi
ngf
ir
stf
ort
her
ightcabi
nett
hen
f
ort
her
ightt
hef
il
ethent
hei
nfor
mat
ion.
Onecoul
dhav
eani
ndexi
ngsy
stem t
ofaci
l
itat
eaccesst
othedat
a
Li
mit
ati
onsoft
heManual
appr
oach
Pr
onet
oer
ror
3
Di
ff
icul
ttoupdat
e,r
etr
iev
e,i
ntegr
ate
Youhav
ethedat
abuti
tisdi
ff
icul
ttocompi
l
ethei
nfor
mat
ion
Li
mit
edt
osmal
lsi
zei
nfor
mat
ion
Cr
ossr
efer
enci
ngi
sdi
ff
icul
t
Anal
ter
nat
iveappr
oachofdat
ahandl
i
ngi
sacomput
eri
zedwayofdeal
i
ngwi
th
t
hei
nfor
mat
ion.Thecomput
eri
zedappr
oachcoul
dal
sobeei
therdecent
ral
i
zed
orcent
ral
i
zedbaseonwher
ethedat
aresi
desi
nthesy
stem.
1.
3.Tr
adi
ti
onalFi
leBasedAppr
oach
Af
tert
he i
ntr
oduct
ion ofComput
erf
ordat
a pr
ocessi
ng t
othe busi
ness
communi
ty,
theneedt
ouset
hedev
icef
ordat
ast
orageandpr
ocessi
ngi
ncr
ease.
Ther
e wer
e,and st
il
lar
e,sev
eralcomput
erappl
i
cat
ions wi
thf
il
e based
pr
ocessi
ngusedf
ort
hepur
poseofdat
ahandl
i
ng.Ev
ent
hought
heappr
oach
ev
olv
edov
ert
ime,
thebasi
cst
ruct
urei
sst
il
lsi
mil
ari
fnoti
dent
ical
.
Fi
l
ebasedsy
stemswer
eanear
lyat
temptt
ocomput
eri
zet
hemanual
fil
i
ng
sy
stem.
Thi
sappr
oachi
sthedecent
ral
i
zedcomput
eri
zeddat
ahandl
i
ngmet
hod.
Acol
l
ect
ionofappl
i
cat
ionpr
ogr
amsper
for
m ser
vicesf
ort
heend-
user
s.I
n
suchsy
stems,ev
eryappl
i
cat
ionpr
ogr
am t
hatpr
ovi
desser
vicet
oend
user
sdef
ineandmanagei
tsowndat
a
Such sy
stems hav
e numberofpr
ogr
ams f
oreach oft
he di
ff
erent
appl
i
cat
ionsi
ntheor
gani
zat
ion.
Si
nceev
eryappl
i
cat
iondef
inesandmanagesi
tsowndat
a,t
hesy
stem i
s
subj
ect
edt
oser
iousdat
adupl
i
cat
ionpr
obl
em.
Fi
l
e,i
ntr
adi
ti
onalf
il
ebasedappr
oach,i
sacol
l
ect
ionofr
ecor
dswhi
ch
cont
ainsl
ogi
cal
l
yrel
ateddat
a.
4
Li
mit
ati
onsoft
heTr
adi
ti
onalFi
leBasedappr
oach
Asbusi
nessappl
i
cat
ionbecomemor
ecompl
exdemandi
ngmor
efl
exi
bleand
r
eli
abl
edat
a handl
i
ng met
hods,t
heshor
tcomi
ngsoft
hef
il
ebased sy
stem
becameev
ident
.Theseshor
tcomi
ngsi
ncl
ude,
butnotl
i
mit
edt
o:
Separ
ati
onorI
sol
ati
onofDat
a:Av
ail
abl
einf
ormat
ioni
noneappl
i
cat
ion
maynotbeknown.Dat
aSy
nchr
oni
sat
ioni
sdonemanual
l
y.
Li
mit
eddat
ashar
ing-ev
eryappl
i
cat
ionmai
ntai
nsi
tsowndat
a.
Lengt
hydev
elopmentandmai
ntenancet
ime
Dupl
i
cat
ionorr
edundancyofdat
a(moneyandt
imecostandl
ossofdat
a
i
ntegr
it
y)
Dat
adependencyont
heappl
i
cat
ion-dat
ast
ruct
urei
sembeddedi
nthe
5
appl
i
cat
ion;hence,achangei
nthedat
ast
ruct
ureneedst
ochanget
he
appl
i
cat
ionaswel
l
.
I
ncompat
ibl
efi
l
efor
mat
sordat
ast
ruct
ures(
e.g.“
C”andCOBOL)bet
ween
di
ff
erentappl
i
cat
ionsandpr
ogr
amscr
eat
ingi
nconsi
stencyanddi
ff
icul
ty
t
opr
ocessj
oint
ly.
Fi
xedquer
ypr
ocessi
ngwhi
chi
sdef
ineddur
ingappl
i
cat
iondev
elopment
Thel
i
mit
ati
onsf
ort
het
radi
ti
onalf
il
ebaseddat
ahandl
i
ngappr
oachar
isef
rom
t
wobasi
creasons.
1.Def
ini
ti
on oft
hedat
aisembedded i
ntheappl
i
cat
ion pr
ogr
am
whi
chmakesi
tdi
ff
icul
ttomodi
fyt
hedat
abasedef
ini
ti
oneasi
l
y.
2.Nocont
rolov
ert
heaccessandmani
pul
ati
onoft
hedat
abey
ond
t
hati
mposedbyt
heappl
i
cat
ionpr
ogr
ams.
Themostsi
gni
fi
cantpr
obl
em exper
iencedbyt
het
radi
ti
onalf
il
ebasedappr
oach
ofdat
ahandl
i
ngi
sthe“
updat
eanomal
i
es”
.Wehav
ethr
eet
ypesofupdat
e
anomal
i
es;
1.Modi
fi
cat
ionAnomal
i
es:apr
obl
em exper
iencedwhenoneormor
edat
a
v
aluei
smodi
fi
edononeappl
i
cat
ionpr
ogr
am butnotonot
her
scont
aini
ng
t
hesamedat
aset
.
2.Del
eti
on Anomal
i
es:a pr
obl
em encount
ered wher
e one r
ecor
d seti
s
del
etedf
rom oneappl
i
cat
ionbutr
emai
nunt
ouchedi
not
herappl
i
cat
ion
pr
ogr
ams.
3. I
nser
ti
onAnomal
i
es:apr
obl
em exper
iencedwhenev
ert
her
eisnewdat
a
i
tem t
ober
ecor
ded,andt
her
ecor
dingi
snotmadei
nal
ltheappl
i
cat
ions.
Andwhensamedat
ait
em i
sinser
tedatdi
ff
erentappl
i
cat
ions,
ther
ecoul
d
beer
ror
sinencodi
ngwhi
chmakest
henewdat
ait
em t
obeconsi
der
edas
at
otal
l
ydi
ff
erentobj
ect
.
1.
4.Dat
abaseAppr
oach
Fol
l
owi
ngaf
amouspaperwr
it
tenbyTedCodedi
n1970,dat
abasesy
stems
changedsi
gni
fi
cant
ly.Coddpr
oposedt
hatdat
abasesy
stemsshoul
dpr
esentt
he
userwi
thav
iewofdat
aor
gani
zedast
abl
escal
l
edr
elat
ions.Behi
ndt
hescenes,
6
t
her
emi
ghtbeacompl
exdat
ast
ruct
uret
hatal
l
owedr
api
dresponset
oav
ari
ety
ofquer
ies.But
,unl
i
ket
heuserofear
li
erdat
abasesy
stems,t
heuserofa
r
elat
ionalsy
stem woul
dnotbeconcer
nedwi
tht
hest
oragest
ruct
ure.Quer
ies
coul
dbeexpr
essedi
nav
eryhi
gh-
lev
ell
anguage,whi
chgr
eat
lyi
ncr
easedt
he
ef
fi
ciencyofdat
abasepr
ogr
ammer
s.Thedat
abaseappr
oachemphasi
zest
he
i
ntegr
ati
onandshar
ingofdat
athr
oughoutt
heor
gani
zat
ion.
Thusi
nDat
abaseAppr
oach:
Dat
abasei
sjustacomput
eri
zedr
ecor
dkeepi
ngsy
stem oraki
ndof
el
ect
roni
cfi
l
ingcabi
net
.
Dat
abasei
sar
eposi
tor
yforcol
l
ect
ionofcomput
eri
zeddat
afi
l
es.
Dat
abasei
sashar
edcol
l
ect
ionofl
ogi
cal
l
yrel
ateddat
adesi
gnedt
omeet
t
hei
nfor
mat
ionneedsofanor
gani
zat
ion.Si
ncei
tisashar
edcor
por
ate
r
esour
ce,t
hedat
abasei
sint
egr
ated wi
th mi
nimum amountoforno
dupl
i
cat
ion.
Dat
abasei
sacol
l
ect
ionofl
ogi
cal
l
yrel
ateddat
awher
ethesel
ogi
cal
l
y
r
elat
eddat
acompr
isesent
it
ies,at
tri
but
es,r
elat
ionshi
ps,andbusi
ness
r
ulesofanor
gani
zat
ion'
sinf
ormat
ion.
I
naddi
ti
ont
ocont
aini
ngdat
arequi
redbyanor
gani
zat
ion,dat
abaseal
so
cont
ainsadescr
ipt
ionoft
hedat
awhi
chcal
l
edas“
Met
adat
a”or“
Dat
a
Di
cti
onar
y”or“
Syst
emsCat
alogue”or“
Dat
aaboutDat
a”.
Si
nceadat
abasecont
ainsi
nfor
mat
ionaboutt
hedat
a(met
adat
a),i
tis
cal
l
edasel
fdescr
ipt
ivecol
l
ect
iononi
ntegr
atedr
ecor
ds.
Thepur
poseofadat
abasei
stost
orei
nfor
mat
ionandt
oal
l
ow user
sto
r
etr
iev
eandupdat
ethati
nfor
mat
ionondemand.
Dat
abasei
sdesi
gnedonceandusedsi
mul
taneousl
ybymanyuser
s.
Unl
i
ket
het
radi
ti
onalf
il
ebasedappr
oachi
ndat
abaseappr
oacht
her
eis
pr
ogr
am dat
aindependence.Thati
sthesepar
ati
onoft
hedat
adef
ini
ti
on
f
rom t
heappl
i
cat
ion.Thust
heappl
i
cat
ioni
snotaf
fect
edbychanges
madei
nthedat
ast
ruct
ureandf
il
eor
gani
zat
ion.
Each dat
abase appl
i
cat
ion wi
l
lper
for
m t
he combi
nat
ion of
:Cr
eat
ing
7
dat
abase,
Readi
ng,
Updat
ingandDel
eti
ngdat
a.
Benef
it
soft
hedat
abaseappr
oach
Dat
acanbeshar
ed:t
woormor
euser
scanaccessandusesamedat
a
i
nst
eadofst
ori
ngdat
ainr
edundantmannerf
oreachuser
.
I
mpr
ovedaccessi
bil
i
tyofdat
a:byusi
ngst
ruct
uredquer
ylanguages,t
he
user
scaneasi
l
yaccessdat
awi
thoutpr
ogr
ammi
ngexper
ience.
Redundancycanber
educed:i
sol
ateddat
aisi
ntegr
atedi
ndat
abaset
o
decr
easet
her
edundantdat
ast
oredatdi
ff
erentappl
i
cat
ions.
Qual
i
tydat
acanbemai
ntai
ned:t
hedi
ff
erenti
ntegr
it
yconst
rai
ntsi
nthe
dat
abaseappr
oachwi
l
lmai
ntai
nthequal
i
tyl
eadi
ngt
obet
terdeci
sion
maki
ng
I
nconsi
stencycan be av
oided:cont
rol
l
ed dat
aredundancywi
l
lav
oid
i
nconsi
stencyoft
hedat
aint
hedat
abaset
osomeext
ent
.
Tr
ansact
ionsuppor
tcanbepr
ovi
ded:basi
cdemandsofanyt
ransact
ion
suppor
tsy
stemsar
eimpl
ant
edi
naf
ull
scal
eDBMS.
I
ntegr
it
y can be mai
ntai
ned:dat
a atdi
ff
erentappl
i
cat
ions wi
l
lbe
i
ntegr
atedt
oget
herwi
thaddi
ti
onalconst
rai
ntst
ofaci
l
itat
eshar
eddat
a
r
esour
ce.
Secur
it
ymaj
orscanbeenf
orced:t
heshar
eddat
acanbesecur
edby
hav
ingdi
ff
erentl
evel
sofcl
ear
anceandot
herdat
asecur
it
ymechani
sms.
I
mpr
oveddeci
si
onsuppor
t:t
hedat
abasewi
l
lpr
ovi
dei
nfor
mat
ionusef
ul
f
ordeci
sionmaki
ng.
St
andar
dscanbeenf
orced:t
hedi
ff
erentway
sofusi
nganddeal
i
ngwi
th
dat
a by di
ff
erent uni
te of an or
gani
zat
ion can be bal
anced and
st
andar
dizedbyusi
ngdat
abaseappr
oach.
Compact
ness:si
ncei
tisanel
ect
roni
cdat
ahandl
i
ngmet
hod,t
hedat
ais
st
oredcompact
ly(
nov
olumi
nouspaper
s).
Speed:dat
ast
orageandr
etr
iev
ali
sfastasi
twi
l
lbeusi
ngt
hemoder
nfast
comput
ersy
stems.
Lessl
abour
:unl
i
ket
heot
herdat
ahandl
i
ngmet
hods,dat
amai
ntenance
8
wi
l
lnotdemandmuchr
esour
ce.
Cent
ral
i
zedi
nfor
mat
ioncont
rol
:si
ncer
elev
antdat
aint
heor
gani
zat
ionwi
l
l
best
oredatoner
eposi
tor
y,i
tcanbecont
rol
l
edandmanagedatt
he
cent
ral
lev
el.
Li
mit
ati
onsandr
iskofDat
abaseAppr
oach
I
ntr
oduct
ionofnewpr
ofessi
onal
andspeci
ali
zedper
sonnel
.
Compl
exi
tyi
ndesi
gni
ngandmanagi
ngdat
a
Thecostandr
iskdur
ingconv
ersi
onf
rom t
heol
dtot
henewsy
stem
Hi
ghcostt
obei
ncur
redt
odev
elopandmai
ntai
nthesy
stem
Compl
exbackupandr
ecov
erser
vicesf
rom t
heuser
sper
spect
ive
Reducedper
for
manceduet
ocent
ral
i
zat
ionanddat
aindependency
Hi
ghi
mpactont
hesy
stem whenf
ail
ureoccur
stot
hecent
ral
syst
em.
9
10
2.Dat
abaseManagementSy
stem (
DBMS)
Dat
abaseManagementSy
stem (
DBMS)i
saSof
twar
epackageusedf
orpr
ovi
ding
EFFI
CIENT,CONVENI
ENT and SAFE MULTI
-USER (
many peopl
e/pr
ogr
ams
accessi
ngsamedat
abase,orev
ensamedat
a,si
mul
taneousl
y)st
orageofand
access t
o MASSI
VE amount
s ofPERSI
STENT (
dat
a out
li
ves pr
ogr
ams t
hat
oper
ateoni
t)dat
a.ADBMSal
sopr
ovi
desasy
stemat
icmet
hodf
orcr
eat
ing,
updat
ing,st
ori
ng,r
etr
iev
ingdat
ainadat
abase.DBMSal
sopr
ovi
dest
heser
vice
ofcont
rol
l
ing dat
a access,enf
orci
ng dat
aint
egr
it
y,managi
ng concur
rency
cont
rol
,andr
ecov
ery
.Hav
ingt
hisi
nmi
nd,
aful
lscal
eDBMSshoul
datl
easthav
e
t
hef
oll
owi
ngser
vicest
opr
ovi
det
otheuser
.
1.Dat
ast
orage,
ret
ri
eval
andupdat
eint
hedat
abase
2.Auseraccessi
blecat
alogue
3.Tr
ansact
ionsuppor
tser
vice:ALLorNONEt
ransact
ion,whi
chmi
nimi
ze
dat
ainconsi
stency
.
4.Concur
rencyCont
rolSer
vices: accessandupdat
eont
hedat
abaseby
di
ff
erentuser
ssi
mul
taneousl
yshoul
dbei
mpl
ement
edcor
rect
ly.
5.Recov
erySer
vices:a mechani
sm f
orr
ecov
eri
ng t
hedat
abaseaf
tera
f
ail
uremustbeav
ail
abl
e.
6.Aut
hor
izat
ionSer
vices(
Secur
it
y): mustsuppor
tthei
mpl
ement
ati
onof
accessandaut
hor
izat
ionser
vicet
odat
abaseadmi
nist
rat
oranduser
s.
7.Suppor
tfor
Dat
aCommuni
cat
ion:shoul
dpr
ovi
det
hef
aci
l
ityt
oint
egr
ate
wi
thdat
atr
ansf
ersof
twar
eordat
acommuni
cat
ionmanager
s.
8.I
ntegr
it
ySer
vices:r
ulesaboutdat
aandt
hechanget
hatt
ookpl
aceont
he
dat
a,cor
rect
nessandconsi
stencyofst
oreddat
a,andqual
i
tyofdat
a
basedonbusi
nessconst
rai
nts.
9.Ser
vices t
o pr
omot
e dat
aindependency bet
ween t
he dat
a and t
he
appl
i
cat
ion
10.
Uti
l
ityser
vices:
set
sofut
il
it
yser
vicef
aci
l
iti
esl
i
ke
I
mpor
ti
ngdat
a
St
ati
sti
cal
anal
ysi
ssuppor
t
11
I
ndexr
eor
gani
zat
ion
Gar
bagecol
l
ect
ion
12
DBMSandComponent
sofDBMSEnv
ironment
ADBMSi
ssof
twar
epackageusedt
odesi
gn,manage,andmai
ntai
ndat
abases.Each
DBMS shoul
dhav
efaci
l
iti
est
odef
inet
hedat
abase,mani
pul
atet
hecont
entoft
he
dat
abaseandcont
rolt
hedat
abase.Thesef
aci
l
iti
eswi
l
lhel
pthedesi
gner
,theuseras
wel
last
hedat
abaseadmi
nist
rat
ort
odi
schar
get
hei
rresponsi
bil
i
tyi
ndesi
gni
ng,usi
ng
andmanagi
ngt
hedat
abase.I
tpr
ovi
dest
hef
oll
owi
ngf
aci
l
iti
es:
Dat
aDef
ini
ti
onLanguage(
DDL)
:
Languageusedt
odef
ineeachdat
ael
ementr
equi
redbyt
heor
gani
zat
ion.
Commandsf
orset
ti
ngupschemaort
hei
ntensi
onofdat
abase
Thesecommandsar
eusedt
oset
upadat
abase,cr
eat
e,del
eteandal
ter
t
abl
ewi
tht
hef
aci
l
ityofhandl
i
ngconst
rai
nts
Dat
aMani
pul
ati
onLanguage(
DML)
:
I
sa cor
e command used byend-
user
sand pr
ogr
ammer
sto st
ore,
r
etr
iev
e,andaccesst
hedat
aint
hedat
abasee.
g.SQL
Si
ncet
her
equi
reddat
aorQuer
ybyt
heuserwi
l
lbeext
ract
edusi
ngt
his
t
ypeofl
anguage,
iti
sal
socal
l
ed"
Quer
yLanguage"
Dat
aDi
cti
onar
y:
Duet
othef
actt
hatadat
abasei
sasel
f-
descr
ibi
ngsy
stem,t
hist
ool
,
Dat
aDi
cti
onar
y,i
susedt
ost
oreandor
gani
zei
nfor
mat
ionaboutt
hedat
a
st
oredi
nthedat
abase.
Dat
aCont
rolLanguage:
Dat
abasei
sashar
edr
esour
cet
hatdemandscont
rolofdat
aaccessand
usage.Thedat
abaseadmi
nist
rat
orshoul
dhav
ethef
aci
l
ityt
ocont
rolt
he
ov
eral
loper
ati
onoft
hesy
stem.
Dat
aCont
rolLanguagesar
ecommandst
hatwi
l
lhel
ptheDat
abase
Admi
nist
rat
ort
ocont
rol
accesst
othedat
abase.
The commands i
ncl
ude gr
antorr
evoke pr
ivi
l
eges t
o access t
he
dat
abaseorpar
ti
cul
arobj
ectwi
thi
nthedat
abaseandt
ost
oreorr
emov
e
dat
abaset
ransact
ions
TheDBMSi
ssof
twar
epackaget
hathel
pst
odesi
gn,
manage,
andusedat
ausi
ng
13
t
hedat
abaseappr
oach.Taki
ngaDBMSasasy
stem,onecandescr
ibei
twi
th
r
espectt
oit
senv
ironmentorot
hersy
stemsi
nter
act
ingwi
tht
heDBMS.
Dat
abaseDev
elopmentLi
feCy
cle
Asi
tisonecomponenti
nmosti
nfor
mat
ionsy
stem dev
elopmentt
asks,
ther
ear
e
sev
eralst
epsi
ndesi
gni
ngadat
abasesy
stem.Her
emor
eemphasi
sisgi
vent
o
t
hedesi
gnphasesoft
hesy
stem dev
elopmentl
i
fecy
cle. Themaj
orst
epsi
n
dat
abasedesi
gnar
e;
1.Pl
anni
ng:t
hati
sident
if
yingi
nfor
mat
iongapi
nanor
gani
zat
ionandpr
oposea
dat
abasesol
uti
ont
osol
vet
hepr
obl
em.
2.Anal
ysi
s:t
hatconcent
rat
esmor
eonf
actf
indi
ngaboutt
hepr
obl
em ort
he
oppor
tuni
ty.Feasi
bil
i
tyanal
ysi
s,r
equi
rementdet
ermi
nat
ionandst
ruct
uri
ng,
andsel
ect
ionofbestdesi
gnmet
hodar
eal
soper
for
medatt
hisphase.
3.Desi
gn:i
ndat
abasedesi
gni
ngmor
eemphasi
sisgi
vent
othi
sphase.The
phasei
sfur
therdi
vi
dedi
ntot
hreesub-
phases.
a.Concept
ualDesi
gn:conci
sedescr
ipt
ionoft
hedat
a,dat
aty
pe,
rel
ati
onshi
p
bet
weendat
aandconst
rai
ntsont
hedat
a.
Ther
eisnoi
mpl
ement
ati
onorphy
sical
det
ail
consi
der
ati
on.
Usedt
oel
i
citandst
ruct
ureal
li
nfor
mat
ionr
equi
rement
s
b.Logi
calDesi
gn:a hi
gherl
evelconcept
ualabst
ract
ion wi
th sel
ect
ed
speci
fi
cdat
amodel
toi
mpl
ementt
hedat
ast
ruct
ure.
I
tis par
ti
cul
arDBMS i
ndependentand wi
th no ot
herphy
sical
consi
der
ati
ons.
c.Phy
sicalDesi
gn:phy
sicali
mpl
ement
ati
onoft
heupperl
eveldesi
gnoft
he
dat
abase wi
thr
espectt
oint
ernalst
orage and f
il
e st
ruct
ure oft
he
dat
abasef
ort
hesel
ect
edDBMS.
Todev
elopal
ltechnol
ogyandor
gani
zat
ional
speci
fi
cat
ion.
4.I
mpl
ement
ati
on:t
hedepl
oymentandt
est
ingoft
hedesi
gneddat
abasef
or
use.
5.Oper
ati
onandSuppor
t:admi
nist
eri
ngandmai
ntai
ningt
heoper
ati
onoft
he
dat
abasesy
stem andpr
ovi
dingsuppor
ttouser
s.
14
Rol
esi
nDat
abaseDesi
gnandUse
Aspeopl
ear
eoneoft
hecomponent
sinDBMSenv
ironment
,ther
ear
egr
oupof
r
olespl
ayed bydi
ff
erentst
akehol
der
soft
he desi
gni
ng and oper
ati
on ofa
dat
abasesy
stem.
1.Dat
abaseAdmi
nist
rat
or(
DBA)
Responsi
blet
oov
ersee,cont
rolandmanaget
hedat
abaser
esour
ces(
the
dat
abasei
tsel
f,t
heDBMSandot
herr
elat
edsof
twar
e)
Aut
hor
izi
ngaccesst
othedat
abase
Coor
dinat
ingandmoni
tor
ingt
heuseoft
hedat
abase
Responsi
ble f
or det
ermi
ning and acqui
ri
ng har
dwar
e and sof
twar
e
r
esour
ces
Account
abl
eforpr
obl
ems l
i
ke poorsecur
it
y,poorper
for
mance oft
he
sy
stem
I
nvol
vesi
nal
lst
epsofdat
abasedev
elopment
Wecanhav
efur
thercl
assi
fi
cat
ionsoft
hisr
olei
nbi
gor
gani
zat
ionshav
inghuge
amountofdat
aanduserr
equi
rement
.
. Dat
I aAdmi
nist
rat
or(
DA)
:isr
esponsi
bleonmanagementofdat
a
r
esour
ces.I
nvol
vedi
ndat
abasepl
anni
ng,dev
elopment
,mai
ntenance
ofst
andar
ds,pol
i
ciesandpr
ocedur
esatt
heconcept
ualandl
ogi
cal
desi
gnphases.
I
I. Dat
abaseAdmi
nist
rat
or(
DBA)
:isamor
etechni
calr
ole.I
sresponsi
ble
f
ort
hephy
sicalr
eal
i
zat
ionoft
hedat
abase.I
nvol
vesi
nphy
sicaldesi
gn,
i
mpl
ement
ati
on,
secur
it
yandi
ntegr
it
ycont
rol
oft
hedat
abase.
2.Dat
abaseDesi
gner(
DBD)
I
dent
if
iest
hedat
atobest
oredandchooset
heappr
opr
iat
est
ruct
urest
orepr
esent
andst
oret
hedat
a.
Shoul
dunder
standt
heuserr
equi
rementandshoul
dchoosehow t
heuserv
iews
t
hedat
abase.
I
nvol
veont
hedesi
gnphasebef
oret
hei
mpl
ement
ati
onoft
hedat
abasesy
stem.
15
We hav
etwo di
sti
nct
ions ofdat
abase desi
gner
s,one i
nvol
vi
ng i
nthe l
ogi
caland
concept
ual
desi
gnandanot
heri
nvol
vi
ngi
nphy
sical
desi
gn.
3.Logi
calandConcept
ualDBD
a.I
dent
if
ies dat
a(ent
it
y,at
tri
but
es and r
elat
ionshi
p)r
elev
antt
othe
or
gani
zat
ion
b.I
dent
if
iesconst
rai
ntsoneachdat
a
c.Under
standdat
aandbusi
nessr
ulesi
ntheor
gani
zat
ion
d.Seest
hedat
abasei
ndependentofanydat
amodelatconcept
uall
evel
andconsi
deronespeci
fi
cdat
amodel
atl
ogi
cal
desi
gnphase.
Phy
sicalDBD
Takel
ogi
caldesi
gnspeci
fi
cat
ionasi
nputanddeci
dehowi
tshoul
dbe
phy
sical
l
yreal
i
zed.
Mapt
hel
ogi
caldat
amodelont
hespeci
fi
edDBMSwi
thr
espectt
o
t
abl
esandi
ntegr
it
yconst
rai
nts.(
DBMSdependentdesi
gni
ng)
Sel
ectspeci
fi
cst
oragest
ruct
ureandaccesspat
htot
hedat
abase
Desi
gnsecur
it
ymeasur
esr
equi
redont
hedat
abase
4.Appl
icat
ionPr
ogr
ammerandSy
stemsAnal
yst
Sy
stem anal
ystdet
ermi
nest
heuserr
equi
rementandhowt
heuserwant
stov
iew
t
hedat
abase.
Theappl
i
cat
ionpr
ogr
ammeri
mpl
ement
sthesespeci
fi
cat
ionsaspr
ogr
ams;
code,
t
est
,debug,
documentandmai
ntai
ntheappl
i
cat
ionpr
ogr
am.
Det
ermi
nest
hei
nter
faceonhowt
oret
ri
eve,
inser
t,updat
eanddel
etedat
aint
he
dat
abase.
Theappl
i
cat
ioncoul
duseanyhi
ghl
evelpr
ogr
ammi
ngl
anguageaccor
dingt
othe
av
ail
abi
l
ity
,thef
aci
l
ityandt
her
equi
redser
vice.
5.EndUser
s
Wor
ker
s,whosej
obr
equi
resaccessi
ngt
hedat
abasef
requent
lyf
orv
ari
ouspur
poses,
t
her
ear
edi
ff
erentgr
oupofuser
sint
hiscat
egor
y.
6.Naï
veUser
s:
i
.Si
zabl
epr
opor
ti
onofuser
s
16
i
i
.Unawar
eoft
heDBMS
i
i
i.Onl
yaccesst
hedat
abasebasedont
hei
raccessl
evel
anddemand
i
v.Usest
andar
dandpr
e-speci
fi
edt
ypesofquer
ies.
7.Sophi
sti
cat
edUser
s
i
.Ar
euser
sfami
l
iarwi
tht
hest
ruct
ureoft
heDat
abaseandf
aci
l
iti
esof
t
heDBMS.
i
i
.Hav
ecompl
exr
equi
rement
s
i
i
i.Hav
ehi
gherl
evel
quer
ies
i
v.Ar
emostoft
het
imeengi
neer
s,sci
ent
ist
s,busi
nessanal
yst
s,et
c
b.Casual
User
s
i
.User
swhoaccesst
hedat
abaseoccasi
onal
l
y.
i
i
.Needdi
ff
erenti
nfor
mat
ionf
rom t
hedat
abaseeacht
ime.
i
i
i.Usesophi
sti
cat
eddat
abasequer
iest
osat
isf
ythei
rneeds.
i
v.Ar
emostoft
het
imemi
ddl
etohi
ghl
evel
manager
s.
Theseuser
scanbeagai
ncl
assi
fi
edas“
Act
orsont
heScene”and“
Wor
ker
sBehi
ndt
he
Scene”
.
Act
orsont
heScene:
Dat
aAdmi
nist
rat
or
Dat
abaseAdmi
nist
rat
or
Dat
abaseDesi
gner
EndUser
s
Wor
ker
sbehi
ndt
heScene
DBMSdesi
gner
sandi
mpl
ement
ers:whodesi
gnandi
mpl
ementdi
ff
erentDBMS
sof
twar
e.
ToolDev
eloper
s:exper
ts who dev
elop sof
twar
e packages t
hatf
aci
l
itat
es
dat
abasesy
stem desi
gni
ng and use.Pr
otot
ype,si
mul
ati
on,codegener
ator
dev
eloper
scoul
dbeanexampl
e.I
ndependentsof
twar
evendor
scoul
dal
sobe
cat
egor
izedi
nthi
sgr
oup.
Oper
ator
s and Mai
ntenance Per
sonnel
:sy
stem admi
nist
rat
ors who ar
e
r
esponsi
blef
oract
ual
l
yrunni
ngandmai
ntai
ningt
hehar
dwar
eandsof
twar
eof
t
hedat
abasesy
stem andt
hei
nfor
mat
iont
echnol
ogyf
aci
l
iti
es.
17
18
ANSI
-SPARCAr
chi
tect
ure
The pur
pose and or
igi
n of t
he Thr
ee-
Lev
el dat
abase
ar
chi
tect
ure
Al
luser
sshoul
d beabl
eto accesssamedat
a.Thi
sisi
mpor
tantsi
ncet
he
dat
abasei
shav
ingashar
eddat
afeat
urewher
eal
lthedat
aisst
oredi
none
l
ocat
ionandal
luser
swi
l
lhav
ethei
rowncust
omi
zedwayofi
nter
act
ingwi
tht
he
dat
a.
Auser
'sv
iewi
sunaf
fect
edori
mmunet
ochangesmadei
not
herv
iews.Si
ncet
he
r
equi
rementofoneuseri
sindependentoft
heot
her
,achangemadei
noneuser
’s
v
iewshoul
dnotaf
fectot
heruser
s.
User
sshoul
dnotneedt
oknow phy
sicaldat
abasest
oragedet
ail
s.Ast
her
ear
e
naï
veuser
soft
hesy
stem,har
dwar
elev
elorphy
sicaldet
ail
sshoul
dbeabl
ack-
boxf
orsuchuser
s.
DBAshoul
dbeabl
etochangedat
abasest
oragest
ruct
ureswi
thoutaf
fect
ingt
he
user
s'v
iews.Achangei
nfi
l
eor
gani
zat
ion,accessmet
hodshoul
dnotaf
fectt
he
st
ruct
ureoft
hedat
awhi
chi
ntur
nwi
l
lhav
enoef
fectont
heuser
s.
I
nter
nalst
ruct
ure ofdat
abase shoul
d be unaf
fect
ed bychangest
o phy
sical
aspect
sofst
orage.
DBAshoul
dbeabl
etochangeconcept
ualst
ruct
ureofdat
abasewi
thoutaf
fect
ing
al
luser
s.I
nanydat
abasesy
stem,t
heDBAwi
l
lhav
ethepr
ivi
l
eget
ochanget
he
st
ruct
ureoft
hedat
abase,l
i
keaddi
ngt
abl
es,addi
nganddel
eti
nganat
tri
but
e,
changi
ngt
hespeci
fi
cat
ionoft
heobj
ect
sint
hedat
abase.
Al
ltheabov
eandmuchot
herf
unct
ional
i
tyar
epossi
bleduet
othet
hreel
evel
ANSI
-SPARCar
chi
tect
ure.
19
Thr
ee-
lev
elANSI
-SPARCAr
chi
tect
ureofaDat
abase
ANSI
-SPARCAr
chi
tect
ureandDat
abaseDesi
gnPhases
Ext
ernalLev
el:User
s'v
iew oft
he dat
abase.Descr
ibest
hatpar
toft
he
dat
abaset
hati
srel
evantt
oapar
ti
cul
aruser
.Di
ff
erentuser
shav
ethei
rown
cust
omi
zedv
iewoft
hedat
abasei
ndependentofot
heruser
s.
Concept
ualLev
el:Communi
tyv
iewoft
hedat
abase.Descr
ibeswhatdat
ais
st
oredi
ndat
abaseandr
elat
ionshi
psamongt
hedat
a.
I
nter
nalLev
el:Phy
sicalr
epr
esent
ati
onoft
hedat
abaseont
hecomput
er.
20
Descr
ibeshowt
hedat
aisst
oredi
nthedat
abase.
Thef
oll
owi
ngexampl
ecanbet
akenasani
ll
ust
rat
ionf
ort
hedi
ff
erence
bet
weent
het
hreel
evel
sint
heANSI
-SPARCdat
abaseAr
chi
tect
ure.Wher
e:
Thef
ir
stl
eveli
sconcer
nedaboutt
hegr
oupofuser
sandt
hei
r
r
espect
ivedat
arequi
rementi
ndependentoft
heot
her
.
Thesecondl
eveli
sdescr
ibi
ngt
hewhol
econt
entoft
hedat
abase
wher
eonepi
eceofi
nfor
mat
ionwi
l
lber
epr
esent
edonce.
Thet
hir
dlev
elDi
ff
erencesbet
weenThr
eeLev
elsofANSI
-SPARC
Ar
chi
tect
ure
DBMSschemasatt
hreel
evel
s:
I
nter
nalschema:att
he i
nter
nall
evelt
o descr
ibe phy
sicalst
orage
st
ruct
uresandaccesspat
hs.Ty
pical
l
yusesaphy
sical
dat
amodel
.
Concept
ualschema:att
heconcept
uall
evelt
odescr
ibet
hest
ruct
ureand
const
rai
ntsf
ort
hewhol
edat
abasef
oracommuni
tyofuser
s.Usesa
concept
ual
orani
mpl
ement
ati
ondat
amodel
.
21
Ext
ernalschema:att
heext
ernall
evelt
odescr
ibet
hev
ari
oususerv
iews.
Usual
l
yusest
hesamedat
amodel
ast
heconcept
ual
lev
el.
Dat
aIndependence
Logi
calDat
aIndependence:
Ref
erst
oimmuni
tyofext
ernalschemas t
o changes i
n concept
ual
schema.
Concept
ualschemachangese.
g.addi
ti
on/
remov
alofent
it
iesshoul
dnot
r
equi
rechangest
oext
ernal
schemaorr
ewr
it
esofappl
i
cat
ionpr
ogr
ams.
The capaci
tyt
o change t
he concept
ualschema wi
thouthav
ing t
o
changet
heext
ernal
schemasandt
hei
rappl
i
cat
ionpr
ogr
ams.
Phy
sicalDat
aIndependence
Theabi
l
ityt
omodi
fyt
hephy
sicalschemawi
thoutchangi
ngt
hel
ogi
cal
schema
Appl
i
cat
ionsdependont
hel
ogi
cal
schema
I
ngener
al,t
hei
nter
facesbet
weent
hev
ari
ousl
evel
sandcomponent
s
shoul
dbewel
ldef
inedsot
hatchangesi
nsomepar
tsdonotser
iousl
y
i
nfl
uenceot
her
s.
Thecapaci
tyt
ochanget
hei
nter
nalschemawi
thouthav
ingt
ochange
t
heconcept
ual
schema
Ref
erst
oimmuni
tyofconcept
ualschemat
ochangesi
nthei
nter
nal
schema
I
nter
nalschemachangese.
g.usi
ngdi
ff
erentf
il
eor
gani
zat
ions,st
orage
st
ruct
ures/
dev
icesshoul
dnotr
equi
rechanget
oconcept
ualorext
ernal
schemas.
22
3.Dat
abaseLanguages
Dat
aDef
ini
ti
onLanguage(
DDL)
Al
l
owsDBA orusert
o descr
ibeand nameent
it
les,at
tr
ibut
esand
r
elat
ionshi
psr
equi
redf
ort
heappl
i
cat
ion.
Speci
fi
cat
ionnot
ati
onf
ordef
ini
ngt
hedat
abaseschema
Dat
aMani
pul
ati
onLanguage(
DML)
Pr
ovi
des basi
c dat
a mani
pul
ati
on oper
ati
ons on dat
a hel
dint
he
dat
abase.
Languagef
oraccessi
ngandmani
pul
ati
ngt
hedat
aor
gani
zedbyt
he
appr
opr
iat
edat
amodel
DMLal
soknownasquer
ylanguage
Pr
ocedur
alDML:userspeci
fi
eswhatdat
aisr
equi
redandhowt
ogett
hedat
a.
Non-
Procedur
alDML:userspeci
fi
eswhatdat
aisr
equi
redbutnothowi
tist
obe
r
etr
iev
ed
Dat
aCont
rolLanguageDCL:usedt
odef
inet
hesecur
it
yont
hedat
aint
he
dat
abase.
SQLi
sthemostwi
del
yusednon-
procedur
all
anguage,
quer
ylanguage
Four
thGener
ati
onLanguages(
4GL)
23
Quer
yLanguages
For
msGener
ator
s
Repor
tGener
ator
s
Gr
aphi
csGener
ator
s
Appl
i
cat
ionGener
ator
s
4.ACl
assi
fi
cat
ionofdat
amodel
s
Aspeci
fi
cDBMShasi
tsownspeci
fi
cDat
aDef
ini
ti
onLanguage,butt
hist
ypeof
l
anguagei
stool
owl
evelt
odescr
ibet
hedat
arequi
rement
sofanor
gani
zat
ioni
n
awayt
hati
sreadi
l
yunder
standabl
ebyav
ari
etyofuser
s.Weneedahi
gher
-l
evel
l
anguage.Suchahi
gher
-l
evel
iscal
l
eddat
a-model
.
Dat
aModel
:asetofconcept
stodescr
ibet
hest
ruct
ureofadat
abase,and
cer
tai
nconst
rai
ntst
hatt
hedat
abaseshoul
dobey
.Adat
amodel
i
sadescr
ipt
ion
oft
hewayt
hatdat
aisst
oredi
nadat
abase.Dat
amodelhel
pst
ounder
standt
he
r
elat
ionshi
pbet
weenent
it
iesandt
ocr
eat
ethemostef
fect
ivest
ruct
uret
ohol
d
dat
a.Dat
aModeli
sacol
l
ect
ionoft
ool
sorconcept
sfordescr
ibi
ng
Dat
a
Dat
arel
ati
onshi
ps
Dat
asemant
ics
Dat
aconst
rai
nts
Themai
npur
poseofDat
aModeli
stor
epr
esentt
hedat
ainanunder
standabl
e
way
.
Cat
egor
iesofdat
amodel
sincl
ude:
Obj
ect
-based
Recor
d-based
Phy
sical
Recor
d-basedDat
aModel
s
Consi
stofanumberoff
ixedf
ormatr
ecor
ds.
Eachr
ecor
dty
pedef
inesaf
ixednumberoff
iel
ds,
Eachf
iel
dist
ypi
cal
l
yofaf
ixedl
engt
h.
Hi
erar
chi
cal
Dat
aModel
24
Net
wor
kDat
aModel
Rel
ati
onal
Dat
aModel
1.
Hier
archi
calModel
Thesi
mpl
estdat
amodel
Recor
dty
pei
sref
err
edt
oasnodeorsegment
Thet
opnodei
sther
ootnode
Nodesar
ear
rangedi
nahi
erar
chi
calst
ruct
ureassor
tofupsi
de-
downt
ree
Apar
entnodecanhav
emor
ethanonechi
l
dnode
Achi
l
dnodecanonl
yhav
eonepar
entnode
Ther
elat
ionshi
pbet
weenpar
entandchi
l
disone-
to-
many
Rel
ati
oni
sest
abl
i
shedbycr
eat
ingphy
sicall
i
nkbet
weenst
ored
r
ecor
ds(
eachi
sst
oredwi
thapr
edef
inedaccesspat
htoot
her
r
ecor
ds)
To addnew r
ecor
dty
peorr
elat
ionshi
p,t
hedat
abasemustbe
r
edef
inedandt
henst
oredi
nanewf
orm.
Depar
tment
Empl
oyee Job
Ti
meCar
d Act
ivi
ty
ADVANTAGESofHi
erar
chi
cal
Dat
aModel
:
Hi
erar
chi
cal
Model
issi
mpl
etoconst
ructandoper
ateon
Cor
respondst
oanumberofnat
uralhi
erar
chi
cal
l
yor
gani
zeddomai
ns-
25
e.
g.,
assembl
i
esi
nmanuf
act
uri
ng,
per
sonnel
organi
zat
ioni
ncompani
es
Languagei
ssi
mpl
e;usesconst
ruct
sli
keGET,GETUNI
QUE,GETNEXT,
GETNEXTWI
THI
NPARENTet
c.
DI
SADVANTAGESofHi
erar
chi
cal
Dat
aModel
:
Nav
igat
ional
andpr
ocedur
alnat
ureofpr
ocessi
ng
Dat
abasei
svi
sual
i
zedasal
i
nearar
rangementofr
ecor
ds
Li
tt
lescopef
or"
quer
yopt
imi
zat
ion"
2.
Net
wor
kModel
Al
l
owsr
ecor
dty
pest
ohav
emor
ethanonepar
entunl
i
kehi
erar
chi
cal
model
Anet
wor
kdat
amodel
sseesr
ecor
dsassetmember
s
Eachsethasanownerandoneormor
emember
s
Al
l
ownomanyt
omanyr
elat
ionshi
psbet
weenent
it
ies
Li
kehi
erar
chi
calmodelnet
wor
kmodeli
sacol
l
ect
ionofphy
sical
l
y
l
i
nkedr
ecor
ds.
Al
l
owmemberr
ecor
dst
ohav
emor
ethanoneowner
Depar
tment Job
Empl
oyee
Act
ivi
ty
Ti
meCar
d
ADVANTAGESofNet
wor
kDat
aModel
:
26
Net
wor
kModeli
sabl
etomodelcompl
exr
elat
ionshi
psandr
epr
esent
s
semant
icsofadd/
del
eteont
her
elat
ionshi
ps.
Can handl
e mostsi
tuat
ions f
or model
i
ng usi
ng r
ecor
dty
pes and
r
elat
ionshi
pty
pes.
Languagei
snav
igat
ional
;usesconst
ruct
sli
keFI
ND,FI
NDmember
,FI
ND
owner
,FI
ND NEXT wi
thi
nset
,GET et
c.Pr
ogr
ammer
scando opt
imal
nav
igat
iont
hrought
hedat
abase.
DI
SADVANTAGESofNet
wor
kDat
aModel
:
Nav
igat
ional
andpr
ocedur
alnat
ureofpr
ocessi
ng
Dat
abasecont
ainsacompl
exar
rayofpoi
nter
sthatt
hreadt
hroughaset
ofr
ecor
ds.
Li
tt
lescopef
oraut
omat
ed"
quer
yopt
imi
zat
ion”
3.
Rel
ati
onalDat
aModel
Dev
eloped by Dr
.EdgarFr
ank Codd i
n 1970 (
famous paper
,'A
Rel
ati
onal
Model
forLar
geShar
edDat
aBanks'
)
Ter
minol
ogi
esor
igi
nat
esf
rom t
hebr
anchofmat
hemat
icscal
l
edset
t
heor
yandr
elat
ion
Candef
inemor
efl
exi
bleandcompl
exr
elat
ionshi
p
Vi
ewed as a col
l
ect
ion oft
abl
es cal
l
ed “
Rel
ati
ons”equi
val
entt
o
col
l
ect
ionofr
ecor
dty
pes
Rel
ati
on:
Twodi
mensi
onal
tabl
e
St
oresi
nfor
mat
ionordat
aint
hef
orm oft
abl
es r
owsandcol
umns
Ar
owoft
het
abl
eiscal
l
edt
upl
e equi
val
entt
orecor
d
Acol
umnofat
abl
eiscal
l
edat
tri
but
e equi
val
entt
ofi
elds
Dat
aval
uei
sthev
alueoft
heAt
tri
but
e
Recor
dsar
erel
atedbyt
hedat
ast
oredj
oint
lyi
nthef
iel
dsofr
ecor
dsi
n
t
wot
abl
esorf
il
es.Ther
elat
edt
abl
escont
aini
nfor
mat
iont
hatcr
eat
es
t
her
elat
ion
Thet
abl
esseem t
obei
ndependentbutar
erel
atedsomehow.
27
Nophy
sical
consi
der
ati
onoft
hest
oragei
srequi
redbyt
heuser
Manyt
abl
esar
emer
gedt
oget
hert
ocomeupwi
thanewv
irt
ualv
iewof
t
her
elat
ionshi
p
Al
ter
nat
ivet
ermi
nol
ogi
es
Rel
ati
on Tabl
e Fi
l
e
Tupl
e Row Recor
d
At
tri
but
e Col
umn Fi
eld
Ther
owsr
epr
esentr
ecor
ds(
col
l
ect
ionsofi
nfor
mat
ionaboutsepar
ate
i
tems)
Thecol
umnsr
epr
esentf
iel
ds(
par
ti
cul
arat
tr
ibut
esofar
ecor
d)
Conduct
ssear
chesbyusi
ngdat
ainspeci
fi
edcol
umnsofonet
abl
etof
ind
addi
ti
onal
dat
ainanot
hert
abl
e
I
nconduct
ingsear
ches,
arel
ati
onaldat
abasemat
chesi
nfor
mat
ionf
rom a
f
iel
dinonet
abl
ewi
thi
nfor
mat
ioni
nacor
respondi
ngf
iel
dofanot
hert
abl
e
t
opr
oduceat
hir
dtabl
ethatcombi
nesr
equest
eddat
afr
om bot
htabl
es
28
Chapt
ert
wo
Rel
ati
onal
Dat
aModel
2.
1. Pr
oper
ti
esofRel
ati
onalDat
abases
Eachr
owofat
abl
eisuni
quel
yident
if
iedbyaPRI
MARYKEYcomposed
ofoneormor
ecol
umns
Eacht
upl
einar
elat
ionmustbeuni
que
Gr
oupofcol
umns,t
hatuni
quel
yident
if
iesar
ow i
nat
abl
eiscal
l
eda
CANDI
DATEKEY
ENTI
TYI
NTEGRI
TYRULEoft
hemodelst
atest
hatnocomponentof
t
hepr
imar
ykeymaycont
ainaNULLv
alue.
Acol
umnorcombi
nat
ionofcol
umnst
hatmat
chest
hepr
imar
ykeyof
anot
hert
abl
eiscal
l
edaFOREI
GNKEY.Usedt
ocr
oss-
ref
erencet
abl
es.
TheREFERENTI
ALI
NTEGRI
TYRULEoft
hemodelst
atest
hat
,forev
ery
f
orei
gnkeyv
aluei
nat
abl
ether
emustbeacor
respondi
ngpr
imar
ykey
v
aluei
nanot
hert
abl
eint
hedat
abaseori
tshoul
dbeNULL.
Al
ltabl
esar
eLOGI
CALENTI
TIES
At
abl
eis ei
thera BASE TABLES (
Named Rel
ati
ons)orVI
EWS
(
UnnamedRel
ati
ons)
Onl
yBaseTabl
esar
ephy
sical
l
yst
ores
VI
EWS ar
eder
ived f
rom BASE TABLES wi
th SQL i
nst
ruct
ionsl
i
ke:
[
SELECT.
FROM.WHERE.
ORDERBY]
I
sthecol
l
ect
ionoft
abl
es
o Eachent
it
yinonet
abl
e
o At
tri
but
esar
efi
elds(
col
umns)i
ntabl
e
Or
derofr
owsandcol
umnsi
simmat
eri
al
Ent
ri
eswi
thr
epeat
inggr
oupsar
esai
dtobeun-
nor
mal
i
zed
Ent
ri
esar
esi
ngl
e-v
alued
29
Eachcol
umn(
fi
eldorat
tri
but
e)hasadi
sti
nctname
Al
lval
uesi
nacol
umnr
epr
esentt
hesameat
tri
but
eandhav
ethesamedat
a
f
ormat
2.
2. Bui
ldi
ngBl
ocksoft
heRel
ati
onalDat
aModel
Thebui
l
dingbl
ocksoft
her
elat
ional
dat
amodel
are:
Ent
it
ies:
real
wor
ldphy
sical
orl
ogi
cal
obj
ect
At
tr
ibut
es:
proper
ti
esusedt
odescr
ibeeachEnt
it
yorr
eal
wor
ldobj
ect
.
Rel
ati
onshi
p:t
heassoci
ati
onbet
weenEnt
it
ies
Const
rai
nts:
rul
est
hatshoul
dbeobey
edwhi
l
emani
pul
ati
ngt
hedat
a.
1.TheENTI
TIES(
per
sons,pl
aces,t
hingset
c.)whi
cht
heor
gani
zat
ionhast
o
deal
wit
h.Rel
ati
onscanal
sodescr
iber
elat
ionshi
ps
Thenamegi
vent
oanent
it
yshoul
dal
way
sbeasi
ngul
arnoundescr
ipt
iveofeach
i
tem t
obest
oredi
nit
.E.
g.:
studentNOTst
udent
s.
Ev
eryr
elat
ionhasaschema,whi
chdescr
ibest
hecol
umns,orf
iel
dst
her
elat
ion
i
tsel
fcor
respondst
oourf
ami
l
iarnot
ionofat
abl
e:
Ar
elat
ioni
sacol
l
ect
ionoft
upl
es,eachofwhi
chcont
ainsv
aluesf
oraf
ixed
numberofat
tri
but
es
Exi
stenceDependency
:thedependenceofanent
it
yont
heexi
stenceofone
ormor
eent
it
ies.
Weakent
it
y:anent
it
ythatcannotexi
stwi
thoutt
heent
it
ywi
thwhi
chi
thasa
r
elat
ionshi
p–i
tisi
ndi
cat
edbyadoubl
erect
angl
e
2.TheATTRI
BUTES-t
hei
temsofi
nfor
mat
ionwhi
chchar
act
eri
zeanddescr
ibe
t
heseent
it
ies. At
tr
ibut
esar
epi
ecesofi
nfor
mat
ionABOUT ent
it
ies.The
anal
ysi
smustofcour
sei
dent
if
ythosewhi
char
eact
ual
l
yrel
evantt
othe
pr
oposedappl
i
cat
ion.At
tri
but
eswi
l
lgi
ver
iset
orecor
dedi
temsofdat
aint
he
dat
abaseAtt
hisl
evel
weneedt
oknowsucht
hingsas:
At
tri
but
ename(
beexpl
anat
orywor
dsorphr
ases)
Thedomai
nfr
om whi
chat
tri
but
eval
uesar
etaken(
ADOMAI
Nis
asetofv
aluesf
rom whi
chat
tri
but
eval
uesmaybet
aken.
)Each
30
at
tri
but
ehasv
aluest
akenf
rom adomai
n. Forexampl
e,t
he
domai
nofNamei
sst
ri
ngandt
hatf
orsal
aryi
sreal
Whet
hert
heat
tri
but
eispar
toft
heent
it
yident
if
ier(
att
ri
but
es
whi
chj
ustdescr
ibeanent
it
yandt
hosewhi
chhel
ptoi
dent
if
yit
uni
quel
y)
Whet
heri
tisper
manentort
ime-
var
ying(
whi
chat
tr
ibut
esmay
changet
hei
rval
uesov
ert
ime)
Whet
heri
tisr
equi
redoropt
ionalf
ort
heent
it
y(whosev
alues
wi
l
lsomet
imesbeunknownori
rr
elev
ant
)
Ty
pesofAt
tri
but
es
(
1)Si
mpl
e(at
omi
c)Vs.Composi
teat
tri
but
es
Si
mpl
e:cont
ainsasi
ngl
eval
ue(
notdi
vi
dedi
ntosubpar
ts)E.
g.
Age,
gender
Composi
te:Di
vi
dedi
ntosubpar
ts(
composedofot
herat
tr
ibut
es)
E.
g.Name,
addr
ess
(
2)Si
ngl
e-v
aluedVsmul
ti
-val
uedat
tri
but
es
Si
ngl
e-v
alued:hav
eonl
ysi
ngl
eval
ue(
thev
aluemaychangebut
hasonl
yonev
alueatonet
ime)E.
g.Name,Sex,I
d.No.col
orof
ey
es
Mul
ti
-Val
ued:hav
emor
ethanonev
alueE.
g.Addr
ess,dependent
-
namePer
sonmayhav
esev
eral
col
l
egedegr
ees
(
3)St
oredv
s.Der
ivedAt
tri
but
e
St
ored:
notpossi
blet
oder
iveorcomput
eE.
g.Name,
Addr
ess
Der
ived:Thev
aluemaybeder
ived(
comput
ed)f
rom t
hev
aluesof
ot
herat
tri
but
es.E.
g.Age(
cur
renty
ear–y
earofbi
rt
h)Lengt
hof
empl
oyment(
cur
rentdat
e-st
artdat
e)Pr
ofi
t(ear
ning-
cost
)G.
P.A
(
gradepoi
nt/
credi
thour
s)
(
4)Nul
lVal
ues
NULLappl
i
est
oat
tri
but
eswhi
char
enotappl
i
cabl
eorwhi
chdo
nothav
eval
ues.
31
Youmayent
ert
hev
alueNA(
meani
ngnotappl
i
cabl
e)
Val
ueofakeyat
tri
but
ecannotbenul
l
.
Def
aul
tval
ue-assumedv
aluei
fnoexpl
i
citv
alue
Ent
it
yver
susAt
tri
but
es
Whendesi
gni
ngt
heconcept
ualspeci
fi
cat
ionoft
hedat
abase,oneshoul
dpay
at
tent
iont
othedi
sti
nct
ionbet
weenanEnt
it
yandanAt
tr
ibut
e.
Consi
derdesi
gni
ngadat
abaseofempl
oyeesf
oranor
gani
zat
ion:
Shoul
daddr
essbeanat
tri
but
eofEmpl
oyeesoranent
it
y(connect
edt
o
Empl
oyeesbyar
elat
ionshi
p)?
1.I
fwe hav
e sev
eraladdr
essesperempl
oyee,addr
essmustbe an ent
it
y
(
att
ri
but
escannotbeset
-val
ued/
mul
tiv
alued)
2.I
fthest
ruct
ure(
cit
y,Wor
eda,Kebel
e,et
c)i
simpor
tant
,e.
g.wantt
oret
ri
eve
empl
oyeesi
nagi
venci
ty,addr
essmustbemodel
edasanent
it
y(at
tr
ibut
e
v
aluesar
eat
omi
c)
3.TheRELATI
ONSHI
PSbet
weenent
it
ieswhi
chexi
standmustbet
akeni
nto
accountwhenpr
ocessi
ngi
nfor
mat
ion.I
nanybusi
nesspr
ocessi
ngoneobj
ect
maybeassoci
atedwi
thanot
herobj
ectduet
osomeev
ent
.Suchki
ndof
associ
ati
oni
swhatwecal
laRELATI
ONSHI
Pbet
weenent
it
yobj
ect
s.
Oneext
ernal
eventorpr
ocessmayaf
fectsev
eral
rel
atedent
it
ies.
Rel
atedent
it
iesr
equi
reset
ti
ngofLI
NKSf
rom onepar
toft
hedat
abase
t
oanot
her
.
Ar
elat
ionshi
pshoul
dbenamedbyawor
dorphr
asewhi
chexpl
ainsi
ts
f
unct
ion
Rol
e names ar
e di
ff
erentf
rom t
he names ofent
it
ies f
ormi
ng t
he
r
elat
ionshi
p:oneent
it
ymayt
akeonmanyr
oles,t
hesamer
olemaybe
pl
ayedbydi
ff
erentent
it
ies
ForeachRELATI
ONSHI
P,onecant
alkaboutt
heNumberofEnt
it
iesand
t
he NumberofTupl
es par
ti
cipat
ing i
nthe associ
ati
on.These t
wo
concept
s ar
e cal
l
ed DEGREE and CARDI
NALI
TY ofa r
elat
ionshi
p
32
r
espect
ivel
y.
Degr
eeofaRel
ati
onshi
p
Ani
mpor
tantpoi
ntaboutar
elat
ionshi
pishowmanyent
it
iespar
ti
cipat
e
i
nit
.Thenumberofent
it
iespar
ti
cipat
ingi
nar
elat
ionshi
piscal
l
edt
he
DEGREEoft
her
elat
ionshi
p.
Amongt
heDegr
eesofr
elat
ionshi
p,t
hef
oll
owi
ngar
ethebasi
c:
O UNARY/
RECURSI
VERELATI
ONSHI
P:Tupl
e/r
ecor
dsofaSi
ngl
eent
it
yar
e
r
elat
edwi
theachot
her
.
O BI
NARYRELATI
ONSHI
PS:
Tupl
es/
recor
dsoft
woent
it
iesar
eassoci
atedi
n
ar
elat
ionshi
p
O TERNARY RELATI
ONSHI
P:Tupl
e/r
ecor
dsoft
hreedi
ff
erentent
it
iesar
e
associ
ated
o Andagener
ali
zedone:
N-
NARYRELATI
ONSHI
P:Tupl
efr
om ar
bit
rar
ynumberofent
it
yset
s
ar
epar
ti
ci
pat
ingi
nar
elat
ionshi
p.
Car
dinal
it
yofaRel
ati
onshi
p
Anot
heri
mpor
tantconceptaboutr
elat
ionshi
pist
henumberofi
nst
ances/
tupl
e
t
hatcan be associ
ated wi
th a si
ngl
einst
ance f
rom one ent
it
yin a si
ngl
e
r
elat
ionshi
p.Thenumberofi
nst
ancespar
ti
cipat
ingorassoci
atedwi
thasi
ngl
e
i
nst
ancef
rom an ent
it
yin ar
elat
ionshi
piscal
l
ed t
heCARDI
NALI
TY oft
he
r
elat
ionshi
p.Themaj
orcar
dinal
i
tiesofar
elat
ionshi
par
e:
o ONE-
TO-
ONE:onet
upl
eisassoci
ated wi
th onl
yoneot
hert
upl
e.E.
g.
Bui
l
ding–Locat
ion asasi
ngl
ebui
l
dingwi
l
lbel
ocat
edi
nasi
ngl
elocat
ion
andasasi
ngl
elocat
ionwi
l
lonl
yaccommodat
easi
ngl
eBui
l
ding.
o ONE-
TO-
MANY,onet
upl
ecanbeassoci
atedwi
thmanyot
hert
upl
e,but
nott
her
ever
se.E.
g.Depar
tment
-St
udent asonedepar
tmentcanhav
e
mul
ti
plest
udent
s.
o MANY-
TO-
ONE,manyt
upl
ear
eassoci
atedwi
thonet
upl
ebutnott
he
r
ever
se.E.
g.Empl
oyee– Depar
tment
:asmanyempl
oyeesbel
ongt
oa
33
si
ngl
edepar
tment
.
o MANY-
TO-
MANY:onet
upl
eisassoci
atedwi
thmanyot
hert
upl
eandf
rom
t
heot
hersi
de,
wit
hadi
ff
erentr
olenameonet
upl
ewi
l
lbeassoci
atedwi
th
manyt
upl
e.E.
g.St
udent–Cour
seasast
udentcant
akemanycour
ses
andasi
ngl
ecour
secanbeat
tendedbymanyst
udent
s.
2.
3.Rel
ati
onalConst
rai
nts/
Int
egr
it
yRul
es
Rel
ati
onalI
ntegr
it
y
Domai
nInt
egr
it
y:Nov
alueoft
heat
tr
ibut
eshoul
dbebey
ond
t
heal
l
owabl
eli
mit
s
Ent
it
yInt
egr
it
y:I
nabaser
elat
ion,noat
tr
ibut
eofaPr
imar
y
Keycanassumeav
alueofNULL
Ref
erent
ialI
ntegr
it
y:I
faFor
eignKeyexi
stsi
nar
elat
ion,
ei
thert
heFor
eignKeyv
aluemustmat
chaCandi
dat
eKey
v
aluei
nit
shomer
elat
ionort
heFor
eignKeyv
aluemust
beNULL
Ent
erpr
iseI
ntegr
it
y:Addi
ti
onalr
ulesspeci
fi
edbyt
heuser
sor
dat
abaseadmi
nist
rat
orsofadat
abasear
eincor
por
ated
Keyconst
rai
nts
I
ftupl
ear
eneedt
obeuni
quei
nthedat
abase,andt
henweneedt
omakeeach
t
upl
edi
sti
nct
.Todot
hisweneedt
ohav
erel
ati
onalkey
sthatuni
quel
yident
if
y
eachr
elat
ion.
SuperKey
:anat
tri
but
eorsetofat
tri
but
est
hatuni
quel
yident
if
iesat
upl
e
wi
thi
nar
elat
ion.
Candi
dat
eKey
:asuperkeysucht
hatnopr
opersubsetoft
hatcol
l
ect
ioni
s
a SuperKeywi
thi
nthe r
elat
ion.A candi
dat
e keyhas t
wo pr
oper
ti
es:
Uni
quenessandI
rr
educi
bil
i
ty.I
fasuperkeyi
shav
ingonl
yoneat
tr
ibut
e,i
t
i
saut
omat
ical
l
yaCandi
dat
ekey
.Ifacandi
dat
ekeyconsi
stsofmor
ethan
oneat
tri
but
eiti
scal
l
edComposi
teKey
.
34
Pr
imar
yKey
:thecandi
dat
ekeyt
hati
ssel
ect
edt
oident
if
ytupl
esuni
quel
y
wi
thi
nthe r
elat
ion.The ent
ir
e setofat
tr
ibut
es i
nar
elat
ion can be
consi
der
edasapr
imar
ycasei
nawor
stcase.
For
eignKey
:anat
tri
but
e,orsetofat
tri
but
es,wi
thi
noner
elat
iont
hat
mat
chest
hecandi
dat
ekeyofsomer
elat
ion.A f
orei
gn keyi
sal
i
nk
bet
weendi
ff
erentr
elat
ionst
ocr
eat
ethev
iewort
heunnamedr
elat
ion
2.
3. Rel
ati
onalVi
ews
Rel
ati
onsar
eper
cei
vedasaTabl
efr
om t
heuser
s’per
spect
ive.Act
ual
l
y,t
her
ear
e
t
woki
ndsofr
elat
ioni
nrel
ati
onaldat
abase.Thet
wocat
egor
iesort
ypesof
Rel
ati
onsar
eNamedandUnnamedRel
ati
ons.Thebasi
cdi
ff
erencei
sonhowt
he
r
elat
ioni
scr
eat
ed,
usedandupdat
ed:
1.BaseRel
ati
on
ANamedRel
ati
oncor
respondi
ngt
oanent
it
yint
heconcept
ualschema,whose
t
upl
esar
ephy
sical
l
yst
oredi
nthedat
abase.
2.Vi
ew(
UnnamedRel
ati
on)
AVi
ew i
sthedy
nami
cresul
tofoneormor
erel
ati
onaloper
ati
onsoper
ati
ngon
t
hebaser
elat
ionst
opr
oduceanot
herv
irt
ualr
elat
iont
hatdoesnotact
ual
l
yexi
st
aspr
esent
ed.Soav
iewi
svi
rt
ual
l
yder
ivedr
elat
iont
hatdoesnotnecessar
il
yex
ist
i
nthedat
abasebutcanbepr
oduceduponr
equestbyapar
ti
cul
aruseratt
het
ime
ofr
equest
.Thev
irt
ualt
abl
eorr
elat
ioncanbecr
eat
edf
rom si
ngl
eordi
ff
erent
r
elat
ionsbyext
ract
ingsomeat
tri
but
esandr
ecor
dswi
thorwi
thoutcondi
ti
ons.
Pur
poseofav
iew
Hi
des unnecessar
yinf
ormat
ion f
rom user
s:si
nce onl
ypar
toft
he base
r
elat
ion(
Somecol
l
ect
ionofat
tri
but
es,notnecessar
il
yal
l
)ar
etobei
ncl
uded
i
nthev
irt
ual
tabl
e.
Pr
ovi
depower
fulf
lexi
bil
i
tyandsecur
it
y:si
nceunnecessar
yinf
ormat
ionwi
l
l
behi
ddenf
rom t
heusert
her
ewi
l
lbesomesor
tofdat
asecur
it
y.
Pr
ovi
decust
omi
zedv
iewoft
hedat
abasef
oruser
s:eachuserar
egoi
ngt
obe
35
i
nter
facedwi
tht
hei
rownpr
efer
reddat
asetandf
ormatbymaki
nguseoft
he
Vi
ews.
Av
iewofonebaser
elat
ioncanbeupdat
ed.
Updat
eonv
iewsder
ivedf
rom v
ari
ousr
elat
ionsi
snotal
l
owedsi
ncei
tmay
v
iol
atet
hei
ntegr
it
yoft
hedat
abase.
Updat
e on v
iew wi
th aggr
egat
ion and summar
yis notal
l
owed.Si
nce
aggr
egat
ionandsummar
yresul
tsar
ecomput
edf
rom abaser
elat
ionand
doesnotexi
stact
ual
l
y.
2.
4. SchemasandI
nst
ancesandDat
abaseSt
ate
Whenadat
abasei
sdesi
gnedusi
ngaRel
ati
onaldat
amodel
,al
lthedat
ais
r
epr
esent
edi
naf
orm ofat
abl
e.I
nsuchdef
ini
ti
onsandr
epr
esent
ati
on,
ther
ear
e
t
wobasi
ccomponent
soft
hedat
abase.Thet
wocomponent
sar
ethedef
ini
ti
on
oft
heRel
ati
onort
heTabl
eandt
heact
ualdat
ast
oredi
neacht
abl
e.Thedat
a
def
ini
ti
oni
swhatwecal
ltheSchemaort
heskel
etonoft
hedat
abaseandt
he
Rel
ati
onswi
thsomei
nfor
mat
ionatsomepoi
nti
nti
mei
stheI
nst
anceort
he
f
leshoft
hedat
abase.
Schemas
Schemadescr
ibeshowdat
aist
obest
ruct
ured,
def
inedatset
up/
Desi
gnt
ime
(
alsocal
l
ed"
met
adat
a")Si
ncei
tisuseddur
ingt
hedat
abasedev
elopment
phase,t
her
eisr
aret
endencyofchangi
ngt
heschemaunl
esst
her
eisaneed
f
orsy
stem mai
ntenancewhi
chdemandschanget
othedef
ini
ti
onofar
elat
ion.
Dat
abaseSchema(
Int
ensi
on)
:speci
fi
esnameofr
elat
ionandt
hecol
l
ect
ion
oft
heat
tri
but
es(
speci
fi
cal
l
ytheNameofat
tr
ibut
es)
.
r
efert
oadescr
ipt
ionofdat
abase(
ori
ntent
ion)
speci
fi
eddur
ingdat
abasedesi
gn
shoul
dnotbechangedunl
essdur
ingmai
ntenance
SchemaDi
agr
ams:
conv
ent
iont
odi
spl
aysomeaspectofaschemav
isual
l
y
SchemaConst
ruct
:ref
erst
oeachobj
ecti
ntheschema(
e.g.STUDENT)E.
g.:
36
STUNEDT(
FName,
LName,
Id,
Year
,Dept
,andSex)
I
nst
ances
I
nst
ance:i
sthecol
l
ect
ionofdat
aint
hedat
abaseatapar
ti
cul
arpoi
ntoft
ime
(
snap-
shot
).
Al
socal
l
edSt
ateorSnapShotorExt
ensi
onoft
hedat
abase
Ref
erst
otheact
ual
dat
aint
hedat
abaseataspeci
fi
cpoi
nti
nti
me
St
ateofdat
abasei
schangedanyt
imeweadd,
del
eteorupdat
eani
tem.
Val
i
dst
ate:t
hest
atet
hatsat
isf
iest
hest
ruct
ureandconst
rai
ntsspeci
fi
edi
n
t
heschemaandi
senf
orcedbyDBMS
Si
nce I
nst
ance i
sact
ualdat
a ofdat
abase atsome poi
nti
nti
me,changes
r
api
dly
Todef
ineanewdat
abase,wespeci
fyi
tsdat
abaseschemat
otheDBMS
(
dat
abasei
sempt
y)dat
abasei
sini
ti
ali
zedwhenwef
ir
stl
oadi
twi
thdat
a.
Chapt
erThr
ee
Dat
abaseDesi
gn
Dat
abasedesi
gni
sthepr
ocessofcomi
ngupwi
thdi
ff
erentki
ndsofspeci
fi
cat
ion
f
ort
hedat
atobest
oredi
nthedat
abase.Thedat
abasedesi
gnpar
tisoneoft
he
mi
ddl
ephaseswehav
eini
nfor
mat
ionsy
stemsdev
elopmentwher
ethesy
stem
usesadat
abaseappr
oach.Desi
gni
sthepar
tonwhi
chwewoul
dbeengagedt
o
descr
ibehowt
hedat
ashoul
dbeper
cei
vedatdi
ff
erentl
evel
sandf
inal
l
yhowi
tis
goi
ngt
obest
oredi
nacomput
ersy
stem.
I
nfor
mat
ionSy
stem wi
thDat
abaseappl
i
cat
ionconsi
stsofsev
eralt
askswhi
ch
i
ncl
ude:
Pl
anni
ngofI
nfor
mat
ionSy
stemsDesi
gn
Requi
rement
sAnal
ysi
s,
Desi
gn(
Concept
ual
,Logi
cal
andPhy
sical
Desi
gn)
Tuni
ng
I
mpl
ement
ati
on
Oper
ati
onandSuppor
t
Fr
om t
hesedi
ff
erentphases,
thepr
imei
nter
estofadat
abasesy
stem wi
l
lbet
he
37
Desi
gnpar
twhi
chi
sagai
nsubdi
vi
dedi
ntoot
hert
hreesub-
phases.Thesesub-
phasesar
e:
1.Concept
ual
Desi
gn
2.Logi
cal
Desi
gn,
and
3.Phy
sical
Desi
gn
I
ngener
al,onehast
ogobackandf
ort
hbet
weent
heset
askst
oref
inea
dat
abasedesi
gn,anddeci
sionsi
nonet
askcani
nfl
uencet
hechoi
cesi
n
anot
hert
ask.
I
ndev
elopi
ngagooddesi
gn,
oneshoul
danswersuchquest
ionsas:
Whatar
ether
elev
antEnt
it
iesf
ort
heOr
gani
zat
ion
Whatar
ethei
mpor
tantf
eat
uresofeachEnt
it
y
Whatar
ethei
mpor
tantRel
ati
onshi
ps
Whatar
ethei
mpor
tantquer
iesf
rom t
heuser
TheThr
eel
evel
sofDat
abaseDesi
gn
Concept
ual
Logi
cal
Physi
cal
Desi
gn
Concept
ualDat
abaseDesi
gn
Concept
ualdesi
gni
sthepr
ocessofconst
ruct
ingamodeloft
hei
nfor
mat
ion
usedi
nanent
erpr
ise,
independentofanyphy
sical
consi
der
ati
ons.I
tist
hesour
ce
ofi
nfor
mat
ionf
ort
hel
ogi
caldesi
gnphase.Most
lyusesanEnt
it
yRel
ati
onshi
p
Modelt
odescr
ibet
hedat
aatt
hisl
evel
.Af
tert
hecompl
eti
onofConcept
ual
Desi
gnonehast
ogof
orr
efi
nementoft
heschema,whi
chi
sver
if
icat
ionof
Ent
it
ies,
Att
ri
but
es,
andRel
ati
onshi
ps
Logi
calDat
abaseDesi
gn
Logi
caldesi
gni
sthepr
ocessofconst
ruct
ingamodeloft
hei
nfor
mat
ionusedi
n
38
anent
erpr
isebasedonaspeci
fi
cdat
amodel(
e.g.r
elat
ional
,hi
erar
chi
calor
net
wor
korobj
ect
),buti
ndependentofapar
ti
cul
arDBMSandot
herphy
sical
consi
der
ati
ons.
Nor
mal
i
zat
ionpr
ocess
Col
l
ect
ionofRul
est
obemai
ntai
ned
Di
scov
ernewent
it
iesi
nthepr
ocess
Rev
iseat
tri
but
esbasedont
her
ulesandt
hedi
scov
eredEnt
it
ies
Phy
sicalDat
abaseDesi
gn
Phy
sicaldesi
gni
sthepr
ocessofpr
oduci
ngadescr
ipt
ionoft
hei
mpl
ement
ati
on
oft
hedat
abaseonsecondar
yst
orage.-
-def
inesspeci
fi
cst
orageoraccess
met
hodsusedbydat
abase
Descr
ibest
hest
oragest
ruct
uresandaccessmet
hodsusedt
oachi
eve
ef
fi
cientaccesst
othedat
a.
Tai
l
oredt
oaspeci
fi
cDBMSsy
stem -
-Char
act
eri
sti
csar
efunct
ionofDBMS
andoper
ati
ngsy
stems
I
ncl
udesest
imat
eofst
oragespace
39
Concept
ualDat
abaseDesi
gn
Concept
ual desi
gn r
evol
ves ar
ound di
scov
eri
ng and anal
yzi
ng
or
gani
zat
ional
anduserdat
arequi
rement
s
Thei
mpor
tantact
ivi
ti
esar
etoi
dent
if
y
Ent
it
ies
At
tri
but
es
Rel
ati
onshi
ps
Const
rai
nts
Andbasedont
hesecomponent
sdev
elopt
heERmodel
usi
ng
ERdi
agr
ams
3.
1.TheEnt
it
yRel
ati
onshi
p(E-
R)Model
Ent
it
y-Rel
ati
onshi
p model
i
ng i
s used t
orepr
esentconcept
ualv
iew oft
he
dat
abase.Themai
ncomponent
sofERModel
i
ngar
e:
o Ent
it
ies
Cor
respondst
oent
ir
etabl
e,notr
ow
Repr
esent
edbyRect
angl
e
o At
tr
ibut
es
Repr
esent
sthepr
oper
tyusedt
odescr
ibeanent
it
yorar
elat
ionshi
p
Repr
esent
edbyOv
al
o Rel
ati
onshi
ps
Repr
esent
stheassoci
ati
ont
hatexi
stbet
weenent
it
ies
Repr
esent
edbyDi
amond
o Const
rai
nts
Repr
esentt
heconst
rai
nti
nthedat
a
Bef
orewor
kingont
heconcept
ualdesi
gnoft
hedat
abase,
onehast
oknowand
answert
hef
oll
owi
ngbasi
cquest
ions.
Whatar
etheent
it
iesandr
elat
ionshi
psi
ntheent
erpr
ise?
Whati
nfor
mat
ionaboutt
heseent
it
iesandr
elat
ionshi
psshoul
dwest
orei
n
t
hedat
abase?
40
Whatar
ethei
ntegr
it
yconst
rai
ntst
hathol
d?Const
rai
ntsoneachdat
awi
th
r
espectt
oupdat
e,r
etr
iev
alandst
ore.
Repr
esentt
hisi
nfor
mat
ion pi
ctor
ial
l
yin ER di
agr
ams,t
hen map ER
di
agr
am i
ntoar
elat
ional
schema.
3.
1.1 Dev
elopi
nganE-
RDi
agr
am
Desi
gni
ngconcept
ualmodelf
ort
hedat
abasei
snotaonel
i
nearpr
ocessbutan
i
ter
ati
veact
ivi
tywher
ethedesi
gni
sref
inedagai
nandagai
n.
Toi
dent
if
ytheent
it
ies,at
tri
but
es,r
elat
ionshi
ps,andconst
rai
ntsont
hedat
a,
t
her
ear
edi
ff
erentsetofmet
hodsuseddur
ingt
heanal
ysi
sphase.Thesei
ncl
ude
i
nfor
mat
iongat
her
edby
…
I
nter
viewi
ngenduser
sindi
vi
dual
l
yandi
nagr
oup
Quest
ionnai
resur
vey
Di
rectobser
vat
ion
Exami
ningdi
ff
erentdocument
s
Thebasi
cE-
Rmodel
isgr
aphi
cal
l
ydepi
ctedandpr
esent
edf
orr
evi
ew.
Thepr
ocessi
srepeat
edunt
ilt
heenduser
sanddesi
gner
sagr
eet
hatt
heE-
R
di
agr
am i
saf
airr
epr
esent
ati
onoft
heor
gani
zat
ion’
sact
ivi
ti
esandf
unct
ions.
Checki
ngf
orRedundantRel
ati
onshi
psi
ntheERDi
agr
am.Rel
ati
onshi
psbet
ween
ent
it
iesi
ndi
cat
eaccessf
rom oneent
it
ytoanot
her-i
tist
her
efor
epossi
blet
o
accessoneent
it
yoccur
rencef
rom anot
herent
it
yoccur
renceev
eni
fther
ear
e
ot
herent
it
iesandr
elat
ionshi
pst
hatsepar
atet
hem -t
hisi
sof
tenr
efer
redt
oas
Nav
igat
ion'
oft
heERdi
agr
am
Thel
astphasei
nERmodel
i
ngi
sval
i
dat
inganERModelagai
nstr
equi
rementof
t
heuser
.
41
Gr
aphi
calRepr
esent
ati
onsi
nERDi
agr
ammi
ng
Ent
it
yisr
epr
esent
edbyaRECTANGLEcont
aini
ngt
henameoft
heent
it
y.
St
rongEnt
it
y WeakEnt
it
y
Connect
edent
it
iesar
ecal
l
edr
elat
ionshi
ppar
ti
cipant
s
At
tr
ibut
es ar
e r
epr
esent
ed by OVALS and ar
e
connect
edt
otheent
it
ybyal
i
ne.
Ov
Ov
al Oval Oval
Ov
s s s
Mul
ti
-val
ued Composi
te Ov
At
tri
but
e
Ader
ivedat
tri
but
eisi
ndi
cat
edbyaDOTTEDLI
NE.(
…….
.)
At
tri
but
e At
tri
but
e
Ov
als
PRI
MARYKEYSar
eunder
li
ned.
Key
Rel
ati
onshi
psar
erepr
esent
edbyDI
AMONDshapedsy
mbol
s
WeakRel
ati
onshi
pisar
elat
ionshi
p bet
ween Weakand St
rong
Ent
it
ies
St
rongRel
ati
onshi
pisar
elat
ionshi
pbet
weent
wost
rongEnt
it
ies
Di
amond
Di
a
St
rongRel
ati
onshi
p WeakRel
ati
onshi
p
Exampl
e1:
Bui
l
danERDi
agr
am f
ort
hef
oll
owi
ngi
nfor
mat
ion:Ast
udentr
ecor
d
managementsy
stem wi
l
lhav
ethef
oll
owi
ngt
wobasi
cdat
aobj
ectcat
egor
ies
wi
tht
hei
rownf
eat
uresorpr
oper
ti
es:St
udent
swi
l
lhav
eanI
d,Name,Dept
,Age,
42
GPAandCour
sewi
l
lhav
eanI
d,Name,
Credi
tHour
sWhenev
erast
udentenr
olli
n
acour
sei
naspeci
fi
cAcademi
cYearandSemest
er,
theSt
udentwi
l
lhav
eagr
ade
f
ort
hecour
se
I
d Gpa
St
udent
s Cour
ses
Age
Enr
oll
edI
n Semest
er
Academic
Year
Gr
ade
Exampl
e2:
Bui
l
danERDi
agr
am f
ort
hef
oll
owi
ngi
nfor
mat
ion:
APer
sonnel
recor
d
managementsy
stem wi
l
lhav
ethef
oll
owi
ngt
wobasi
cdat
aobj
ectcat
egor
ies
wi
tht
hei
rownf
eat
uresorpr
oper
ti
es:Empl
oyeewi
l
lhav
eanI
d,Name,DoB,Age,
TelandDepar
tmentwi
l
lhav
eanI
d,Name,Locat
ionWhenev
eranEmpl
oyeei
s
assi
gned i
n one Depar
tment
,the dur
ati
on ofhi
s st
ay i
nthe r
espect
ive
depar
tmentshoul
dber
egi
ster
ed.
St
ruct
uralConst
rai
ntsonRel
ati
onshi
p
1.Const
rai
ntsonRel
ati
onshi
p/Mul
ti
pli
cit
y/Car
dinal
i
tyConst
rai
nts
Mul
ti
pli
cit
yconst
rai
nti
sthenumberorr
angeofpossi
bleoccur
renceofanent
it
y
t
ype/
rel
ati
on t
hat may r
elat
eto a si
ngl
e occur
rence/
tupl
e of an ent
it
y
43
t
ype/
rel
ati
ont
hroughapar
ti
cul
arr
elat
ionshi
p.
Most
lyusedt
oinsur
eappr
opr
iat
eent
erpr
iseconst
rai
nts.
One-
to-
oner
elat
ionshi
p:Acust
omeri
sassoci
atedwi
thatmostonel
oan
v
iat
her
elat
ionshi
pbor
rowerAl
oani
sassoci
atedwi
thatmostonecust
omerv
ia
bor
rower
E.
g.:
Rel
ati
onshi
pManagesbet
weenSTAFFandBRANCH
Themul
ti
pli
cit
yoft
her
elat
ionshi
pis:
Onebr
anchcanonl
yhav
eonemanager
Oneempl
oyeecoul
dmanageei
theroneornobr
anches
1.
..
1 0.
..
1
Empl
oye Manages Br
anch
One-
To-
ManyRel
ati
onshi
ps:I
ntheone-
to-
manyr
elat
ionshi
pal
oani
s
associ
atedwi
thatmostonecust
omerv
iabor
rower
,acust
omeri
sassoci
ated
wi
thsev
eral
(incl
udi
ng0)l
oansv
iabor
rower
44
E.
g.:
Rel
ati
onshi
pLeadsbet
weenSTAFFandPROJECT
Themul
ti
pli
cit
yoft
her
elat
ionshi
p
Onest
affmayLeadoneormor
epr
oject
(s)
Onepr
ojecti
sLeadbyonest
aff
1.
.1 Leads 0.
.*
Empl
oyee Pr
oject
Many
-To-
ManyRel
ati
onshi
p:A cust
omeri
sassoci
atedwi
thsev
eral
(
possi
bly0)l
oansv
iabor
rower
.Al
oani
sassoci
atedwi
thsev
eral(
possi
bly0)
cust
omer
svi
abor
rower
E.
g.:
Rel
ati
onshi
pTeachesbet
weenI
NSTRUCTORandCOURSE
Themul
ti
pli
cit
yoft
her
elat
ionshi
p
OneI
nst
ruct
orTeachesoneormor
eCour
se(
s)
OneCour
seThoughtbyZer
oormor
eInst
ruct
or(
s)
0.
..
* Teaches 1.
.*
I
nst
ruct
or Cour
se
Par
ti
cipat
ionofanEnt
it
ySeti
naRel
ati
onshi
pSet
Par
ti
cipat
ionconst
rai
ntofar
elat
ionshi
pisi
nvol
vedi
nident
if
yingandset
ti
ngt
he
mandat
oryoropt
ionalf
eat
ure ofan ent
it
yoccur
rence t
otake a r
olei
na
r
elat
ionshi
p.Ther
ear
etwodi
sti
nctpar
ti
cipat
ionconst
rai
ntswi
tht
hisr
espect
,
namel
y:Tot
alPar
ti
ci
pat
ionandPar
ti
alPar
ti
cipat
ion
45
Tot
alpar
ti
cipat
ion:ev
eryt
upl
eint
heent
it
yorr
elat
ionpar
ti
cipat
esi
natl
eastone
r
elat
ionshi
pbyt
aki
ngar
ole.Thi
smeans,
ever
ytupl
einar
elat
ionwi
l
lbeat
tached
wi
thatl
eastoneot
hert
upl
e.Theent
it
ywi
tht
otalpar
ti
cipat
ioni
nar
elat
ionshi
p
wi
l
lbeconnect
edt
other
elat
ionshi
pusi
ngadoubl
eli
ne.
Par
ti
alpar
ti
cipat
ion:somet
upl
eint
heent
it
yorr
elat
ionmaynotpar
ti
cipat
ein
t
her
elat
ionshi
p.Thi
smeans,t
her
eisatl
eastonet
upl
efr
om t
hatRel
ati
onnot
t
aki
nganyr
olei
nthatspeci
fi
crel
ati
onshi
p.Theent
it
ywi
thpar
ti
alpar
ti
cipat
ioni
n
ar
elat
ionshi
pwi
l
lbeconnect
edt
other
elat
ionshi
pusi
ngasi
ngl
eli
ne.
E.
g.1:Par
ti
cipat
ion of EMPLOYEE i
n “
bel
ongs t
o” r
elat
ionshi
p wi
th
DEPARTMENTi
stot
alsi
nceev
eryempl
oyeeshoul
dbel
ongt
oadepar
tment
.
Par
ti
cipat
ionofDEPARTMENTi
n“bel
ongst
o”r
elat
ionshi
pwi
thEMPLOYEEi
s
t
otal
sinceev
erydepar
tmentshoul
dhav
emor
ethanoneempl
oyee.
Empl
oyee Bel
ongsTo Depar
tment
E.
g.2:Par
ti
cipat
ionofEMPLOYEEi
n“manages”r
elat
ionshi
pwi
thDEPARTMENT
i
spar
ti
alpar
ti
ci
pat
ionsi
ncenotal
lempl
oyeesar
emanager
s.Par
ti
cipat
ionof
DEPARTMENTi
n“Manages”r
elat
ionshi
pwi
thEMPLOYEEi
stot
alsi
nceev
ery
depar
tmentshoul
dhav
eamanager
.
Empl
oyee Manages Depar
tment
Pr
obl
em i
nERModel
ing
TheEnt
it
y-Rel
ati
onshi
pModeli
saconcept
ualdat
amodelt
hatv
iewst
her
eal
wor
ldasconsi
sti
ngofent
it
iesandr
elat
ionshi
ps.Themodelv
isual
l
yrepr
esent
s
t
heseconcept
sbyt
heEnt
it
y-Rel
ati
onshi
pdi
agr
am.Thebasi
cconst
ruct
soft
he
ERmodelar
eent
it
ies,r
elat
ionshi
ps,andat
tri
but
es.Ent
it
iesar
econcept
s,r
ealor
abst
ract
,aboutwhi
chi
nfor
mat
ioni
scol
l
ect
ed.Rel
ati
onshi
psar
eassoci
ati
ons
46
bet
weent
heent
it
ies.At
tri
but
esar
epr
oper
ti
eswhi
chdescr
ibet
heent
it
ies.
Whi
l
edesi
gni
ngt
heERmodelonecoul
dfaceapr
obl
em ont
hedesi
gnwhi
chi
s
cal
l
ed a connect
ion t
raps.Connect
ion t
raps ar
e pr
obl
ems ar
isi
ng f
rom
mi
sint
erpr
eti
ngcer
tai
nrel
ati
onshi
ps
Ther
ear
etwot
ypesofconnect
iont
raps;
1.Fant
rap: Occur
swher
eamodelr
epr
esent
sar
elat
ionshi
pbet
weenent
it
y
t
ypes,
butt
hepat
hwaybet
weencer
tai
nent
it
yoccur
rencesi
sambi
guous.May
exi
stwher
etwoormor
eone-
to-
many(
1:M)r
elat
ionshi
psf
anoutf
rom an
ent
it
y.Thepr
obl
em coul
dbeav
oidedbyr
est
ruct
uri
ngt
hemodelsot
hatt
her
e
woul
dbeno1:
Mrel
ati
onshi
psf
anni
ngoutf
rom asi
ngeent
it
yandal
lthe
semant
icsoft
her
elat
ionshi
pispr
eser
ved.
Exampl
e:
1.
.* Wor
ks1.
.1 1.
.1I
sAssi
gned 1.
.*
EMPLOYEE For
BRANCH CAR
Semant
icsdescr
ipt
ionoft
hepr
obl
em;
Emp1 Br
a1 Car
1
Emp2 Br
a2 Car
2
Emp3 Br
a3 Car
3
Emp4 Car
4
Pr
obl
em:Whi
chcar(
Car
1orCar
3orCar
5)i
susedbyEmpl
oyee6Emp6wor
king
i
nBr
anc
Eh1(
mp5Br
a1)
?Thusf
rom t
hisERModel
onecannott
ell
whi
chca
Car
5ri
susedby
whi
chst
affsi
nceabr
anchcanhav
emor
ethanonecarandal
soabr
anchi
s
popul
atedbymor
ethanoneempl
oyee.Thusweneedt
orest
ruct
uret
hemodelt
o
av
oidt
he connect
ion t
rap.To av
oidt
he Fan Tr
ap pr
obl
em we can go f
or
r
est
ruct
uri
ngoft
heE-
RModel
.Thi
swi
l
lresul
tint
hef
oll
owi
ngE-
RModel
.
1.
.1 Has 1.
.* 1.
.* UsedBy 1.
.*
BRANCH CAR EMPLOYEE
47
Semant
icsdescr
ipt
ionoft
hepr
obl
em;
Car
1
Br
a1 Emp1
Car
2
Br
a2 Emp2
Car
3
Br
a3 Emp3
Car
4
2.Chasm Tr
ap: Emp4
Occur
swher
eamodelsugges
Ct
st
a5hee
r xi
stenceofar
elat
ionshi
pbet
ween
Emp5
ent
it
yty
pes,butt
he pat
h waydoesnotexi
stbet
ween cer
tai
n ent
it
y
occur
rences.
Mayexi
stwhent
her
ear
eoneormor
erel
ati
onshi
pswi
thami
nimum
mul
ti
pli
cit
yoncar
dinal
i
tyofzer
ofor
mingpar
toft
hepat
hwaybet
ween
r
elat
edent
it
ies.
Exampl
e:
1.
1 Has 1.
.* 0.
1 Manages 0.
*
BRANCH EMPLOYEE PROJECT
I
fwehav
easetofpr
oject
sthatar
enotact
ivecur
rent
lyt
henwecannotassi
gna
pr
ojectmanagerf
ort
hesepr
oject
s.Sot
her
ear
epr
ojectwi
thnopr
ojectmanager
maki
ngt
hepar
ti
cipat
iont
ohav
eami
nimum v
alueofzer
o.
Pr
obl
em:
How canwei
dent
if
ywhi
chBRANCH i
sresponsi
blef
orwhi
chPROJECT?We
knowt
hatwhet
hert
hePROJECTi
sact
iveornott
her
eisar
esponsi
bleBRANCH.
Butwhi
chbr
anchi
saquest
iont
obeanswer
ed,andsi
ncewehav
eami
nimum
par
ti
cipat
ionofzer
o bet
weenempl
oyeeand PROJECT wecan’
tident
if
ythe
BRANCH r
esponsi
blef
oreach PROJECT.Thesol
uti
on f
ort
hisChasm Tr
ap
pr
obl
em i
stoaddanot
herr
elat
ionshi
pbet
weent
heext
remeent
it
ies(
BRANCH
andPROJECT)
48
1.1 Has 1.
.* 0.
1 Manages 0.
*
BRANCH EMPLOYEE PROJECT
1.
1 Responsi
blef
or 1.
*
EnhancedE-
R(EER)Model
s
Obj
ect
-or
ient
edext
ensi
onst
oE-
R model
.EER i
simpor
tantwhenwehav
ea
r
elat
ionshi
pbet
weent
woent
it
iesandt
hepar
ti
cipat
ioni
spar
ti
albet
weenent
it
y
occur
rences.I
nsuchcasesEERi
susedt
oreducet
hecompl
exi
tyi
npar
ti
cipat
ion
andr
elat
ionshi
pcompl
exi
ty.ERdi
agr
amsconsi
derent
it
yty
pest
obepr
imi
ti
ve
obj
ect
s.EERdi
agr
amsal
l
owr
efi
nement
swi
thi
nthest
ruct
uresofent
it
yty
pes
EERConcept
s
Gener
ali
zat
ion
Speci
ali
zat
ion
Subcl
asses
Supercl
asses
At
tri
but
eInher
it
ance
Const
rai
ntsonspeci
ali
zat
ionandgener
ali
zat
ion
Gener
ali
zat
ion
Gener
ali
zat
ionoccur
swhent
woormor
eent
it
iesr
epr
esentcat
egor
iesoft
he
samer
eal
-wor
ldobj
ect
.Gener
ali
zat
ioni
sthepr
ocessofdef
ini
ngamor
egener
al
ent
it
yty
pef
rom asetofmor
especi
ali
zedent
it
yty
pes.Agener
ali
zat
ionhi
erar
chy
i
saf
orm ofabst
ract
iont
hatspeci
fi
est
hatt
woormor
eent
it
iest
hatshar
e
common at
tri
but
es can be gener
ali
zed i
nto a hi
gherl
evelent
it
yty
pe. I
s
consi
der
edasbot
tom-
updef
ini
ti
onofent
it
ies.Gener
ali
zat
ionhi
erar
chydepi
cts
r
elat
ionshi
p bet
ween hi
gher l
evel super
class and l
ower l
evel subcl
ass.
Gener
ali
zat
ionhi
erar
chi
escanbenest
ed.Thati
s,asubt
ypeofonehi
erar
chycan
beasupert
ypeofanot
her
.Thel
evel
ofnest
ingi
sli
mit
edonl
ybyt
heconst
rai
ntof
si
mpl
i
cit
y.Exampl
e:Accounti
s a gener
ali
zed f
orm f
orSav
ing and Cur
rent
49
Account
s
Speci
ali
zat
ion
I
tIst
her
esul
tofsubsetofahi
gherl
evel
ent
it
ysett
ofor
m al
owerl
evel
ent
it
yset
.
Thespeci
ali
zed ent
it
ieswi
l
lhav
eaddi
ti
onalsetofat
tr
ibut
es(
dist
ingui
shi
ng
char
act
eri
sti
cs)t
hatdi
sti
ngui
sht
hem f
rom t
hegener
ali
zedent
it
y.I
sconsi
der
ed
asTop-
Downdef
ini
ti
onofent
it
ies.Speci
ali
zat
ionpr
ocessi
sthei
nver
seoft
he
Gener
ali
zat
ion pr
ocess.I
dent
if
ythe di
sti
ngui
shi
ng f
eat
ures ofsome ent
it
y
occur
rences,
andspeci
ali
zet
hem i
ntodi
ff
erentsubcl
asses.
Reasonsf
orSpeci
ali
zat
ion
o At
tri
but
esonl
ypar
ti
all
yappl
yi
ngt
osuper
classes
o Rel
ati
onshi
pty
pesonl
ypar
ti
all
yappl
i
cabl
etot
hesuper
class
I
nmanycases,
anent
it
yty
pehasnumer
oussub-
groupi
ngsofi
tsent
it
iest
hatar
e
meani
ngf
uland need t
o be r
epr
esent
ed expl
i
cit
ly.Thi
s need r
equi
res t
he
r
epr
esent
ati
onofeachsubgr
oupi
ntheERmodel
.Thegener
ali
zedent
it
yisa
supercl
assandt
hesetofspeci
ali
zedent
it
ieswi
l
lbesubcl
assesf
ort
hatspeci
fi
c
Super
class.
Exampl
e:Sav
ingAccount
sandCur
rentAccount
sar
eSpeci
ali
zedent
it
iesf
ort
he
50
gener
ali
zed ent
it
y Account
s. Manager
, Sal
es, Secr
etar
y: ar
e speci
ali
zed
empl
oyees.
Subcl
ass/
Subt
ype
Anent
it
yty
pewhoset
upl
eshav
eat
tri
but
est
hatdi
sti
ngui
shi
tsmember
s
f
rom t
upl
esoft
hegener
ali
zedorSuper
classent
it
ies.
When one gener
ali
zed Super
class has v
ari
ous subgr
oups wi
th
di
sti
ngui
shi
ng f
eat
ures and t
hese subgr
oups ar
e r
epr
esent
ed by
speci
ali
zedf
orm,
thegr
oupsar
ecal
l
edsubcl
asses.
Subcl
assescanbeei
thermut
ual
lyexcl
usi
ve(
disj
oint
)orov
erl
appi
ng
(
incl
usi
ve)
.
Asi
ngl
esubcl
assmayi
nher
itat
tri
but
esf
rom t
wodi
sti
nctsuper
classes.
Amut
ual
l
yexcl
usi
vecat
egor
y/subcl
assi
swhenanent
it
yinst
ancecanbe
i
nonl
yoneoft
hesubcl
asses.
E.
g.:
AnEMPLOYEEcanei
therbeSALARI
EDorPART-
TIMERbutnot
bot
h.
Anov
erl
appi
ngcat
egor
y/subcl
assi
swhenanent
it
yinst
ancemaybei
n
t
woormor
esubcl
asses.
E.
g.:A PERSON who wor
ksf
orauni
ver
sit
ycanbebot
hEMPLOYEE and a
STUDENTatt
hesamet
ime.
Supercl
ass/
Supert
ype
Anent
it
yty
pewhoset
upl
eshar
ecommonat
tr
ibut
es.At
tr
ibut
est
hatar
e
shar
edbyal
lent
it
yoccur
rences(
incl
udi
ngt
hei
dent
if
ier
)ar
eassoci
ated
wi
tht
hesupert
ype.
I
sthegener
ali
zedent
it
y
Rel
ati
onshi
pBet
weenSupercl
assandSubcl
ass
Ther
elat
ionshi
pbet
weenasupercl
assandanyofi
tssubcl
assesi
s
cal
l
edasuper
class/
subcl
assorcl
ass/
subcl
assr
elat
ionshi
p
Ani
nst
ancecannotonl
ybeamemberofasubcl
ass.i
.e.Ev
ery
i
nst
anceofasubcl
assi
sal
soani
nst
ancei
ntheSuper
class.
Amemberofasubcl
assi
srepr
esent
edasadi
sti
nctdat
abaseobj
ect
,
adi
sti
nctr
ecor
dthati
srel
atedv
iat
hekeyat
tr
ibut
etoi
tssuper
-cl
ass
51
ent
it
y.
Anent
it
ycannotexi
sti
nthedat
abasemer
elybybei
ngamemberofa
subcl
ass;
itmustal
sobeamemberoft
hesuper
-cl
ass.
Anent
it
yoccur
renceofasubcl
assnotnecessar
il
yshoul
dbel
ongt
o
any oft
he subcl
asses unl
ess t
her
eisf
ullpar
ti
cipat
ion i
nthe
speci
ali
zat
ion.
Amemberofasubcl
assi
srepr
esent
edasadi
sti
nctdat
abaseobj
ect
,
adi
sti
nctr
ecor
dthati
srel
atedv
iat
hekeyat
tr
ibut
etoi
tssuper
-cl
ass
ent
it
y.
Ther
elat
ionshi
pbet
weenasubcl
assandaSuper
classi
san“
ISA”or
“
ISPARTOF”t
ype.
Subcl
assI
SPARTOFSuper
class
ManagerI
SANEmpl
oyee
Al
lsubcl
assesorspeci
ali
zedent
it
yset
sshoul
dbeconnect
edwi
th
t
hesuper
classusi
ngal
i
net
oaci
rcl
ewher
ether
eisasubsetsy
mbol
i
ndi
cat
ingt
hedi
rect
ionofsubcl
ass/
super
classr
elat
ionshi
p.
Wecanal
sohav
esubcl
assesofasubcl
assf
ormi
ngahi
erar
chyof
speci
ali
zat
ion.
Super
classat
tri
but
esar
eshar
edbyal
lsubcl
assesft
hatsuper
class
Subcl
assat
tri
but
esar
euni
quef
ort
hesubcl
ass.
At
tri
but
eInher
it
ance
Anent
it
ythati
samemberofasubcl
assi
nher
it
sal
ltheat
tr
ibut
esof
t
heent
it
yasamemberoft
hesuper
class.
52
Theent
it
yal
soi
nher
it
sal
lther
elat
ionshi
psi
nwhi
cht
hesuper
class
par
ti
cipat
es.
Anent
it
ymayhav
emor
ethanonesubcl
asscat
egor
ies.
Al
lent
it
ies/
subcl
assesofagener
ali
zedent
it
yorsuper
classshar
ea
commonuni
quei
dent
if
ierat
tri
but
e(pr
imar
ykey
).i
.e.Thepr
imar
ykey
oft
hesuper
classandsubcl
assesar
eal
way
sident
ical
.
Consi
dert
heEMPLOYEEsupert
ypeent
it
yshownabov
e.Thi
sent
it
ycanhav
e
sev
eraldi
ff
erentsubt
ypeent
it
ies(
forexampl
e:HOURLYandSALARI
ED)
,each
wi
th di
sti
nctpr
oper
ti
es notshar
ed byot
hersubt
ypes.Butwhet
hert
he
empl
oyeei
sHOURLYorSALARI
ED,
sameat
tr
ibut
es(
Empl
oyeeI
D,Name,
and
Dat
eHi
red)ar
eshar
ed.
TheSupert
ypeEMPLOYEE st
oresal
lpr
oper
ti
est
hatsubcl
asseshav
ein
common.AndHOURLYempl
oyeeshav
etheuni
queat
tr
ibut
eWage(
hour
ly
wager
ate)
,whi
l
eSALARI
ED empl
oyeeshav
etwouni
queat
tr
ibut
es,St
ock
Opt
ionandSal
ary
.
Const
rai
ntsonspeci
ali
zat
ionandgener
ali
zat
ion
Compl
etenessConst
rai
nt.
TheCompl
etenessConst
rai
ntaddr
essest
hei
ssueofwhet
herornotan
occur
renceofaSuper
classmustal
sohav
eacor
respondi
ngSubcl
ass
occur
rence.
Thecompl
etenessconst
rai
ntr
equi
rest
hatal
linst
ancesoft
hesubt
ypebe
53
r
epr
esent
edi
nthesupert
ype.
TheTot
alSpeci
ali
zat
ionRul
especi
fi
est
hatanent
it
yoccur
renceshoul
dat
l
eastbe a memberofone oft
he subcl
asses.Tot
alPar
ti
cipat
ion of
super
classi
nst
ancesonsubcl
assesi
sdi
agr
ammedwi
thadoubl
eli
ne
f
rom t
he Supert
ype t
othe ci
rcl
e asshown bel
ow.E.
g.:I
fwe hav
e
EXTENTI
ONandREGULARassubcl
assesofasuper
classSTUDENT,t
hen
i
tismandat
oryt
hateachst
udentt
obeei
therEXTENTI
ON orREGULAR
st
udent
.Thust
hepar
ti
cipat
ionofi
nst
ancesofSTUDENTi
nEXTENTI
ON
andREGULARsubcl
asseswi
l
lbet
otal
.
ThePar
ti
alSpeci
ali
zat
ionRul
especi
fi
est
hati
tisnotnecessar
yforal
l
ent
it
yoccur
rencesi
nthe super
classt
o be a memberofone oft
he
subcl
asses.Her
ewehav
eanopt
ionalpar
ti
cipat
ionont
hespeci
ali
zat
ion.
Par
ti
al Par
ti
cipat
ion of super
class i
nst
ances on subcl
asses i
s
di
agr
ammedwi
thasi
ngl
eli
nef
rom t
heSupert
ypet
otheci
rcl
e.E.
g.:I
fwe
hav
e MANAGER and SECRETARY as subcl
asses of a super
class
EMPLOYEE,t
heni
tisnott
hecaset
hatal
lempl
oyeesar
eei
thermanager
orsecr
etar
y.Thust
hepar
ti
cipat
ionofi
nst
ancesofempl
oyeei
nMANAGER
andSECRETARYsubcl
asseswi
l
lbepar
ti
al.
Di
sjoi
ntnessConst
rai
nts.
Speci
fi
est
her
ulewhet
heroneent
it
yoccur
rencecanbeamemberofmor
e
t
hanonesubcl
asses.i
.e.i
tisat
ypeofbusi
nessr
ulet
hatdeal
swi
tht
he
si
tuat
ionwher
eanent
it
yoccur
renceofaSuper
classmayal
sohav
emor
e
t
hanoneSubcl
assoccur
rence.
54
TheDi
sj
ointRul
erest
ri
ctsoneent
it
yoccur
renceofasuper
classt
obea
memberofonl
yoneoft
hesubcl
asses.Exampl
e:aEMPLOYEEcanei
ther
beSALARI
EDorPART-
TIMER,
butnott
hebot
hatt
hesamet
ime.
TheOv
erl
apRul
eal
l
owsoneent
it
yoccur
rencet
obeamemberofmor
e
t
hanonesubcl
ass.Exampl
e:EMPLOYEEwor
kingatt
heuni
ver
sit
ycanbe
bot
haSTUDENTandanEMPLOYEEatt
hesamet
ime.
Thi
sisdi
agr
ammedbypl
aci
ngei
thert
hel
ett
er"
d"f
ordi
sjoi
ntor"
o"f
or
ov
erl
appi
ngi
nsi
det
heci
rcl
eont
heGener
ali
zat
ionHi
erar
chypor
ti
onoft
he
E-
Rdi
agr
am.
Thet
wot
ypesofconst
rai
ntsongener
ali
zat
ionandspeci
ali
zat
ion(
Disj
oint
ness
andCompl
etenessconst
rai
nts)ar
enotdependentononeanot
her
.Thati
s,bei
ng
di
sjoi
ntwi
l
lnotf
avourwhet
hert
het
upl
esi
nthesuper
classshoul
dhav
eTot
alor
Par
ti
alpar
ti
cipat
ionf
ort
hatspeci
fi
cspeci
ali
zat
ion.
Fr
om t
het
wot
ypesofconst
rai
ntswecanhav
efourpossi
bleconst
rai
nts
Di
sj
ointANDTot
al
Di
sj
ointANDPar
ti
al
Ov
erl
appi
ngANDTot
al
Ov
erl
appi
ngANDPar
ti
al
55
Chapt
erFour
Funct
ional
DependencyandNor
mal
izat
ion
Logi
caldesi
gni
sthepr
ocessofconst
ruct
ingamodeloft
hei
nfor
mat
ionusedi
n
anent
erpr
isebasedonaspeci
fi
cdat
amodel(
e.g.r
elat
ional
,hi
erar
chi
calor
net
wor
korobj
ect
),buti
ndependentofapar
ti
cul
arDBMSandot
herphy
sical
consi
der
ati
ons.
Nor
mal
i
zat
ionpr
ocess
Col
l
ect
ionofRul
est
obemai
ntai
ned
Di
scov
ernewent
it
iesi
nthepr
ocess
Rev
iseat
tri
but
esbasedont
her
ulesandt
hedi
scov
eredEnt
it
ies
Thef
ir
stst
epbef
oreappl
yi
ngt
her
ulesi
nrel
ati
onaldat
amodeli
sconv
ert
ingt
he
concept
ualdesi
gnt
oaf
orm sui
tabl
eforr
elat
ionall
ogi
calmodel
,whi
chi
sina
f
orm oft
abl
es.
Conv
ert
ingERDi
agr
am t
oRel
ati
onalTabl
es
Thr
eebasi
crul
est
oconv
ertERi
ntot
abl
esorr
elat
ions:
1.Forar
elat
ionshi
pwi
thOne-
to-
OneCar
dinal
i
ty:
Al
ltheat
tri
but
esar
emer
gedi
ntoasi
ngl
etabl
e.Whi
chmeansone
canpostt
hepr
imar
ykeyorcandi
dat
ekeyofoneoft
her
elat
ions
t
otheot
herasaf
orei
gnkey
.
2.Forar
elat
ionshi
pwi
thOne-
to-
ManyCar
dinal
i
ty:
Postt
hepr
imar
ykeyorcandi
dat
ekeyf
rom t
he“
one”si
deasa
f
orei
gnkeyat
tri
but
etot
he“
many
”si
de.E.
g.:Forar
elat
ionshi
p
cal
l
ed“
Bel
ongsTo”bet
weenEmpl
oyee(
Many
)andDepar
tment
(
One)
3.Forar
elat
ionshi
pwi
thMany
-to-
ManyCar
dinal
i
ty:
Cr
eat
eanew t
abl
e(whi
chi
stheassoci
ati
veent
it
y)andpost
pr
imar
ykeyorcandi
dat
ekeyf
rom eachent
it
yasat
tr
ibut
esi
nthe
newt
abl
eal
ongwi
thsomeaddi
ti
onal
att
ri
but
es(
ifappl
i
cabl
e)
56
Af
terconv
ert
ingt
heERdi
agr
am i
ntot
abl
efor
ms,
thenextphasei
simpl
ement
ing
t
hepr
ocessofnor
mal
i
zat
ion,whi
chi
sacol
l
ect
ionofr
uleseacht
abl
eshoul
d
sat
isf
y.
4.
1. Nor
mal
izat
ion
Ar
elat
ionaldat
abasei
smer
elyacol
l
ect
ionofdat
a,or
gani
zedi
napar
ti
cul
ar
manner
.Ast
hef
atheroft
her
elat
ionaldat
abaseappr
oach,Codedcr
eat
eda
ser
iesofr
ulescal
l
ednor
malf
ormst
hathel
pdef
inet
hator
gani
zat
ion.Oneoft
he
bestway
stodet
ermi
newhati
nfor
mat
ionshoul
dbest
oredi
nadat
abasei
sto
cl
ari
fywhatquest
ionswi
l
lbeaskedofi
tandwhatdat
awoul
dbei
ncl
udedi
nthe
answer
s.Dat
abase nor
mal
i
zat
ion i
sa ser
iesofst
epsf
oll
owed t
o obt
aina
dat
abasedesi
gnt
hatal
l
owsf
orconsi
stentst
orageandef
fi
cientaccessofdat
a
i
nar
elat
ional
dat
abase.Thesest
epsr
educedat
aredundancyandt
her
iskofdat
a
becomi
ngi
nconsi
stent
.
NORMALI
ZATI
ONi
sthepr
ocessofi
dent
if
yingt
hel
ogi
calassoci
ati
onsbet
ween
dat
ait
emsanddesi
gni
ngadat
abaset
hatwi
l
lrepr
esentsuchassoci
ati
onsbut
wi
thoutsuf
fer
ingt
heupdat
eanomal
i
eswhi
char
e;
1.I
nser
ti
onAnomal
i
es
2.Del
eti
onAnomal
i
es
3.Modi
fi
cat
ionAnomal
i
es
Nor
mal
i
zat
ion may r
educe sy
stem per
for
mance si
nce dat
a wi
l
lbe cr
oss
r
efer
enced f
rom manyt
abl
es.Thus denor
mal
i
zat
ion i
s somet
imes used t
o
i
mpr
ove per
for
mance,at t
he cost of r
educed consi
stency guar
ant
ees.
Nor
mal
i
zat
ionnor
mal
l
yisconsi
der
edasgoodi
fiti
slossl
essdecomposi
ti
on.
Al
lthenor
mal
i
zat
ionr
uleswi
l
lev
ent
ual
l
yremov
etheupdat
eanomal
i
est
hatmay
exi
stdur
ingdat
amani
pul
ati
onaf
tert
hei
mpl
ement
ati
on.Theupdat
eanomal
i
es
ar
e:Thet
ypeofpr
obl
emst
hatcoul
doccuri
ninsuf
fi
cient
lynor
mal
i
zedt
abl
eis
cal
l
edupdat
eanomal
i
eswhi
chi
ncl
udes;
57
(
1) I
nser
ti
onanomal
ies
An"
inser
ti
onanomal
y"i
saf
ail
uret
opl
acei
nfor
mat
ionaboutanewdat
abase
ent
ryi
ntoal
lthepl
acesi
nthedat
abasewher
einf
ormat
ionaboutt
hatnew
ent
ryneedst
obest
ored.I
napr
oper
lynor
mal
i
zeddat
abase,i
nfor
mat
ion
aboutanewent
ryneedst
obei
nser
tedi
ntoonl
yonepl
acei
nthedat
abase;
in
ani
nadequat
elynor
mal
i
zeddat
abase,i
nfor
mat
ionaboutanew ent
rymay
needt
obei
nser
tedi
ntomor
ethanonepl
aceand,
humanf
all
i
bil
i
tybei
ngwhat
i
tis,
someoft
heneededaddi
ti
onal
inser
ti
onsmaybemi
ssed.
(
2) Del
eti
onanomal
i
es
A"
del
eti
onanomal
y"i
saf
ail
uret
oremov
einf
ormat
ionaboutanexi
sti
ng
dat
abaseent
rywheni
tist
imet
oremov
ethatent
ry.I
napr
oper
lynor
mal
i
zed
dat
abase,i
nfor
mat
ionaboutanol
d,t
o-be-
got
ten-
ri
d-ofent
ryneedst
o be
del
etedf
rom onl
yonepl
acei
nthedat
abase;i
nani
nadequat
elynor
mal
i
zed
dat
abase,
inf
ormat
ionaboutt
hatol
dent
rymayneedt
obedel
etedf
rom mor
e
t
hanonepl
ace,and,humanf
all
i
bil
i
tybei
ngwhati
tis,someoft
heneeded
addi
ti
onal
del
eti
onsmaybemi
ssed.
(
3) Modi
fi
cat
ionanomal
ies
Amodi
fi
cat
ionofadat
abasei
nvol
veschangi
ngsomev
alueoft
heat
tr
ibut
eof
at
abl
e.I
napr
oper
lynor
mal
i
zeddat
abaset
abl
e,what
everi
nfor
mat
ioni
s
modi
fi
edbyt
heuser
,thechangewi
l
lbeef
fect
edandusedaccor
dingl
y.
Thepur
poseofnor
mal
i
zat
ioni
stor
educet
hechancesf
oranomal
i
est
ooccuri
n
adat
abase.
58
Exampl
eofpr
obl
emsr
elat
edwi
thAnomal
i
es
EmpI
D FNam LName Ski
l
lI
D Ski
l
l Ski
l
lTy
pe Schoo School
Add Ski
l
l
e l Lev
el
12 Abebe Mekur
i 2 SQL Dat
abase AAU Si
dist
_Ki
l
o 5
a
16 Lemm Al
emu 5 C++ Pr
ogr
ammi
n Uni
ty Ger
ji 6
a g
28 Chane Kebede 2 SQL Dat
abase AAU Si
dist
_Ki
l
o 10
25 Aber
a Tay
e 6 VB6 Pr
ogr
ammi
n Hel
i
co Pi
azza 8
g
65 Al
maz Bel
ay 2 SQL Dat
abase Hel
i
co Pi
azza 9
24 Der
eje Tami
ru 8 Or
acl Dat
abase Uni
ty Ger
ji 5
e
51 Sel
am Bel
ay 4 Pr
olo Pr
ogr
ammi
n Ji
mm Ji
mma 8
g g a Ci
ty
94 Al
em Kebede 3 Ci
sco Net
wor
king AAU Si
dist
_Ki
l
o 7
18 Gi
rma Der
eje 1 I
P Pr
ogr
ammi
n Ji
mm Ji
mma 4
g a Ci
ty
13 Yar
ed Gi
zaw 7 Jav
a Pr
ogr
ammi
n AAU Si
dist
_Ki
l
o 6
g
Del
eti
onAnomal
i
es:
I
fempl
oyeewi
thI
D16i
sdel
etedt
henev
eri
nfor
mat
ionaboutski
l
lC++and
t
het
ypeofski
l
lisdel
etedf
rom t
hedat
abase.Thenwewi
l
lnothav
eany
i
nfor
mat
ionaboutC++andi
tsski
l
lty
pe.
I
nser
ti
onAnomal
i
es:
Whati
fwehav
eanew empl
oyeewi
thaski
l
lcal
l
edPascal
?Wecannot
deci
dewhet
herPascali
sal
l
owedasav
aluef
orski
l
landwehav
enocl
ue
aboutt
het
ypeofski
l
lthatPascal
shoul
dbecat
egor
izedas.
Modi
fi
cat
ionAnomal
i
es:
Whati
ftheaddr
essf
orHel
i
coni
schangedf
rom Pi
azzat
oMexi
co?We
59
needt
olookf
orev
eryoccur
renceofHel
i
conandchanget
hev
alueof
School
Addf
rom Pi
azzat
oMexi
co,
whi
chi
spr
onet
oer
ror
.
Dat
abase-
managementsy
stem canwor
konl
ywi
tht
hei
nfor
mat
iont
hatweput
expl
i
cit
lyi
ntoi
tst
abl
esf
oragi
vendat
abaseandi
ntoi
tsr
ulesf
orwor
kingwi
th
t
hoset
abl
es,
wher
esuchr
ulesar
eappr
opr
iat
eandpossi
ble.
4.
2. Functi
onal
Dependency(
FD)
Bef
oremov
ingt
othedef
ini
ti
onandappl
i
cat
ionofnor
mal
i
zat
ion,i
tisi
mpor
tant
t
ohav
eanunder
standi
ngof"
funct
ional
dependency
."
Dat
aDependency
Thel
ogi
calassoci
ati
onsbet
weendat
ait
emst
hatpoi
ntt
hedat
abasedesi
gneri
n
t
hedi
rect
ion ofa good dat
abasedesi
gn ar
eref
err
ed t
o asdet
ermi
nantor
dependentr
elat
ionshi
ps.Twodat
ait
emsAandBar
esai
dtobei
nadet
ermi
nant
ordependentr
elat
ionshi
pifcer
tai
nval
uesofdat
ait
em Bal
way
sappear
swi
th
cer
tai
nval
uesofdat
ait
em A.i
fthedat
ait
em Ai
sthedet
ermi
nantdat
ait
em and
Bt
hedependentdat
ait
em t
hent
hedi
rect
ionoft
heassoci
ati
oni
sfr
om At
oB
andnotv
icev
ersa.
Theessenceoft
hisi
deai
sthati
ftheexi
stenceofsomet
hing,cal
litA,i
mpl
i
es
t
hatBmustexi
standhav
eacer
tai
nval
ue,
andt
henwesayt
hat"
Bisf
unct
ional
l
y
dependentonA.
"Weal
soof
tenexpr
esst
hisi
deabysay
ingt
hat"
Adet
ermi
nesB,
"
ort
hat"
Bisaf
unct
ionofa,
"ort
hat"
Afunct
ional
l
ygov
ernsB.
"Of
ten,
thenot
ions
of f
unct
ional
i
ty and f
unct
ionaldependency ar
e expr
essed br
ief
ly by t
he
st
atement
,"I
fA,t
henB.
"Iti
simpor
tantt
onot
ethatt
hev
alueBmustbeuni
que
f
oragi
venv
alueofA,
i.
e.,
anygi
venv
alueofAmusti
mpl
yjustoneandonl
yone
v
alueofB,i
n or
derf
ort
her
elat
ionshi
pto qual
i
fyf
ort
hename"
funct
ion.
"
(
Howev
er,t
hisdoesnotnecessar
il
ypr
eventdi
ff
erentv
aluesofAf
rom i
mpl
yi
ng
t
hesamev
alueofB.
)
X Yhol
dsi
fwhenev
ert
wot
upl
ehav
ethesamev
aluef
orX,t
heymusthav
ethe
samev
aluef
orY
Thenot
ati
oni
s:ABwhi
chi
sreadas;
Bisf
unct
ional
l
ydependentonA
60
I
n gener
al,a f
unct
ionaldependency i
sar
elat
ionshi
p among at
tr
ibut
es.I
n
r
elat
ionaldat
abases,
wecanhav
eadet
ermi
nantt
hatgov
ernsoneot
herat
tr
ibut
e
orsev
eral
otherat
tri
but
es.
FDsar
eder
ivedf
rom t
her
eal
-wor
ldconst
rai
ntsont
heat
tr
ibut
es
Exampl
e
Di
nnerCour
se Ty
peofWi
ne
Meat Red
Fi
sh Whi
te
Cheese Rose
Si
ncet
het
ypeofWi
neser
veddependsont
het
ypeofDi
nner
,wesayWi
nei
s
f
unct
ional
l
ydependentonDi
nner
.
Di
nner Wi
ne
Di
nnerCour
se Ty
peofWi
ne Ty
peofFor
k
Meat Red Meatf
ork
Fi
sh Whi
te Fi
shf
ork
Cheese Rose Cheesef
ork
Si
ncebot
hWi
net
ypeandFor
kty
pear
edet
ermi
nedbyt
heDi
nnert
ype,wesay
Wi
nei
sfunct
ional
l
ydependentonDi
nnerandFor
kisf
unct
ional
l
ydependenton
Di
nner
.
Di
nner Wi
ne
Di
nner For
k
Par
ti
alDependency
I
fanat
tri
but
ewhi
chi
snotamemberoft
hepr
imar
ykeyi
sdependentonsome
par
toft
hepr
imar
ykey(
ifwehav
ecomposi
tepr
imar
ykey
)thent
hatat
tr
ibut
eis
par
ti
all
yfunct
ional
l
ydependentont
hepr
imar
ykey
.
Let{
A,B}i
sthePr
imar
yKeyandCi
snokeyat
tri
but
e.
Theni
f{A,
B}C andB-
C ThenCi
spar
ti
all
yfunct
ional
l
ydependenton{
A,B}
Ful
lDependency
I
fanat
tri
but
ewhi
chi
snotamemberoft
hepr
imar
ykeyi
snotdependenton
somepar
toft
hepr
imar
ykeybutt
hewhol
ekey(
ifwehav
ecomposi
tepr
imar
y
61
key
)thent
hatat
tri
but
eisf
ull
yfunct
ional
l
ydependentont
hepr
imar
ykey
.
Let{
A,B}i
sthePr
imar
yKeyandCi
snokeyat
tri
but
e
Theni
f{A,B}
C andBCandACdoesnothol
dThenCFul
l
yfunct
ional
l
y
dependenton{
A,B}
Tr
ansi
ti
veDependency
I
n mat
hemat
ics and l
ogi
c,a t
ransi
ti
ver
elat
ionshi
pisar
elat
ionshi
p oft
he
f
oll
owi
ngf
orm:
"IfAi
mpl
i
esB,
andi
fal
soBi
mpl
i
esC,
thenAi
mpl
i
esC.
"
Exampl
e:I
fMr
.Xi
saHuman,andi
fev
eryHumani
sanAni
mal
,thenMrXmust
beanAni
mal
.Gener
ali
zedwayofdescr
ibi
ngt
ransi
ti
vedependencyi
sthat
:IfA
f
unct
ional
l
ygov
ernsB,AND I
fBf
unct
ional
l
ygov
ernsC THEN A f
unct
ional
l
y
gov
ernsCPr
ovi
dedt
hatnei
therCnorBdet
ermi
nesAi
.e.(
B/AandC/
A)I
nthe
nor
mal
not
ati
on:
{
(AB)AND(
BC)
}==>ACpr
ovi
dedt
hatB/AandC/
A
St
epsofNor
mal
izat
ion:
Wehav
evar
iousl
evel
sorst
epsi
nnor
mal
i
zat
ioncal
l
edNor
malFor
ms.Thel
evel
ofcompl
exi
ty,st
rengt
hoft
her
uleanddecomposi
ti
oni
ncr
easesaswemov
e
f
rom onel
owerl
evelNor
malFor
mtot
hehi
gher
.At
abl
einar
elat
ionaldat
abase
i
ssai
dtobei
nacer
tai
nnor
malf
ormi
fitsat
isf
iescer
tai
nconst
rai
nts.nor
mal
f
orm bel
owr
epr
esent
sast
rongercondi
ti
ont
hant
hepr
evi
ousoneNor
mal
i
zat
ion
t
owar
dsal
ogi
cal
desi
gnconsi
stsoft
hef
oll
owi
ngst
eps:
Un-
Nor
mal
i
zedFor
m:I
dent
if
yal
ldat
ael
ement
s
Fi
rstNor
mal
For
m:Fi
ndt
hekeywi
thwhi
chy
oucanf
indal
ldat
a
SecondNor
malFor
m:Remov
epar
t-
keydependenci
es.Makeal
ldat
adependent
ont
hewhol
ekey
.
Thi
rdNor
malFor
m Remov
enon-
keydependenci
es.Makeal
ldat
adependenton
not
hingbutt
hekey
.
Formostpr
act
icalpur
poses,
dat
abasesar
econsi
der
ednor
mal
i
zedi
ftheyadher
e
t
othi
rdnor
mal
for
m.
Fi
rstNor
mal
For
m(1NF)
Requi
rest
hatal
lcol
umnv
aluesi
nat
abl
ear
eat
omi
c(e.
g.,
anumberi
sanat
omi
c
62
v
alue,
whi
l
eal
i
storaseti
snot
).
Wehav
etwoway
sofachi
evi
ngt
his:
1.Put
ti
ngeachr
epeat
inggr
oupi
ntoasepar
atet
abl
eandconnect
ingt
hem
wi
thapr
imar
ykey
-for
eignkeyr
elat
ionshi
p
2. Mov
ingt
hisr
epeat
inggr
oupt
oanew r
ow byr
epeat
ingt
hecommon
at
tr
ibut
es.I
fsot
henFi
ndt
hekeywi
thwhi
chy
oucanf
indal
ldat
a
Def
ini
ti
on:at
abl
e(r
elat
ion)i
sin1NF
I
f
Ther
ear
enodupl
i
cat
edr
owsi
nthet
abl
e.Uni
quei
dent
if
ier
Eachcel
li
ssi
ngl
e-v
alued(
i.
e.,
ther
ear
enor
epeat
inggr
oups)
.
Ent
ri
esi
nacol
umn(
att
ri
but
e,f
iel
d)ar
eoft
hesameki
nd.
Exampl
eforFi
rstNor
malf
orm(
1NF)
UNNORMALI
ZED
EmpI
D Fi
rst
Nam Last
Nam Ski
l
l Ski
l
lTy
pe School School
Add Ski
l
lLev
e
e e l
12 Abebe Mekur
ia SQL, Dat
abase, AAU, Si
dist
_Ki
l
o 5
VB6 Pr
ogr
ammi
ng Hel
i
co Pi
azza 8
16 Lemma Al
emu C++ Pr
ogr
ammi
ng Uni
ty Ger
ji 6
I
P Pr
ogr
ammi
ng Ji
mma Ji
mmaCi
ty 4
65 Al
maz Bel
ay SQL Dat
abase Hel
i
co Pi
azza 9
Pr
olog Pr
ogr
ammi
ng Ji
mma Ji
mmaCi
ty 8
Jav
a Pr
ogr
ammi
ng AAU Si
dist
_Ki
l
o 6
24 Der
eje Tami
ru Or
acl
e Dat
abase Uni
ty Ger
ji 5
94 Al
em Kebede Ci
sco Net
wor
king AAU Si
dist
_Ki
l
o 7
63
FI
RSTNORMALFORM (
1NF)
Remov
eal
lrepeat
inggr
oups.Di
str
ibut
ethemul
ti
-val
uedat
tr
ibut
esi
ntodi
ff
erent
r
owsandi
dent
if
yauni
quei
dent
if
ierf
ort
her
elat
ionsot
hati
scanbesai
disa
r
elat
ioni
nrel
ati
onal
dat
abase.
EmpI
D Fi
rst
Name Last
Nam Ski
l
lI
D Ski
l
l Ski
l
lTy
pe Schoo School
Add Ski
l
lLev
el
e l
12 Abebe Mekur
ia 1 SQL Dat
abase AAU Si
dist
_Ki
l
o 5
12 Abebe Mekur
ia 3 VB6 Pr
ogr
ammi
n Hel
i
co Pi
azza 8
g
16 Lemma Al
emu 2 C++ Pr
ogr
ammi
n Uni
ty Ger
ji 6
g
16 Lemma Al
emu 7 I
P Pr
ogr
ammi
n Ji
mm Ji
mmaCi
ty 4
g a
`
28 Chane Kebede 1 SQL Dat
abase AAU Si
dist
_Ki
l
o 10
65 Al
maz Bel
ay 1 SQL Dat
abase Hel
i
co Pi
azza 9
65 Al
maz Bel
ay 5 Pr
olog Pr
ogr
ammi
n Ji
mm Ji
mmaCi
ty 8
g a
65 Al
maz Bel
ay 8 Jav
a Pr
ogr
ammi
n AAU Si
dist
_Ki
l
o 6
g
24 Der
eje Tami
ru 4 Or
acl
e Dat
abase Uni
ty Ger
ji 5
94 Al
em Kebede 6 Ci
sco Net
wor
king AAU Si
dist
_Ki
l
o 7
SecondNor
malf
orm 2NF
Nopar
ti
aldependencyofanon-
keyat
tri
but
eonpar
toft
hepr
imar
ykey
.Thi
swi
l
l
r
esul
tinasetofr
elat
ionswi
thal
evel
ofSecondNor
mal
For
m.
64
Anyt
abl
ethati
sin1NFandhasasi
ngl
e-at
tri
but
e(i
.e.
,anon-
composi
te)keyi
s
aut
omat
ical
l
yal
soi
n2NF.
Def
ini
ti
on:
atabl
e(r
elat
ion)i
sin2NF
I
f
I
tisi
n1NFand
I
fal
lnon-
keyat
tri
but
esar
edependentont
heent
ir
epr
imar
ykey
.i.
e.
nopar
ti
aldependency
.
Exampl
efor2NF:
EMP_
PROJ
EmpI EmpNa Pr
ojN Pr
ojNam Pr
ojLo Pr
ojFun Pr
ojMangI I
ncent
iv
D me o e c d D e
EMP_
PROJr
ear
ranged
EmpI
D Pr
ojNo EmpNam Pr
ojNam Pr
ojLoc Pr
ojFund Pr
ojMangI I
ncent
iv
e e D e
Busi
nessr
ule:Whenev
eranempl
oyeepar
ti
cipat
esi
napr
oject
,he/
shewi
l
lbe
ent
it
ledf
orani
ncent
ive.
Thi
sschemai
sini
ts1NFsi
ncewedon’
thav
eanyr
epeat
inggr
oupsorat
tr
ibut
es
wi
thmul
ti
-val
uedpr
oper
ty.Toconv
erti
ttoa2NFweneedt
oremov
eal
lpar
ti
al
dependenci
esofnon-
keyat
tri
but
esonpar
toft
hepr
imar
ykey
.
{
EmpI
D,Pr
ojNo}EmpName,
Proj
Name,
Proj
Loc,
Proj
Fund,
Proj
MangI
D,I
ncent
ive
Buti
naddi
ti
ont
othi
swehav
ethef
oll
owi
ngdependenci
es
FD1:
{EmpI
D}EmpName
FD2:
{Pr
ojNo}Pr
ojName,
Proj
Loc,
Proj
Fund,
Proj
MangI
D
FD3:
{EmpI
D,Pr
ojNo}I
ncent
ive
65
Aswecansee,somenon-
keyat
tri
but
esar
epar
ti
all
ydependentonsomepar
tof
t
hepr
imar
ykey
.Thi
scanbewi
tnessedbyanal
yzi
ngt
hef
ir
stt
wof
unct
ional
dependenci
es(
FD1andFD2)
.Thus,eachFunct
ionalDependenci
es,wi
tht
hei
r
dependentat
tri
but
esshoul
dbemov
edt
oanewr
elat
ionwher
etheDet
ermi
nant
wi
l
lbet
hePr
imar
yKeyf
oreach.
EMPLOYEE
EmpI
D EmpName
PROJECT
Pr
ojNo Pr
ojName Pr
ojLoc Pr
ojFund Pr
ojMangI
D
EMP_
PROJ
EmpI
D Pr
ojNo I
ncent
ive
Thi
rdNor
malFor
m(3NF)
El
i
minat
eCol
umnsDependentonanot
hernon-
Pri
mar
yKey-I
fat
tr
ibut
esdonot
cont
ri
but
etoadescr
ipt
ionoft
hekey
,remov
ethem t
oasepar
atet
abl
e.Thi
slev
el
av
oidsupdat
eanddel
etesanomal
i
es.Def
ini
ti
on:
aTabl
e(Rel
ati
on)i
sin3NF
I
f
I
tisi
n2NFand
Ther
ear
enot
ransi
ti
vedependenci
esbet
weenapr
imar
ykeyand
non-
pri
mar
ykeyat
tri
but
es.
Exampl
efor(
3NF)
Assumpt
ion:St
udent
s ofsame bat
ch (
same y
ear
)li
vei
n one bui
l
ding or
dor
mit
ory
STUDENT
St
udI
D St
ud_
F_Name St
ud_
L_Name Dept Year Dor
mit
ary
125/
97 Abebe Mekur
ia I
nfoSc 1 401
66
654/
95 Lemma Al
emu Geog 3 403
842/
95 Chane Kebede CompSc 3 403
165/
97 Al
em Kebede I
nfoSc 1 401
985/
95 Al
maz Bel
ay Geog 3 403
Thi
sschemai
sini
ts2NFsi
ncet
hepr
imar
ykeyi
sasi
ngl
eat
tr
ibut
e.Let
’st
ake
St
udI
D,Year and Dor
mit
ory and see t
he dependenci
es. St
udI
DYear AND
Year
dor
mit
ory And Yearcannotdet
ermi
ne St
udI
D and dor
mit
ory cannot
det
ermi
neSt
udI
DThent
ransi
ti
vel
ySt
udI
Ddor
mit
oryToconv
erti
ttoa3NFwe
needt
oremov
eal
ltr
ansi
ti
vedependenci
esofnon-
keyat
tr
ibut
esonanot
hernon-
keyat
tri
but
e.Thenon-
pri
mar
ykeyat
tri
but
es,dependentoneachot
herwi
l
lbe
mov
edt
oanot
hert
abl
eandl
i
nkedwi
tht
hemai
ntabl
eusi
ngCandi
dat
eKey
-
For
eignKeyr
elat
ionshi
p.
St
udI
D St
udF_
Name St
udL_
Name Dept Year
Year Dor
mit
ary
125/
97 Abebe Mekur
ia I
nfoSc 1
1 401
654/
95 Lemma Al
emu Geog 3
3 403
842/
95 Chane Kebede CompSc 3
165/
97 Al
em Kebede I
nfoSc 1
985/
95 Al
maz Bel
ay Geog 3
Gener
all
y,ev
ent
hought
her
ear
eot
herf
ouraddi
ti
onall
evel
sofNor
mal
i
zat
ion,a
t
abl
eissai
dtobenor
mal
i
zedi
fitr
eaches3NF.Adat
abasewi
thal
ltabl
esi
nthe
67
3NFi
ssai
dtobeNor
mal
i
zedDat
abase.
Mnemoni
cforr
emember
ingt
her
ati
onal
efornor
mal
i
zat
ionupt
o3NFcoul
dbe
t
hef
oll
owi
ng:
1.NoRepeat
ingorRedundancy
:nor
epeat
ingf
iel
dsi
nthet
abl
e.
2.TheFi
eldsDependUpont
heKey
:thet
abl
eshoul
dsol
elydependont
hekey
.
3.TheWhol
eKey
:nopar
ti
alkeydependency
.
4.AndNot
hingButt
heKey
:noi
nterdat
adependency
.
5.SoHel
pMeCoded:
sinceCodedcameupwi
tht
heser
ules.
68
Ot
herLev
elsofNor
mal
izat
ion
Boy
ce-
CodedNor
malFor
m(BCNF)
:
I
sol
ateI
ndependentMul
ti
pleRel
ati
onshi
ps-Not
abl
emaycont
aint
woormor
e1:
norN:
M
r
elat
ionshi
pst
hatar
enotdi
rect
lyr
elat
ed.
Thecor
rectsol
uti
on,
tocauset
hemodelt
obei
n4t
hnor
malf
orm,
ist
oensur
ethatal
lM:
M
r
elat
ionshi
psar
eresol
vedi
ndependent
lyi
ftheyar
eindeedi
ndependent
,asshownbel
ow.
Def
.:At
abl
eisi
nBCNFi
fiti
sin3NFandi
fev
erydet
ermi
nanti
sacandi
dat
ekey
.
For
thNor
malf
orm(
4NF)
I
sol
ateSemant
ical
l
yRel
atedMul
ti
pleRel
ati
onshi
ps-Ther
emaybepr
act
icalconst
rai
nson
i
nfor
mat
iont
hatj
ust
if
ysepar
ati
ngl
ogi
cal
l
yrel
atedmany
-to-
manyr
elat
ionshi
ps.
Def
.:At
abl
eisi
n4NFi
fiti
sinBCNFandi
fithasnomul
ti
-val
ueddependenci
es.
Fi
ft
hNor
malFor
m(5NF)
Amodel
li
mit
edt
oonl
ysi
mpl
e(el
ement
al)f
act
s,asexpr
essedi
nORM.
Def
.:At
abl
eisi
n5NF,
alsocal
l
ed"
Proj
ect
ion-
Joi
nNor
malFor
m"(
PJNF)
,ifi
tisi
n4NFand
i
fev
eryj
oindependencyi
nthet
abl
eisaconsequenceoft
hecandi
dat
ekey
soft
he
t
abl
e.
Domai
n-KeyNor
malFor
m(DKNF)
Amodel
freef
rom al
lmodi
fi
cat
ionanomal
i
es.
Def
.:At
abl
eisi
nDKNFi
fev
eryconst
rai
ntont
het
abl
eisal
ogi
calconsequenceoft
hedef
ini
ti
onof
key
sanddomai
ns.
Theunder
lyi
ngi
deasi
nnor
mal
i
zat
ionar
esi
mpl
eenough.Thr
oughnor
mal
i
zat
ionwewant
t
odesi
gnf
orourr
elat
ional
dat
abaseasetoft
abl
est
hat
;
(
1) Cont
ainal
lthedat
anecessar
yfort
hepur
posest
hatt
hedat
abasei
stoser
ve,
(
2) Hav
easl
i
ttl
eredundancyaspossi
ble,
(
3) Accommodat
emul
ti
plev
aluesf
ort
ypesofdat
athatr
equi
ret
hem,
69
(
4) Per
mitef
fi
ci
entupdat
esoft
hedat
aint
hedat
abase,
and
(
5) Av
oidt
hedangerofl
osi
ngdat
aunknowi
ngl
y.
Pi
tf
all
sofNor
mal
izat
ion
Requi
resdat
atoseet
hepr
obl
ems
Mayr
educeper
for
manceoft
hesy
stem
I
sti
meconsumi
ng,
Di
ff
icul
ttodesi
gnandappl
yand
Pr
onet
ohumaner
ror
70
71
Chapt
erFive
Rel
ati
onalQueryLanguages
Quer
ylanguages:
All
owmani
pul
ati
onandr
etr
iev
alofdat
afr
om adat
abase.
Quer
yLanguages!=pr
ogr
ammi
ngl
anguages!
QLsnoti
ntendedt
obeusedf
orcompl
excal
cul
ati
ons.
QLssuppor
teasy
,ef
fi
cientaccesst
olar
gedat
aset
s.
Rel
ati
onal
model
suppor
tssi
mpl
e,power
ful
quer
ylanguages.
For
malRel
ati
onalQuer
yLanguages
Ther
ear
evar
iet
iesofQuer
ylanguagesusedbyr
elat
ionalDBMSf
ormani
pul
ati
ng
r
elat
ions.
Someoft
hem ar
epr
ocedur
al
Usert
ell
sthesy
stem exact
lywhatandhowt
omani
pul
atet
hedat
a
Ot
her
sar
enon-
procedur
al
Userst
ateswhatdat
aisneededr
athert
hanhowi
tist
ober
etr
iev
ed.
Twomat
hemat
icalQuer
yLanguagesf
ormt
hebasi
sforRel
ati
onal
languages
Rel
ati
onalAl
gebr
a:
Rel
ati
onalCal
cul
us:
Wemaydescr
ibet
her
elat
ionalal
gebr
aaspr
ocedur
all
anguage:i
tcanbeusedt
o
t
ellt
heDBMShow t
obui
l
danew r
elat
ionf
rom oneormor
erel
ati
onsi
nthe
dat
abase.
Wemaydescr
iber
elat
ional
cal
cul
usasanon-
procedur
all
anguage:
itcanbeused
t
ofor
mul
atet
hedef
ini
ti
onofar
elat
ioni
nter
msofoneormor
edat
abase
r
elat
ions.
For
mal
l
yther
elat
ionalal
gebr
aandr
elat
ionalcal
cul
usar
eequi
val
entt
oeach
ot
her
.Forev
eryexpr
essi
oni
ntheal
gebr
a,t
her
eisanequi
val
entexpr
essi
oni
nthe
cal
cul
us.
Bot
har
enon-
userf
ri
endl
ylanguages. Theyhav
ebeenusedast
hebasi
sfor
ot
her
,hi
gher
-l
evel
dat
amani
pul
ati
onl
anguagesf
orr
elat
ional
dat
abases.
Aquer
yisappl
i
edt
orel
ati
oni
nst
ances,andt
her
esul
tofaquer
yisal
soar
elat
ion
i
nst
ance.
72
Schemasofi
nputr
elat
ionsf
oraquer
yar
efi
xed
Theschemaf
ort
her
esul
tofagi
venquer
yisal
sof
ixed!Det
ermi
nedby
def
ini
ti
onofquer
ylanguageconst
ruct
s.
Rel
ati
onalAl
gebr
a
Thebasi
csetofoper
ati
onsf
ort
her
elat
ionalmodeli
sknownast
her
elat
ionalal
gebr
a.
Theseoper
ati
onsenabl
eausert
ospeci
fybasi
cret
ri
evalr
equest
s.Ther
esul
toft
he
r
etr
iev
ali
sanewr
elat
ion,
whi
chmayhav
ebeenf
ormedf
rom oneormor
erel
ati
ons.The
al
gebr
aoper
ati
onst
huspr
oducenewr
elat
ions,
whi
chcanbef
urt
hermani
pul
atedusi
ng
oper
ati
onsoft
hesameal
gebr
a.Asequenceofr
elat
ionalal
gebr
aoper
ati
onsf
ormsa
r
elat
ionalal
gebr
aexpr
essi
on,whoser
esul
twi
l
lal
sobear
elat
iont
hatr
epr
esent
sthe
r
esul
tofadat
abasequer
y(orr
etr
iev
alr
equest
).
Rel
ati
onalal
gebr
aisat
heor
eti
call
anguagewi
thoper
ati
onst
hatwor
kononeormor
e
r
elat
ionst
odef
ineanot
herr
elat
ionwi
thoutchangi
ngt
heor
igi
nal
rel
ati
on.
Theout
putf
rom oneoper
ati
oncanbecomet
hei
nputt
oanot
heroper
ati
on(
nest
ingi
s
possi
ble)
Ther
ear
edi
ff
erentbasi
coper
ati
onst
hatcoul
dbeappl
i
edonr
elat
ionsona
dat
abasebasedont
her
equi
rement
.
Sel
ect
ion( )
:Sel
ect
sasubsetofr
owsf
rom ar
elat
ion.
Pr
oject
ion():Del
etesunwant
edcol
umnsf
rom ar
elat
ion.
Renami
ng:assi
gni
ngi
nter
medi
ater
elat
ionf
orasi
ngl
eoper
ati
on
Cr
oss-
Product(
x):
all
owsust
ocombi
net
wor
elat
ions.
Set
-Di
ff
erence(
-)
:Tupl
esi
nrel
ati
on1,
butnoti
nrel
ati
on2.
Uni
on()
:Tupl
esi
nrel
ati
on1ori
nrel
ati
on2.
I
nter
sect
ion()
:Tupl
esi
nrel
ati
on1andi
nrel
ati
on2
Joi
n( )
:Tupl
esj
oinedf
rom t
wor
elat
ionsbasedonacondi
ti
on
Usi
ngt
hesewecanbui
l
dupsophi
sti
cat
eddat
abasequer
ies.
Tabl
e1:Sampl
etabl
eusedt
oil
l
ust
rat
edi
ff
erentki
ndsofr
elat
ionaloper
ati
ons.The
r
elat
ioncont
ainsi
nfor
mat
ionaboutempl
oyees,I
Tski
l
lst
heyhav
eandt
heschool
73
wher
etheyat
tendeachski
l
l.
Empl
oyee
EmpI
D FName LName Ski
l
lI
D Ski
l
l Ski
l
lTy
pe School School
Add Ski
l
lLev
el
12 Abebe Mekur
ia 2 SQL Dat
abase AAU Si
dist
_Ki
l
o 5
16 Lemma Al
emu 5 C++ Pr
ogr
ammi
ng Uni
ty Ger
ji 6
25 Aber
a Tay
e 6 VB6 Pr
ogr
ammi
ng Hel
i
co Pi
azza 8
65 Al
maz Bel
ay 2 SQL Dat
abase Hel
i
co Pi
azza 9
24 Der
eje Tami
ru 8 Or
acl
e Dat
abase Uni
ty Ger
ji 5
51 Sel
am Bel
ay 4 Pr
olog Pr
ogr
ammi
ng Ji
mma Ji
mmaCi
ty 8
94 Al
em Kebede 3 Ci
sco Net
wor
king AAU Si
dist
_Ki
l
o 7
18 Gi
rma Der
eje 1 I
P Pr
ogr
ammi
ng Ji
mma Ji
mmaCi
ty 4
13 Yar
ed Gi
zaw 7 Jav
a Pr
ogr
ammi
ng AAU Si
dist
_Ki
l
o 6
1.Sel
ect
ion
Sel
ect
ssubsetoft
upl
es/
rowsi
nar
elat
iont
hatsat
isf
ysel
ect
ioncondi
ti
on.
Sel
ect
ionoper
ati
oni
saunar
yoper
ator(
iti
sappl
i
edt
oasi
ngl
erel
ati
on)
TheSel
ect
ionoper
ati
oni
sappl
i
edt
oeacht
upl
eindi
vi
dual
l
y
Thedegr
eeoft
her
esul
ti
ngr
elat
ioni
sthesameast
heor
igi
nalr
elat
ionbutt
he
car
dinal
i
ty(
no.oft
upl
es)i
slesst
hanorequal
tot
heor
igi
nal
rel
ati
on.
TheSel
ect
ionoper
atori
scommut
ati
ve.
Setofcondi
ti
onscanbecombi
nedusi
ngBool
eanoper
ati
ons((
AND)
,(OR)
,and
~(
NOT)
)
Nodupl
i
cat
esi
nresul
t!
Schemaofr
esul
tident
ical
toschemaof(
onl
y)i
nputr
elat
ion.
Resul
trel
ati
on can be t
he i
nputf
oranot
herr
elat
ionalal
gebr
a oper
ati
on!
74
(
Oper
atorcomposi
ti
on.
)
I
tisaf
il
tert
hatkeepsonl
ythoset
upl
est
hatsat
isf
yaqual
i
fyi
ngcondi
ti
on(
those
sat
isf
yingt
hecondi
ti
onar
esel
ect
edwhi
l
eot
her
sar
edi
scar
ded.
)
Not
ati
on:
σ<Sel
ect
ionCondi
ton><
i Rel
ati
onName>
Exampl
e:Fi
ndal
lEmpl
oyeeswi
thski
l
lty
peofDat
abase.
σ<Ski
l
l_Ty
pe=”
Dat >(
abase” Empl
oyee)
Thi
squer
ywi
l
lext
ractev
eryt
upl
efr
om ar
elat
ioncal
l
edEmpl
oyeewi
thal
ltheat
tr
ibut
es
wher
etheSki
l
l_Ty
peat
tr
ibut
ewi
thav
alueof“
Dat
abase”
.
Ther
esul
ti
ngr
elat
ionwi
l
lbet
hef
oll
owi
ng.
EmpI
D FName LName Ski
l
lI
D Ski
l
l Ski
l
lTy
pe School School
Add Ski
l
lLev
el
12 Abebe Mekur
ia 2 SQL Dat
abase AAU Si
dist
_Ki
l
o 5
65 Al
maz Bel
ay 2 SQL Dat
abase Hel
i
co Pi
azza 9
24 Der
eje Tami
ru 8 Or
acl
e Dat
abase Uni
ty Ger
ji 5
I
fthequer
yisal
lempl
oyeeswi
thaSki
l
lTy
peDat
abaseandSchoolUni
tyt
her
elat
ionalal
gebr
a
oper
ati
onandt
her
esul
ti
ngr
elat
ionwi
l
lbeasf
oll
ows.
σ<SkillType=”Database”ANDSchool=”Unity”>(
Empl
oyee)
EmpI
D FName LName Ski
l
lI
D Ski
l
l Ski
l
lTy
pe School School
Add Ski
l
lLev
el
24 Der
eje Tami
ru 8 Or
acl
e Dat
abase Uni
ty Ger
ji 5
2.
Proj
ect
ion
Sel
ect
scer
tai
nat
tr
ibut
eswhi
l
edi
scar
dingt
heot
herf
rom t
hebaser
elat
ion.
ThePROJECTcr
eat
esav
ert
icalpar
ti
ti
oni
ng–onewi
tht
heneededcol
umns(
att
ri
but
es)
75
cont
aini
ngr
esul
tsoft
heoper
ati
onandot
hercont
aini
ngt
hedi
scar
dedCol
umns.
Del
etesat
tr
ibut
est
hatar
enoti
npr
oject
ionl
i
st.
Schemaofr
esul
tcont
ainsexact
lyt
hef
iel
dsi
nthepr
oject
ionl
i
st,wi
tht
hesamenames
t
hatt
heyhadi
nthe(
onl
y)i
nputr
elat
ion.
Pr
oject
ionoper
atorhast
oel
i
minat
edupl
i
cat
es!
Not
e:r
ealsy
stems t
ypi
cal
l
ydon’
tdo dupl
i
cat
e el
i
minat
ion unl
ess t
he user
expl
i
cit
lyasksf
ori
t.
I
fthePr
imar
yKeyi
sint
hepr
oject
ionl
i
st,
thendupl
i
cat
ionwi
l
lnotoccur
Dupl
i
cat
ionr
emov
ali
snecessar
ytoi
nsur
ethatt
her
esul
ti
ngt
abl
eisal
soar
elat
ion.
Not
ati
on:
<Sel
ect
edAt
tri
but
es><Rel
ati
onName>
Exampl
e:Todi
spl
ayName,Ski
l
l,andSki
l
lLev
elofanempl
oyee,t
hequer
yandt
he
r
esul
ti
ngr
elat
ionwi
l
lbe:
<FName,
LName,
Ski
ll
,Ski
ll
_Lev
el(
Empl
> oyee)
Abebe Mekur
ia SQL 5
Lemm Al
emu C++ 6
a
Aber
a Tay
e VB6 8
Al
maz Bel
ay SQL 9
Der
eje Tami
ru Or
acl
e 5
Sel
am Bel
ay Pr
olog 8
Al
em Kebede Ci
sco 7
Gi
rma Der
eje I
P 4
76
Yar
ed Gi
zaw Jav
a 6
I
fwewantt
ohav
etheName,
Ski
l
l,andSki
l
lLev
elofanempl
oyeewi
thSki
l
lSQLandSki
l
lLev
el
gr
eat
ert
han5t
hequer
ywi
l
lbe:
<FName,
LName,
Ski
ll
,Ski
l
l_Lev
el> ( <Ski
ll
=”SQL”Ski
ll
Lev
el (
Empl
>5> oyee)
)
Al
maz Bel
ay SQL 9
3.
RenameOper
ati
on
Wemaywantt
oappl
ysev
eralr
elat
ionalal
gebr
aoper
ati
onsoneaf
tert
heot
her
.The
quer
ycoul
dbewr
it
teni
ntwodi
ff
erentf
orms:
1.Wr
it
ethe oper
ati
ons as a si
ngl
erel
ati
onalal
gebr
a expr
essi
on bynest
ing t
he
oper
ati
ons.
2.Appl
yoneoper
ati
onatat
imeandcr
eat
eint
ermedi
ater
esul
trel
ati
ons.I
nthel
att
er
case, we must gi
ve names t
o t
he r
elat
ions t
hat hol
d t
he i
nter
medi
ate
r
esul
tsRenameOper
ati
on
I
fwewantt
ohav
etheName,Ski
l
l,andSki
l
lLev
elofanempl
oyeewi
thsal
arygr
eat
er
t
han1500andwor
kingf
ordepar
tment5,wecanwr
it
etheexpr
essi
onf
ort
hisquer
y
usi
ngt
het
woal
ter
nat
ives:
1.Asi
ngl
eal
gebr
aicexpr
essi
on:
Theabov
eusedquer
yisusi
ngasi
ngl
eal
gebr
aoper
ati
on,
whi
chi
s:
<FName,
LName,
Ski
l
l,Ski
l
l_Lev
el(
> <Ski
l
l=”
SQL”Ski
l
lLev
el (
Empl
>5> oyee)
)
2.Usi
ngani
nter
medi
ater
elat
ionbyt
heRenameOper
ati
on:
St
ep1: Resul
t1 <Dept
No=5 Sal
ary (
Empl
>1500> oyee)
St
ep2:Resul
t <FName,LName,Skill,Skill_Level>(
Resul
t1)
77
ThenResul
twi
l
lbeequi
val
entwi
tht
her
elat
ionwegetusi
ngt
hef
ir
stal
ter
nat
ive.
78
4.
SetOper
ati
ons
Thet
hreemai
nsetoper
ati
onsar
etheUni
on,I
nter
sect
ionandSetDi
ff
erence. The
pr
oper
ti
esoft
hesesetoper
ati
onsar
esi
mil
arwi
tht
heconceptwehav
einmat
hemat
ical
sett
heor
y.Thedi
ff
erencei
sthat
,indat
abasecont
ext
,theel
ement
sofeachset
,whi
ch
i
saRel
ati
oni
nDat
abase,
wil
lbet
upl
es.Thesetoper
ati
onsar
eBi
nar
yoper
ati
onswhi
ch
demandt
het
wooper
andRel
ati
onst
ohav
ety
pecompat
ibi
l
ityf
eat
ure.
Ty
peCompat
ibi
li
ty
Twor
elat
ionsR1andR2ar
esai
dtobeTy
peCompat
ibl
eif
:
1.Theoper
andr
elat
ionsR1(
A1,A2,.
..
,An)andR2(
B1,B2,.
..
,Bn)hav
ethesame
numberofat
tri
but
es,
and
2.The domai
ns ofcor
respondi
ng at
tri
but
es mustbe compat
ibl
e;t
hati
s,
Dom(
Ai)
=Dom(
Bi)f
ori
=1,
2,.
..
,n.
Toi
l
lust
rat
ethet
hreesetoper
ati
ons,
wewi
l
lmakeuseoft
hef
oll
owi
ngt
wot
abl
es:
Empl
oyee
EmpI
D FName LName Ski
l
lI
D Ski
l
l Ski
l
lTy
pe School Ski
l
lLev
el
12 Abebe Mekur
ia 2 SQL Dat
abase AAU 5
16 Lemma Al
emu 5 C++ Pr
ogr
ammi
ng Uni
ty 6
25 Aber
a Tay
e 6 VB6 Pr
ogr
ammi
ng Hel
i
co 8
65 Al
maz Bel
ay 2 SQL Dat
abase Hel
i
co 9
24 Der
eje Tami
ru 8 Or
acl
e Dat
abase Uni
ty 5
51 Sel
am Bel
ay 4 Pr
olog Pr
ogr
ammi
ng Ji
mma 8
94 Al
em Kebede 3 Ci
sco Net
wor
king AAU 7
18 Gi
rma Der
eje 1 I
P Pr
ogr
ammi
ng Ji
mma 4
79
13 Yar
ed Gi
zaw 7 Jav
a Pr
ogr
ammi
ng AAU 6
Rel
ati
onOne:
Empl
oyeeswhoat
tendDat
abaseCour
se
EmpI
D FName LName Ski
l
lI
D Ski
l
l Ski
l
lTy
pe School Ski
l
lLev
el
12 Abebe Mekur
ia 2 SQL Dat
abase AAU 5
65 Al
maz Bel
ay 2 SQL Dat
abase Hel
i
co 9
24 Der
eje Tami
ru 8 Or
acl
e Dat
abase Uni
ty 5
Rel
ati
onTwo:
Empl
oyeeswhoat
tendacour
sei
nAAU
EmpI
D FName LName Ski
l
lI
D Ski
l
l Ski
l
lTy
pe School Ski
l
lLev
el
12 Abebe Mekur
ia 2 SQL Dat
abase AAU 5
94 Al
em Kebede 3 Ci
sco Net
wor
king AAU 7
13 Yar
ed Gi
zaw 7 Jav
a Pr
ogr
ammi
ng AAU 6
a.UNI
ONOper
ati
on
Ther
esul
toft
hisoper
ati
on,
denot
edbyRUS,
isar
elat
iont
hati
ncl
udesal
ltupl
es
t
hatar
eei
theri
nRori
nSori
nbot
hRandS.Dupl
i
cat
etupl
eisel
i
minat
ed.The
t
wo oper
ands mustbe "
type compat
ibl
e"E.
g.:Rel
ati
on OneURel
ati
on Two
Empl
oyeeswhoat
tendDat
abasei
nanySchool
orwhoat
tendanycour
seatAAU
EmpI
D FName LName Ski
l
lID Ski
ll Ski
ll
Type School Ski
ll
Lev
el
12 Abebe Mekur
ia 2 SQL Dat
abase AAU 5
65 Al
maz Bel
ay 2 SQL Dat
abase Hel
ico 9
24 Der
eje Tami
ru 8 Or
acl
e Dat
abase Uni
ty 5
80
94 Al
em Kebede 3 Ci
sco Net
wor
king AAU 7
13 Yar
ed Gi
zaw 7 Jav
a Pr
ogr
ammi
ng AAU 6
b.I
NTERSECTI
ONOper
ati
on
Ther
esul
toft
hisoper
ati
on,denot
edbyR∩S,i
sar
elat
iont
hati
ncl
udesal
ltupl
es
t
hatar
einbot
hRandS.Thet
wooper
andsmustbe"
typecompat
ibl
e"E.
g.:Rel
ati
on
One∩Rel
ati
onTwo
Empl
oyeeswhoat
tendDat
abaseCour
seatAAU
EmpI
D FName LName Ski
l
lI
D Ski
l
l Ski
l
lTy
pe School Ski
l
lLev
el
12 Abebe Mekur
ia 2 SQL Dat
abase AAU 5
c.SetDi
ff
erence(
orMI
NUS)Oper
ati
on
Ther
esul
toft
hisoper
ati
on,
denot
edbyR-S,
isar
elat
iont
hati
ncl
udesal
ltupl
est
hat
ar
einRbutnoti
nS.Thet
wooper
andsmustbe"
typecompat
ibl
eE.
g.:Rel
ati
onOne-
Rel
ati
onTwo
Empl
oyeeswhoat
tendDat
abaseCour
sebutdi
dn’
ttakeanycour
seatAAU
EmpI
D FName LName Ski
l
lI
D Ski
l
l Ski
l
lTy
pe School Ski
l
lLev
el
65 Al
maz Bel
ay 2 SQL Dat
abase Hel
i
co 9
24 Der
eje Tami
ru 8 Or
acl
e Dat
abase Uni
ty 5
E.
g.:Rel
atonTwo-
i Rel
ati
onOne
Empl
oyeeswhoat
tendDat
abaseCour
sebutdi
dn’
ttakeanycour
seatAAU
EmpI
D FName LName Ski
l
lI
D Ski
l
l Ski
l
lTy
pe Schoo Ski
l
lLev
el
l
12 Abebe Mekur
ia 2 SQL Dat
abase AAU 5
81
94 Al
em Kebede 3 Ci
sco Net
wor
king AAU 7
13 Yar
ed Gi
zaw 7 Jav
a Pr
ogr
ammi
ng AAU 6
Ther
esul
ti
ngr
elat
ionf
or;R1 R2,R1 R2,orR1-
R2hast
hesameat
tr
ibut
enamesas
t
hef
ir
stoper
andr
elat
ionR1(
byconv
ent
ion)
.
SomePr
oper
ti
esoft
heSetOper
ator
s
Not
icet
hatbot
huni
onandi
nter
sect
ionar
ecommut
ati
veoper
ati
ons;t sR
hati
R-S≠S–R
5.
CARTESI
AN(
crosspr
oduct
)Oper
ati
on
Thi
soper
ati
oni
susedt
ocombi
net
upl
esf
rom t
wor
elat
ionsi
nacombi
nat
ori
alf
ashi
on.
Thatmeans,ev
eryt
upl
einRel
ati
on1(
R)onewi
l
lber
elat
edwi
thev
eryot
hert
upl
ein
Rel
ati
on2(
S).
I
ngener
al,t
her
esul
tofR(
A1,A2,...
,An)xS(
B1,
B2,...
,Bm)i
sar
elat
ionQwi
th
degr
een+m at
tri
but
esQ(
A1,
A2,
...
,An,
B1,
B2,
...
,Bm)
,int
hator
der
.
Wher
eRhasnat
tri
but
esandShasm at
tr
ibut
es.
Ther
esul
ti
ngr
elat
ionQhasonet
upl
eforeachcombi
nat
ionoft
upl
es—onef
rom
Randonef
rom S.
Hence,
ifRhasnt
upl
es,
andShasm t
upl
es,
then|
RxS|
wil
lhav
en*m t
upl
es.
Exampl
e:
Empl
oyee
82
I
D FName LName
567 Bel
ay Tay
e
822 Kef
le Kebede
Dept
Dept
ID Dept
Name MangI
D
2 Fi
nance 567
3 Per
sonnel 123
Thent
heCar
tesi
anpr
oductbet
weenEmpl
oyeeandDeptr
elat
ionswi
l
lbeoft
hef
orm:
Empl
oyeeXDept
.:
I
D FName LName Dept
ID Dept
Name MangI
D
567 Bel
ay Tay
e 2 Fi
nance 567
567 Bel
ay Tay
e 3 Per
sonnel 123
822 Kef
le Kebede 2 Fi
nance 567
822 Kef
le Kebede 3 Per
sonnel 123
Basi
cal
l
y,ev
ent
houghi
tisv
eryi
mpor
tanti
nquer
ypr
ocessi
ng,t
heCar
tesi
anPr
oducti
s
notusef
ulbyi
tsel
fsi
ncei
trel
atesev
eryt
upl
eint
heFi
rstRel
ati
onwi
thev
eryot
hert
upl
ein
t
heSecondRel
ati
on.Thus,t
omakeuseoft
heCar
tesi
anPr
oduct
,onehast
ousei
twi
th
83
t
heSel
ect
ionOper
ati
on,whi
chdi
scr
imi
nat
etupl
esofar
elat
ionbyt
est
ingwhet
hereach
wi
l
lsat
isf
ythesel
ect
ioncondi
ti
on.I
nourexampl
e,t
oext
ractempl
oyeei
nfor
mat
ionabout
manager
soft
hedepar
tment
s(Manager
sofeachdepar
tment
),t
heal
gebr
aquer
yandt
he
r
esul
ti
ngr
elat
ionwi
l
lbe.
<I
D,FName,
LName,
Dept
Name> ( <I
D=MangI(
Empl
D> oyeeXDept
))
I
D FName LName Dept
Name
567 Bel
ay Tay
e Fi
nance
6.JOI
NOper
ati
on
ThesequenceofCar
tesi
anpr
oductf
oll
owedbysel
ecti
susedqui
tecommonl
yto
i
dent
if
yandsel
ectr
elat
edt
upl
esf
rom t
wor
elat
ions,aspeci
aloper
ati
on,cal
l
edJOI
N.
Thusi
nJOI
Noper
ati
on,t
heCar
tesi
anOper
ati
onandt
heSel
ect
ionOper
ati
onsar
eused
t
oget
her
.
JOI
NOper
ati
oni
sdenot
edbya sy
mbol
.
Thi
soper
ati
oni
sver
yimpor
tantf
oranyr
elat
ionaldat
abasewi
thmor
ethanasi
ngl
e
r
elat
ion,becausei
tal
l
owsust
opr
ocessr
elat
ionshi
psamongr
elat
ions.Thegener
al
f
orm ofaj
oinoper
ati
onont
wor
elat
ions
R(
A1,
A2,
...
,An)andS(
B1,
B2,
...
,Bm)i
s:
R <joincondition>S i
s equi
val
ent t
o <sel
ect
ion condi
ti (
R X S) wher
on> e<j
oin
condi
ti
on>and<sel
ect
ioncondi
ti
on>ar
ethesame
Wher
e,R and S can be anyr
elat
ion t
hatr
esul
tsf
rom gener
alr
elat
ionalal
gebr
a
expr
essi
ons.
Si
nceJOI
Nisanoper
ati
ont
hatneedst
wor
elat
ion,i
tisaBi
nar
yoper
ati
on.Thi
sty
peof
JOI
Niscal
l
edaTHETAJOI
N( -JOI
N)Wher
e i
sthel
ogi
caloper
atorusedi
nthej
oin
condi
ti
on.
Coul
dbe{
<, ,
>,,,
=}
Exampl
e:Thusi
ntheabov
eexampl
ewewantt
oext
ractempl
oyeei
nfor
mat
ionabout
84
manager
soft
hedepar
tment
s,t
heal
gebr
aquer
yusi
ngt
heJOI
Noper
ati
onwi
l
lbe.
Empl
oyee <I
D=MangIDept
D> .
a.
EQUI
JOI
NOper
ati
on
Themostcommonuseofj
oini
nvol
vesj
oincondi
ti
onswi
thequal
it
ycompar
isonsonl
y(=)
.
Suchaj
oin,wher
etheonl
ycompar
isonoper
atorusedi
scal
ledanEQUI
JOI
N.I
nther
esul
tof
anEQUI
JOI
N weal
way
shav
eoneormor
epai
rsofat
tri
but
es(
whosenamesneednotbe
i
dent
ical
)thathav
eident
icalv
aluesi
nev
eryt
upl
esi
nceweusedt
heequal
it
ylogi
caloper
ator
.
Forexampl
e,t
heabov
eJOI
N expr
essi
oni
sanEQUI
JOI
N si
ncet
hel
ogi
cal
oper
atorusedi
stheequalt
ooper
ator(=)
.
b.
NATURALJOI
NOper
ati
on
Wehav
eseent
hati
nEQUI
JOI
Noneofeachpai
rofat
tri
but
eswi
thi
dent
icalv
aluesi
sext
ra,a
newoper
ati
oncal
lednat
uralj
oinwascr
eat
edt
ogetr
idoft
hesecond(
orext
ra)at
tri
but
ethat
wewi
llhav
eint
her
esul
tofanEQUI
JOI
N condi
ti
on.Thest
andar
ddef
ini
ti
onofnat
uralj
oin
r
equi
rest
hatt
het
woj
oinat
tri
but
es,oreachpai
rofcor
respondi
ngj
oinat
tri
but
es,hav
ethe
samenamei
nbot
hrel
ati
ons.I
fthi
sisnott
hecase,ar
enami
ngoper
ati
onont
heat
tri
but
esi
s
appl
iedf
ir
st.
c.
OUTERJOI
NOper
ati
on
OUTERJOI
Nisanot
herv
ersi
onoft
heJOI
N oper
ati
onwher
enonmat
chi
ngt
upl
esf
rom a
r
elat
ionar
eal
soi
ncl
udedi
nther
esul
twi
thNULLv
aluesf
orat
tri
but
esi
ntheot
herr
elat
ion.
Ther
ear
etwomaj
ort
ypesofOUTERJOI
N.
1.RI
GHTOUTERJOI
N:wher
enonmat
chi
ngt
upl
esf
rom t
hesecond(
Right
)rel
ati
onar
e
i
ncl
udedi
nther
esul
twi
thNULLv
aluef
orat
tri
but
esoft
hef
ir
st(
Lef
t)r
elat
ion.
2.LEFT OUTER JOI
N:wher
e non mat
chi
ng t
upl
es f
rom t
he f
ir
st(
Lef
t)r
elat
ion ar
e
i
ncl
udedi
nther
esul
twi
thNULLv
aluef
orat
tri
but
esoft
hesecond(
Right
)rel
ati
on.
Not
ati
onf
orLef
tOut
erJoi
n:
85
R <Joi
nCondi
ti S
on>
Whent
wor
elat
ionsar
ejoi
nedbyaJOI
N oper
ator
,ther
ecoul
dbesomet
upl
esi
nthef
ir
st
r
elat
ionnothav
ingamat
chi
ngt
upl
efr
om t
hesecondr
elat
ion,andt
hequer
yisi
nter
est
edt
o
di
spl
ayt
hesenon-
mat
chi
ngt
upl
esf
rom t
hef
ir
storsecondr
elat
ion.Suchquer
yisr
epr
esent
ed
byt
heOUTERJOI
N.
d.
SEMI
JOI
NOper
ati
on
SEMIJOI
Nisanot
herv
ersi
onoft
heJOI
Noper
ati
onwher
ether
esul
ti
ngRel
ati
onwi
llcont
ain
t
hoseat
tri
but
esofonl
yoneoft
heRel
ati
onst
hatar
erel
atedwi
tht
upl
esi
ntheot
herRel
ati
on.
Thef
oll
owi
ngnot
ati
ondepi
ctst
hei
ncl
usi
onofonl
ytheat
tri
but
esf
ormt
hef
ir
str
elat
ion(
R)i
n
t
her
esul
twhi
char
eact
ual
lypar
ti
cipat
ingi
nther
elat
ionshi
p.
R <Joi
nCondi
ti S
on>
86
Chapt
erSi
x
Adv
ancedConcept
sinDat
abaseSy
stems
Dat
abaseSecur
it
yandI
ntegr
it
y
Di
str
ibut
edDat
abaseSy
stems
Dat
awar
ehousi
ng
1.
Dat
abaseSecur
it
yandI
ntegr
it
y
Adat
abaser
epr
esent
sanessent
ialcor
por
ater
esour
cet
hatshoul
dbepr
oper
ly
secur
edusi
ngappr
opr
iat
econt
rol
s.
Dat
abasesecur
it
yencompasseshar
dwar
e,sof
twar
e,peopl
eanddat
a
Mul
ti
-userdat
abasesy
stem -DBMS mustpr
ovi
deadat
abasesecur
it
yand
aut
hor
izat
ionsubsy
stem t
oenf
orcel
imi
tsoni
ndi
vi
dualandgr
oupaccessr
ight
s
andpr
ivi
l
eges.
Dat
abasesecur
it
yandi
ntegr
it
yisaboutpr
otect
ingt
hedat
abasef
rom bei
ng
i
nconsi
stentandbei
ngdi
srupt
ed.Wecanal
socal
litdat
abasemi
suse.
Dat
abasemi
susecoul
dbeI
ntent
ionaloracci
dent
al,
wher
eacci
dent
almi
susei
s
easi
ert
ocopewi
tht
hani
ntent
ionalmi
suse.
Acci
dent
ali
nconsi
stencycoul
doccurduet
o:
Sy
stem cr
ashdur
ingt
ransact
ionpr
ocessi
ng
Anomal
iesduet
oconcur
rentaccess
Anomal
iesduet
oredundancy
Logi
cal
err
ors
Li
kewi
se,
event
hought
her
ear
evar
ioust
hreat
sthatcoul
dbecat
egor
izedi
nthi
s
gr
oup,
int
ent
ionalmi
susecoul
dbe:
Unaut
hor
izedr
eadi
ngofdat
a
87
Unaut
hor
izedmodi
fi
cat
ionofdat
aor
Unaut
hor
izeddest
ruct
ionofdat
a
Mostsy
stemsi
mpl
ementgoodDat
abaseI
ntegr
it
ytopr
otectt
hesy
stem f
rom
acci
dent
almi
susewhi
let
her
ear
emanycomput
erbasedmeasur
est
opr
otect
t
hesy
stem f
rom i
ntent
ionalmi
suse,whi
chi
ster
medasDat
abaseSecur
it
y
measur
es.
Dat
abasesecur
it
yisconsi
der
edi
nrel
ati
ont
othef
oll
owi
ngsi
tuat
ions:
Thef
tandf
raud
Lossofconf
ident
ial
it
y(secr
ecy
)
Lossofpr
ivacy
Lossofi
ntegr
it
y
Lossofav
ail
abi
li
ty
Secur
it
yIssuesandgener
alconsi
der
ati
ons
Legal
,et
hicalandsoci
ali
ssuesr
egar
dingt
her
ightt
oaccessi
nfor
mat
ion
Phy
sicalcont
rol
Pol
icy i
ssues r
egar
ding pr
ivacy ofi
ndi
vi
duall
evelatent
erpr
ise and
nat
ionall
evel
Oper
ati
onal
consi
der
ati
onont
het
echni
quesused(
passwor
d,et
c)
Sy
stem l
evelsecur
it
yincl
udi
ngoper
ati
ngsy
stem andhar
dwar
econt
rol
Secur
it
ylev
elsandsecur
it
ypol
ici
esi
nent
erpr
isel
evel
Dat
abase secur
it
y-t
he mechani
sms t
hatpr
otectt
he dat
abase agai
nst
i
ntent
ionaloracci
dent
alt
hreat
s.And Dat
abase secur
it
y encompasses
har
dwar
e,sof
twar
e,peopl
eanddat
a
Thr
eat–anysi
tuat
ionorev
ent
,whet
heri
ntent
ionaloracci
dent
al,t
hatmay
adv
ersel
yaf
fectasy
stem andconsequent
lyt
heor
gani
zat
ion
At
hreatmaybecausedbyasi
tuat
ionorev
enti
nvol
vi
ngaper
son,act
ion,or
ci
rcumst
ancet
hati
sli
kel
ytobr
inghar
mtoanor
gani
zat
ion
88
Thehar
mtoanor
gani
zat
ionmaybet
angi
bleori
ntangi
ble
Tangi
ble–l
ossofhar
dwar
e,sof
twar
e,ordat
a
I
ntangi
ble–l
ossofcr
edi
bil
it
yorcl
ientconf
idence
Exampl
esoft
hreat
s:
Usi
nganot
herper
sons’
meansofaccess
Unaut
hor
izedamendment
/modi
fi
cat
ionorcopy
ingofdat
a
Pr
ogr
am al
ter
ati
on
I
nadequat
epol
ici
esandpr
ocedur
est
hatal
low ami
xofconf
ident
ial
andnor
mal
output
Wi
re-
tappi
ng
I
ll
egalent
rybyhacker
Bl
ackmai
l
Cr
eat
ing‘
tr
apdoor
’int
osy
stem
Thef
tofdat
a,pr
ogr
ams,
andequi
pment
Fai
lur
eofsecur
it
ymechani
sms,
giv
inggr
eat
eraccesst
hannor
mal
St
affshor
tagesorst
ri
kes
I
nadequat
est
afft
rai
ning
Vi
ewi
nganddi
scl
osi
ngunaut
hor
izeddat
a
El
ect
roni
cint
erf
erenceandr
adi
ati
on
Dat
acor
rupt
ionowi
ngt
opowerl
ossorsur
ge
Fi
re(
elect
ri
calf
aul
t,l
ight
ningst
ri
ke,
arson)
,fl
ood,
bomb
Phy
sicaldamaget
oequi
pment
Br
eaki
ngcabl
esordi
sconnect
ionofcabl
es
I
ntr
oduct
ionofv
iruses
Lev
elsofSecur
it
yMeasur
es
Secur
it
ymeasur
escan bei
mpl
ement
ed atsev
erall
evel
sand f
ordi
ff
erent
89
component
soft
hesy
stem.Thesel
evel
sar
e:
1.Phy
sicalLev
el:concer
nedwi
thsecur
ingt
hesi
tecont
aini
ngt
hecomput
er
sy
stem shoul
dbephy
sical
lysecur
ed.Thebackupsy
stemsshoul
dal
sobe
phy
sical
lypr
otect
edf
rom accessexceptf
oraut
hor
izeduser
s.
2.HumanLev
el:concer
nedwi
thaut
hor
izat
ionofdat
abaseuser
sforaccess
t
hecont
entatdi
ff
erentl
evel
sandpr
ivi
leges.
3.Oper
ati
ng Sy
stem:concer
ned wi
tht
he weakness and st
rengt
h oft
he
oper
ati
ngsy
stem secur
it
yondat
afi
les.Weaknessmayser
veasameansof
unaut
hor
izedaccesst
othedat
abase.Thi
sal
soi
ncl
udespr
otect
ionofdat
a
i
npr
imar
yandsecondar
ymemor
yfr
om unaut
hor
izedaccess.
4.Dat
abase Sy
stem:concer
ned wi
th dat
a access l
imi
tenf
orced by t
he
dat
abasesy
stem.Accessl
imi
tli
kepasswor
d,i
sol
atedt
ransact
ionandet
c.
Ev
ent
houghwecanhav
edi
ff
erentl
evel
sofsecur
it
yandaut
hor
izat
ionondat
a
obj
ect
sand user
s,who accesswhi
ch dat
aisa pol
icymat
terr
athert
han
t
echni
cal
.
Thesepol
ici
es
shoul
dbeknownbyt
hesy
stem:shoul
dbeencodedi
nthesy
stem
shoul
dber
emember
ed:
shoul
dbesav
edsomewher
e(t
hecat
alogue)
Anor
gani
zat
ionneedst
oident
if
ythet
ypesoft
hreati
tmaybesubj
ect
edt
o
andi
nit
iat
eappr
opr
iat
epl
ansandcount
ermeasur
es,bear
ingi
nmi
ndt
he
cost
sofi
mpl
ement
ingt
hem
90
Count
ermeasur
es:Comput
erbasedcont
rol
s
Thet
ypesofcount
ermeasur
etot
hreat
soncomput
ersy
stemsr
angef
rom phy
sical
cont
rol
stoadmi
nist
rat
ivepr
ocedur
es
Despi
tet
her
angeofcomput
er-
basedcont
rol
sthatar
eav
ail
abl
e,i
tiswor
th
not
ingt
hat
,gener
all
y,t
hesecur
it
yofaDBMSi
sonl
yasgoodast
hatoft
he
oper
ati
ngsy
stem,
owi
ngt
othei
rcl
oseassoci
ati
on
The f
oll
owi
ng ar
e comput
er-
based secur
it
y cont
rol
sfor a mul
ti
-user
env
ironment
:
Aut
hor
izat
ion
Thegr
ant
ingofar
ightorpr
ivi
leget
hatenabl
esasubj
ectt
ohav
elegi
ti
mat
e
accesst
oasy
stem orasy
stem’
sobj
ect
Aut
hor
izat
ioncont
rol
scanbebui
lti
ntot
hesof
twar
e,andgov
ernnotonl
ywhat
sy
stem orobj
ectaspeci
fi
edusercanaccess,butal
sowhatt
heusermaydo
wi
thi
t
Aut
hor
izat
ioncont
rol
sar
esomet
imesr
efer
redt
oasaccesscont
rol
s
Thepr
ocessofaut
hor
izat
ioni
nvol
vesaut
hent
icat
ionofsubj
ect
s(i
.e.auseror
pr
ogr
am)r
equest
ingaccesst
oobj
ect
s(i
.e.adat
abaset
abl
e,v
iew,pr
ocedur
e,
t
ri
gger
,oranyot
herobj
ectt
hatcanbecr
eat
edwi
thi
nthesy
stem)
Vi
ews
Av
iewi
sthedy
nami
cresul
tofoneormor
erel
ati
onaloper
ati
onsoper
ati
onon
t
hebaser
elat
ionst
opr
oduceanot
herr
elat
ion
Av
iew i
sav
irt
ualr
elat
iont
hatdoesnotact
ual
lyexi
sti
nthedat
abase,buti
s
pr
oduceduponr
equestbyapar
ti
cul
aruser
Thev
iew mechani
sm pr
ovi
desapower
fulandf
lexi
blesecur
it
ymechani
sm by
hi
dingpar
tsoft
hedat
abasef
rom cer
tai
nuser
s
Usi
ngav
iewi
smor
erest
ri
cti
vet
hansi
mpl
yhav
ingcer
tai
npr
ivi
legesgr
ant
edt
o
auseront
hebaser
elat
ion(
s)
I
ntegr
it
y
91
I
ntegr
it
yconst
rai
ntscont
ri
but
etomai
ntai
ningasecur
edat
abasesy
stem by
pr
event
ingdat
afr
om becomi
ngi
nval
idandhencegi
vi
ngmi
sleadi
ngori
ncor
rect
r
esul
ts
Domai
nInt
egr
it
y
Ent
it
yint
egr
it
y
Ref
erent
iali
ntegr
it
y
Keyconst
rai
nts
Backupandr
ecov
ery
Backupi
sthepr
ocessofper
iodi
cal
lyt
aki
ngacopyoft
hedat
abaseand
l
ogf
il
e(andpossi
blypr
ogr
ams)ont
oof
fl
inest
oragemedi
a
ADBMSshoul
dpr
ovi
debackupf
aci
li
ti
est
oassi
stwi
tht
her
ecov
eryofa
dat
abasef
oll
owi
ngf
ail
ure
Dat
abaser
ecov
eryi
sthepr
ocessofr
est
ori
ngt
hedat
abaset
oacor
rect
st
atei
ntheev
entofaf
ail
ure
Jour
nal
ingi
sthepr
ocessofkeepi
ngandmai
ntai
ningal
ogf
il
e(orj
our
nal
)
ofal
lchangesmadet
othedat
abaset
oenabl
erecov
eryt
obeunder
taken
ef
fect
ivel
yint
heev
entofaf
ail
ure
Theadv
ant
ageofj
our
nal
ingi
sthat
,int
heev
entofaf
ail
ure,
thedat
abase
canber
ecov
eredt
oit
slastknownconsi
stentst
ateusi
ngabackupcopy
oft
hedat
abaseandt
hei
nfor
mat
ioncont
ainedi
nthel
ogf
il
e
I
fnoj
our
nal
ingi
senabl
edonaf
ail
edsy
stem,t
heonl
ymeansof
r
ecov
eryi
stor
est
oret
hedat
abaseusi
ngt
hel
atestbackupv
ersi
on
oft
hedat
abase
Howev
er,
wit
houtal
ogf
il
e,anychangesmadeaf
tert
hel
astbackup
t
othedat
abasewi
llbel
ost
Encr
ypt
ion
Theencodi
ngoft
hedat
abyaspeci
alal
gor
it
hm t
hatr
ender
sthedat
a
unr
eadabl
ebyanypr
ogr
am wi
thoutt
hedecr
ypt
ionkey
92
I
fadat
abasesy
stem hol
dspar
ti
cul
arl
ysensi
ti
vedat
a,i
tmaybedeemed
necessar
ytoencodei
tasapr
ecaut
ionagai
nstpossi
bleext
ernalt
hreat
s
orat
tempt
stoaccessi
t
The DBMS can access dat
a af
terdecodi
ng i
t,al
though t
her
eisa
degr
adat
ioni
nper
for
mancebecauseoft
het
imet
akent
odecodei
t
Encr
ypt
ional
sopr
otect
sdat
atr
ansmi
tt
edov
ercommuni
cat
ionl
ines
Tot
ransmi
tdat
asecur
elyov
eri
nsecur
enet
wor
ksr
equi
rest
heuseofa
Cr
ypt
osy
stem,
whi
chi
ncl
udes:
Aut
hent
icat
ion
Al
luser
soft
hedat
abasewi
llhav
edi
ff
erentaccessl
evel
sandper
missi
on
f
ordi
ff
erentdat
aobj
ect
s,andaut
hent
icat
ioni
sthepr
ocessofchecki
ng
whet
hert
heuseri
stheonewi
tht
hepr
ivi
legef
ort
heaccessl
evel
.
I
sthepr
ocessofchecki
ngt
heuser
sar
ewhot
heysayt
heyar
e.
Eachuseri
sgi
venauni
quei
dent
if
ier
,whi
chi
susedbyt
heoper
ati
ng
sy
stem t
odet
ermi
newhot
heyar
e
Thust
hesy
stem wi
llcheckwhet
hert
heuserwi
thaspeci
fi
cuser
name
andpasswor
dist
ryi
ngt
ouset
her
esour
ce.
Associ
atedwi
theachi
dent
if
ieri
sapasswor
d,chosenbyt
heuserand
knownt
otheoper
ati
onsy
stem,whi
chmustbesuppl
iedt
oenabl
ethe
oper
ati
ngsy
stem t
oaut
hent
icat
ewhot
heusercl
aimst
obe
Anydat
abaseaccessr
equestwi
llhav
ethef
oll
owi
ngt
hreemaj
orcomponent
s
1.Request
edOper
ati
on:whatki
ndofoper
ati
oni
srequest
edbya
speci
fi
cquer
y?
2.Request
edObj
ect
:onwhi
chr
esour
ceordat
aoft
hedat
abasei
s
t
heoper
ati
onsoughtt
obeappl
ied?
3.Request
ingUser
:whoi
stheuserr
equest
ingt
heoper
ati
onont
he
93
speci
fi
edobj
ect
?
Thedat
abaseshoul
dbeabl
etocheckf
oral
lthet
hreecomponent
sbef
ore
pr
ocessi
nganyr
equest
.Thechecki
ngi
sper
for
medbyt
hesecur
it
ysubsy
stem
oft
heDBMS.
For
msofuseraut
hor
izat
ion
Ther
ear
edi
ff
erentf
ormsofuseraut
hor
izat
ionont
her
esour
ceoft
hedat
abase.These
f
ormsar
epr
ivi
legesonwhatoper
ati
onsar
eal
lowedonaspeci
fi
cdat
aobj
ect
.
Useraut
hor
izat
ionont
hedat
a/ext
ensi
on
1.ReadAut
hor
izat
ion:t
heuserwi
tht
hispr
ivi
legei
sal
lowedonl
ytor
eadt
he
cont
entoft
hedat
aobj
ect
.
2.I
nser
tAut
hor
izat
ion:t
heuserwi
tht
hispr
ivi
legei
sal
lowedonl
ytoi
nser
tnew
r
ecor
dsori
temst
othedat
aobj
ect
.
3.Updat
eAut
hor
izat
ion:user
swi
tht
hispr
ivi
legear
eal
lowedt
omodi
fycont
entof
at
tri
but
esbutar
enotaut
hor
izedt
odel
etet
her
ecor
ds.
4.Del
eteAut
hor
izat
ion:user
swi
tht
hispr
ivi
legear
eonl
yal
lowedt
odel
etea
r
ecor
dandnotany
thi
ngel
se.
Di
ff
erentuser
s,dependi
ng on t
he poweroft
he user
,can hav
e one ort
he
combi
nat
ionoft
heabov
efor
msofaut
hor
izat
ionondi
ff
erentdat
aobj
ect
s.
Rol
eofDBAi
nDat
abaseSecur
it
y
94
Thedat
abaseadmi
nist
rat
ori
sresponsi
blet
omaket
hedat
abaset
obeassecur
eas
possi
ble.Fort
hist
heDBAshoul
dhav
ethemostpower
fulpr
ivi
leget
hanev
eryot
her
user
.TheDBApr
ovi
descapabi
li
tyf
ordat
abaseuser
swhi
leaccessi
ngt
hecont
entof
t
hedat
abase.
Themaj
orr
esponsi
bil
it
iesofDBAi
nrel
ati
ont
oaut
hor
izat
ionofuser
sar
e:
1.AccountCr
eat
ion:
i
nvol
vescr
eat
ingdi
ff
erentaccount
sfordi
ff
erentUSERSaswel
l
asUSERGROUPS.
2.Secur
it
yLev
elAssi
gnment
:inv
olv
esi
nassi
gni
ng di
ff
erentuser
satdi
ff
erent
cat
egor
iesofaccessl
evel
s.
3.Pr
ivi
legeGr
ant
:inv
olv
esgi
vi
ngdi
ff
erentl
evel
sofpr
ivi
legesf
ordi
ff
erentuser
sand
usergr
oups.
4.Pr
ivi
legeRev
ocat
ion:
i
nvol
vesdeny
ingorcancel
ingpr
evi
ousl
ygr
ant
edpr
ivi
leges
f
oruser
sduet
ovar
iousr
easons.
5.AccountDel
eti
on:
inv
olv
esi
ndel
eti
nganexi
sti
ngaccountofuser
sorusergr
oups.
I
ssi
mil
arwi
thdeny
ingal
lpr
ivi
legesofuser
sont
hedat
abase.
95
2.
Dist
ri
but
edDat
abaseSy
stems
Dat
abase dev
elopment f
aci
l
itat
es t
he i
ntegr
ati
on of dat
a av
ail
abl
ein an
or
gani
zat
ionandenf
orcessecur
it
yondat
aaccess.Buti
tisnotal
way
sthecase
t
hator
gani
zat
ionaldat
aresi
dei
nonesi
te.Thi
sdemanddat
abaseatdi
ff
erentsi
tes
t
obei
ntegr
atedandsy
nchr
oni
zedwi
thal
lthef
aci
li
ti
esofdat
abaseappr
oach.Thi
s
l
eadst
oDi
str
ibut
edDat
abaseSy
stems.
I
nadi
str
ibut
eddat
abasesy
stem,t
hedat
abasei
sst
oredonsev
eralcomput
ers.
Thecomput
ersi
nadi
str
ibut
edsy
stem communi
cat
ewi
theachot
hert
hrough
v
ari
ouscommuni
cat
ionmedi
a,suchashi
ghspeedbusesort
elephonel
ine.
A di
str
ibut
eddat
abasesy
stem consi
stsofacol
lect
ionofsi
tes,eachofwhi
ch
mai
ntai
nsal
ocaldat
abasesy
stem andal
sopar
ti
cipat
esi
ngl
obalt
ransact
ion
wher
edi
ff
erentdat
abasesar
eint
egr
atedt
oget
her
.
Ev
en t
hough i
ntegr
ati
on ofdat
aimpl
ies cent
ral
ized st
orage and cont
rol
,in
di
str
ibut
eddat
abasesy
stemst
hei
ntent
ioni
sdi
ff
erent
.Dat
aisst
oredi
ndi
ff
erent
dat
abasesy
stemsi
nadecent
ral
izedmannerbutactasi
ftheyar
ecent
ral
ized
t
hroughdev
elopmentofcomput
ernet
wor
ks.
A di
str
ibut
eddat
abasesy
stem consi
stsofl
oosel
ycoupl
edsi
test
hatshar
eno
phy
sicalcomponentanddat
abasesy
stemst
hatr
unoneachsi
tear
eindependent
ofeachot
her
.
Tr
ansact
ionsmayaccessdat
aatoneormor
esi
tes
Or
gani
zat
ionmayi
mpl
ementt
hei
rdat
abasesy
stem onanumberofsepar
ate
comput
ersy
stem r
athert
hanasi
ngl
e,cent
ral
izedmai
nfr
ame.Comput
erSy
stems
maybel
ocat
edateachl
ocal
branchof
fi
ce.
Thef
unct
ional
it
iesofaDDBMSwi
lli
ncl
ude:Ext
endedCommuni
cat
ionSer
vices,Ext
ended
Dat
aDi
cti
onar
y,Di
str
ibut
edQuer
yPr
ocessi
ng,Ext
endedConcur
rencyCont
rolandExt
ended
Recov
erySer
vices.
Concept
sinDDBMS
Repl
icat
ion:System mai
ntai
nsmul
ti
plecopi
esofdat
a,st
oredi
ndi
ff
erentsi
tes,
for
f
ast
err
etr
iev
alandf
aul
ttol
erance.
96
Fr
agment
ati
on:Rel
ati
oni
spar
ti
ti
onedi
ntosev
eralf
ragment
sst
oredi
ndi
sti
nct
si
tes
Datatransparency:Degreetowhichsystem usermayremainunawareofthe
det
ail
s ofhow and wher
ethe dat
ait
ems ar
e st
ored i
n a di
str
ibut
ed sy
stem.
Adv
ant
agesofDDBMS
1.Dat
ashar
inganddi
str
ibut
edcont
rol
:
Useratonesi
temaybeabl
eaccessdat
athati
sav
ail
abl
eatanot
hersi
te.
Eachsi
tecanr
etai
nsomedegr
eeofcont
rol
overl
ocaldat
a
Wewi
llhav
elocalaswel
lasgl
obal
dat
abaseadmi
nist
rat
or
2.Rel
iabi
li
tyandav
ail
abi
li
tyofdat
a
I
fonesi
tef
ail
sther
estcancont
inueoper
ati
onasl
ongast
ransact
iondoesnot
demanddat
afr
om t
hef
ail
edsy
stem andt
hedat
aisnotr
epl
icat
edi
not
hersi
tes
3.Speedupofquer
ypr
ocessi
ng
I
faquer
yinv
olv
esdat
afr
om sev
eralsi
tes,
itmaybepossi
blet
ospl
itt
hequer
yint
o
sub-
quer
iest
hatcanbeexecut
edatsev
eralsi
teswhi
chi
spar
all
elpr
ocessi
ng
Di
sadv
ant
agesofDDBMS
1.Sof
twar
edev
elopmentcost
2.Gr
eat
erpot
ent
ial
forbugs(
par
all
elpr
ocessi
ngmayendangercor
rect
ness)
3.I
ncr
easedpr
ocessi
ngov
erhead(
duet
ocommuni
cat
ionj
argons)
4.Communi
cat
ionpr
obl
ems
HomogeneousandHet
erogeneousDi
str
ibut
edDat
abases
I
nahomogeneousdi
str
ibut
eddat
abase
Al
lsi
teshav
eident
ical
sof
twar
e
Ar
eawar
eofeachot
herandagr
eet
ocooper
atei
npr
ocessi
nguserr
equest
s.
Eachsi
tesur
render
spar
tofi
tsaut
onomyi
nter
msofr
ightt
ochangeschemas
orsof
twar
e
Appear
stouserasasi
ngl
esy
stem
97
I
nahet
erogeneousdi
str
ibut
eddat
abase
Di
ff
erentsi
tesmayusedi
ff
erentschemasandsof
twar
e
Di
ff
erencei
nschemai
samaj
orpr
obl
em f
orquer
ypr
ocessi
ng
Di
ff
erencei
nsof
twar
eisamaj
orpr
obl
em f
ort
ransact
ionpr
ocessi
ng
Si
tesmaynotbeawar
eofeachot
herandmaypr
ovi
deonl
yli
mit
edf
aci
li
ti
esf
or
cooper
ati
oni
ntr
ansact
ionpr
ocessi
ng
3.
Dat
awar
ehousi
ng
Dat
a war
ehouse i
s an i
ntegr
ated,subj
ect
-or
ient
ed,t
ime-
var
iant
,non-
v
olat
il
edat
abaset
hatpr
ovi
dessuppor
tfordeci
sionmaki
ng.
I
ntegr
ated cent
ral
i
zed,consol
idat
eddat
abaset
hati
ntegr
atesdat
ader
ived
f
rom t
heent
ir
eor
gani
zat
ion.
Consol
idat
es dat
afr
om mul
ti
ple and di
ver
se sour
ces wi
th di
ver
se
f
ormat
s.
Hel
psmanager
stobet
terunder
standt
hecompany
’soper
ati
ons.
Subj
ect
-Or
ient
ed Dat
awar
ehousecont
ainsdat
aor
gani
zedbyt
opi
cs.Eg.
Sal
es,
mar
ket
ing,
finance,
etc.
Ti
mev
ari
ant
:In cont
rastt
othe oper
ati
onaldat
athatf
ocus on cur
rent
t
ransact
ions,
thewar
ehousedat
arepr
esentt
hef
lowofdat
athr
ought
ime.
Dat
awar
ehousecont
ainsdat
athatr
efl
ectwhathappenedl
astweek,
l
astmont
h,pastf
ivey
ear
s,andsoon.
Nonvol
ati
l
e Oncedat
aent
ert
hedat
awar
ehouse,t
heyar
enev
err
emov
ed.
Becauset
hedat
aint
hewar
ehouser
epr
esentt
hecompany
’sent
ir
ehi
stor
y.
Di
ff
erencesbet
weendat
abaseanddat
awar
ehouse
Becausedat
aisaddedal
lthet
ime,
war
ehousei
sgr
owi
ng.
The dat
a war
ehouse and oper
ati
onalenv
ironment
s ar
e separ
ated. Dat
a
war
ehouser
ecei
vesi
tsdat
afr
om oper
ati
onaldat
abases.
Dat
awar
ehouseenv
ironmenti
schar
act
eri
zedbyr
ead-
onl
ytr
ansact
ionst
over
y
l
argedat
aset
s.
Oper
ati
onalenv
ironmenti
schar
act
eri
zedbynumer
ousupdat
etr
ansact
ionst
oa
98
f
ewdat
aent
it
iesatat
ime.
Dat
awar
ehousecont
ainshi
stor
ical
dat
aov
eral
ongt
imehor
izon.
Ul
ti
mat
elyI
nfor
mat
ioni
scr
eat
edf
rom dat
awar
ehouses.SuchI
nfor
mat
ionbecomes
t
hebasi
sforr
ati
onaldeci
sionmaki
ng.
Thedat
afoundi
ndat
awar
ehousei
sanal
yzedt
odi
scov
erpr
evi
ousl
yunknowndat
a
char
act
eri
sti
cs,
rel
ati
onshi
ps,
dependenci
es,
ort
rends.
99