Cit 843 B
Cit 843 B
ENCE
OCTOBER2019EXAMI
NATI
ON
COURSECODE:
CIT843
COURSETI
TLE:
INTRODUCTI
ONTODATABASEMANAGEMENTSYSTEM
COURSECREDI
T:2UNI
TS
TI
MEALLOWED:
2HOURS
I
NSTRUCTI
ON:
ANSWERQUESTI
ON1ANDANYOTHERTHREE(
3)QUESTI
ONS
1a)(
i)I
dent
if
ythr
ee(
3)pr
obl
emsassoci
atedwi
thmul
ti
-userdat
abaseenv
ironment(
3mar
ks)
Answer
•Howcanwepr
eventuser
sfr
om i
nter
fer
ingwi
theachot
her
'swor
k?
•Howcanwesaf
elypr
ocesst
ransact
ionsont
hedat
abasewi
thoutcor
rupt
ingorl
osi
ngdat
a?
•I
fther
eisaprobl
em (
e.g.
,powerf
ail
ureorsy
stem cr
ash)
,howcanwer
ecov
erwi
thoutl
oosi
ng
al
lofourdat
a?
(i
i)Whatisadatabase?(2mar
ks)
Answer
Adatabaseisacol l
ect
ionofi
nfor
mat
iont
hati
sor
gani
zedsot
hati
tcaneasi
l
ybe accessed,
managed,andupdate
b)(i
)WhatisanERdi agram ?(2marks)
Answer
TheEntit
y-Relat
ionshipdiagr
am provi
desapi
ctor
ialr
epr
esent
ati
onoft
hemaj
ordat
aobj
ect
s,
theent
it
ies,andther el
ati
onshi
psbetweent
hem.
(ii
)Givefiv
e( 5)properti
esofrelati
onaltabl
es(
5mar
ks)
Answer
Relat
ionaltableshav esi
xproperti
es:
i
.Valuesareat omi c.
i
i.Columnv aluesar eofthesameki nd.
i
ii
.Eachr owi sunique.
i
v.Thesequenceofcol umnsi sinsi
gnif
icant
.
v.Thesequenceofr owsi si
nsigni
fi
cant.
vi
.Eachcol umnmusthav eauniquename.
c)Whatarethef
our(4)over
eadcoststhatcanbei
ncur
redf
orusi
ngaDBMS(
4mar
ks)
Answer
10.
Potent
ial
forEnfor
cingSt
andards.
11.
ReducedAppli
cati
onDevelopmentTime
12.
Flexi
bil
i
ty
13.
Av ai
l
abil
ityofUp-
to-
Dat
eInf
ormat
ion
14.
Economi esofScal
e
d)Pr
esentt
henot
ati
onandf
unct
ionoft
hef
oll
owi
ngSQLoper
ati
ons
( i
)SELECT( ii
)PROJECT( i
ii
)INTERSECTI
ON(
6mar
ks)
Answer
Sel ect:
Pr oject
:
Intersecti
on:
e)Wheni sarelati
onalt
abl
esaidtobein:
(i)1NF( ii
)2NF( i
i
i)3NF(3marks)
Answer
(
i)Fi
rstNor
malFor
m
Arel
ati
onaltabl
e,bydefi
nit
ion,
isinfir
stnormal f
ormi
fal
lval
uesoft
hecol
umnsar
e
at
omic.Thatis,
theycontai
nnor epeati
ngvalues.
(
ii
)SecondNor
malFor
m
Thedef
ini
ti
onofsecondnor
malfor
m st
atest
hatonl
ytabl
eswi
thcomposi
tepr
imar
y
key
scanbein1NFbutnotin2NF.
(
ii
i)Thi
rdNor
malFor
m
Thethi
rdnormalf
ormrequi
rest
hatal
lcol
umnsi
nar
elat
ional
tabl
ear
edependentonl
y
uponthepri
marykey
.
2a)Dist
ingui
shbet weenFIRSTandCOUNTaggr
egat
efunct
ionsi
nSQL,gi
vi
ngt
hei
rsy
ntax(
4
marks)
Answer
COUNT()-Returnsthenumberofrows
FI
RST()-Retur
nst hefi
rstv
alue
b)Sket
chadi agram t
oindicat
et hef ol
lowingconcepts:
(i
)anov er
lappinggeneral
izati
onhi erarchyforCOLOURassuper t
ypeent
it
ywithRED,GREEN,
andBLUEassubt y
pes.(
3mar ks)
(i
i)adi
sjoi
ntgenerali
zat
ionhierarchyforVI CE_
CHANCELLORassuperty
peenti
tywi
th
ACADEMI CSTAFFandNASU_ CHAI RMANassubt ypes(3mar
ks)
c)(
i)Expl
aint
heconceptofNULLv
aluesi
nrel
ati
onal
dat
abase(
2mar
ks)
(i
i)Descr
ibet
hree(
3)adv
ant
agesofDBMSov
erf
il
esy
stem (
3mar
ks)
Answer
Adv
ant
agesofaDBMS
1. ADBMSc anprovi
de:
2. Dat
aConsist
encyandInt
egr
it
y-bycont
rol
l
ingaccessandmi
nimi
zi
ngdat
a
dupli
cat
ion
3. Appli
cati
onprogram i
ndependence-byst
ori
ngdat
ainauni
formfashi
on
4. DataShari
ng-bycontrol
li
ngaccesstodatai
tems,
manyuserscanaccess
dataconcur
rentl
y
5. BackupandRecov
ery
6.Securi
tyandPr
ivacy
7.Multi
plevi
ewsofdata
3a)(
i)Expl
aint
heconceptofnor
mal
i
sat
ioni
ndat
abase(
3mar
ks)
Answer
Normali
zati
on i
sa desi
gn t
echni
que t
hati
s wi
del
yused asa gui
de i
n desi
gni
ng
rel
ati
onaldat
abases
(i
i
)Di st
ingui
shbet
weenone-
to-
oneandone-
to-
manyconnect
ivi
tyf
ordat
abaser
elat
ions(
3
marks)
Answer
•One-
to-
one,
•one-
to-
many,
.Aone-
i to-one(1:1)rel
ati
onshi
piswhenatmostoneinstanceofaenti
tyAis
associ
ated
withoneinstanceofentit
yB.
i
i.Aone-to-
many( 1:
N)rel
ati
onshi
psiswhenf
oroneinstanceofent
it
yA, t
herearezer
o,
one,ormanyi nstancesofent
it
yB,butf
oroneinst
anceofentit
yB,t
hereisonlyone
i
nstanceofent i
tyA.
b)Usingthreeappr opri
ateexampleseach,anal
ysetheterm dat
abasemanagementsy
stem
(DBMS)( 5mar ks)
Answer
DatabaseManagementSy stem (
DBMS)i sacol l
ecti
onofsof t
wareprogr
amsthatareusedto
defi
ne,construct,
mai nt
ainandmani pul
atedatainadatabase.Dat
abaseSyst
em (
DBS)contai
ns:
a.TheDat abase;
b.TheDBMS; and
c.Appli
cationPrograms( whatusersint
eractwit
h)
c)Fr
om t
heCARt
abl
ebel
ow,
composeSQLr
elat
ional
algebr
ast
atement
s,wi
thout
put
sto:
(i
)Sel
ectcar
swhosemanuf
act
ureri
sTOYOTA(
2mar
ks)
Answer
SELECTmanuf
act
urer
FROM CAR
WHEREToy
ota
(
ii
)Sel
ectt
hosecar
swi
thCamr
ymodelhav
ingpr
iceofl
esst
han500000(
2mar
ks)
Answer
SELECTCar
,SUM(Pri
ce)FROM Manuf
act
urer
GROUPBYCamry
HAVINGSUM(Pr
ice)
<500000
4a)(
i)Whataresur
rogatekeysindat
abaset
abl
es?(3mar
ks)
Answer
Asurrogat
ekey(a.
k.a.ar
ti
fi
cial
key)i
sasyst
em-suppl
i
eduni
quev
aluef
oracol
umnt
hatwi
l
l
ser
veasat abl
e'
spri
mar ykey.
(
ii
)Exami
net
hepr
ocessoft
ransf
ormi
ngar
elat
ionalt
abl
efr
om 1NFt
o2NF(
4mar
ks)
Answer
Thepr ocessfortr
ansforminga1NFt abl
eto2NFi s:
1.I
dent i
fyanydeterminant
sot herthanthecomposi tekey,andthecol umnsthey
determi ne.
2.Cr eateandnameanewt ableforeachdet erminantandt heuniquecol umnsit
determi nes.
3.Mov ethedeterminedcolumnsf rom theoriginaltabl
et othenewt able.The
determi nate
becomest heprimarykeyoft henewt able.
4.Del etethecolumnsy oujustmov edfrom theor i
ginaltabl
eexceptf orthedeter
minat
e
which
wil
l serveasaf orei
gnkey .
5.Theor i
ginalt
ablemayber enamedt omaint ainsemant i
cmeani ng.
b)(i)Whatisadatabaset ransacti
on(2marks)
Answer
Atransacti
onisalogicalunitofdatabasepr
ocessi
ng,whichincl
udeoneormor
edat
abase
operat
ions,suchasinserti
on,delet
ion,modi
fi
cati
on,orr
etri
evaloper
ati
ons.
(
ii
)St
atewhet
hert
heSALESt
abl
ebel
owi
sin1NF.Gi
ver
easonsf
ory
ouranswer(
2mar
ks)
c)St
atewhatt
heseSQLscal
arf
unct
ionsper
for
m
(i
)UCASE()( ii)LCASE()( ii
i)MID()( iv
)NOW ()( 4mar
ks)
Answer
.UCASE( )-Conv ertsaf ieldtouppercase
•LCASE()-Conv er t
saf i
eldtolowercase
•MID()-Extr
actchar actersfrom at extfi
eld
•LEN()-Returnst hel engthofat extfiel
d
•ROUND( )-Roundsanumer icfieldt othenumberofdeci
malsspeci
fi
ed
•NOW( )-Returnst hecur rentsyst em dateandt i
me
•FORMAT( )-For mat showaf i
eldi stobedi spl
ayed
4a)(
i)Whataresur
rogatekeysindat
abaset
abl
es?(3mar
ks)
Answer
Asurrogat
ekey(a.
k.a.ar
ti
fi
cial
key)i
sasyst
em-suppl
i
eduni
quev
aluef
oracol
umnt
hatwi
l
l
ser
veasat abl
e'
spri
mar ykey.
5a)(i)Disti
ngui shbet weenr elati
onal al
gebr aandr elati
onal calcul
us( 4mar ks)
Answer
Ther elati
onal algebr aisapr oceduralquer yl
anguagewi thsev eralf
undament aloperati
ons:
sel
ect( unary),pr oject(unar y),r
ename( unary),car tesianpr oduct(binar y),uni
on( binary
),set
-
dif
ference( binary )
, set-
intersecti
on, naturalj
oin, div i
sion,assignment .Oper at
ionspr oduceanew
rel
ationasar esul t
.
Relationalcalculus, sharedcol l
ecti
onofl ogicallyr elateddat aandadescr ipti
onoft hisdata,
designedt omeett heinf ormat i
onneedsofanor gani zati
on; System cat alog/met adataprovi
des
descripti
onofdat at oenabl eprogram- dataindependence; l
ogicall
yr elateddat acompr ises
enti
ties,attr
ibutes, andr elationshi
psofanor gani zation’sinformation.
(i
i)Whatarestor
edpr oceduresusedforindatabasesy st
em (2marks)
Answer
Astoredpr
ocedureisasubr outi
neavail
abletoapplicat
ionsaccessi
ngar el
ati
onaldat
abase
syst
em.Storedproceduresareactual
lystor
edint hedatabasedatadict
ionar
y.
b)Examinetheconceptofdeadlockandexpl
aintwo( 2)waysofhandli
ngi t(
4mar ks)
Answer
Deadlockrefer
stoaspecif
icconditi
onwhentwoormor eprocessesar
eeachwai t
ingf
oreach
othertorel
easearesour
ce,ormor ethant
wopr ocessesarewaiti
ngforresourcesinacir
cul
ar
chain.
c)Expl
ainhowSQLimplementst
hefol
lowi
ngdat
aty
pesf
ori
tsat
tri
but
es
(i
)Date(i
i)Ti
me(i
ii
)Boolean(
5marks)
Answer
DATE
Has10posi
ti
onsi
nthef
ormat
:YYYY-
MM-
DD
•TI
ME
Has8posi
ti
onsi
nthef
ormat
:HH:
MM:
SS
•
APRI
L,2019EXAMI
NATI
ON
Cour
seCode: CIT843
Cour
seTitl
e: I
ntroducti
ont
oDatabaseManagementSyst
em
Cour
seCredit Unit
:2
Ti
meAllowed: 2Hour s
I
nstr
uct
ion: AnswerQuesti
on1andanyothert
hreequest
ions
Questi
on1
(
a)St atetwomer itsanddemer it
sofTr aditi
onal Mainfr
ameAr chi
tect
ure (6mar
ks)
Answer
AdvantagesofTr adit
ionalMai nframeAr chitecture
Excel l
entsecur ityandcont r
ol ov
erappl i
cations
Hi ghr eli
abil
it
y-y earsofpr ovenMFt echnology
Rel ati
v el
ylowi ncrement alcostperuser( justaddat er
minal)
Di
sadvant agesofTr adi t
ionalMai nframeAr chit
ect ure
Unabl et oef f
ectivel
yser veadv anceduseri nter
faces
User sunabl et oeffecti
velymani pulatedataout si
deofstandardappl
icat
ions
(
b)Whatar
ethet
hreef
eat
urest
hatcoul
dbeusedt
odescr
ibemet
adat
a (
3mar
ks)
Answer
Dataaboutdata.
Datathatdescr
ibehowuserdat aarestoredinter
msoftablename,column
name, dat
atype,l
ength,
primarykeys,et
c.
Me t
adataaretypi
cal
lystor
edinSy st
em tablesorSyst
em Catal
ogandar e
ty
pical
lyonlydi
rect
lyaccessi
blebytheDBMSorbyt hesyst
em administr
ator
.
(
c)Whatdoy
ouunder
standbyFor
eignKeyDomai
n? (
3mar
ks)
Answer
For
eignKeyDomai
ns
Thedatatype,l
ength,
andfor
matofpr
imar
ykey
smustbet
hesameast
he
cor
respondingpri
marykey
.
(
d)Enumer
atef
ourl
i
mit
ati
onoff
il
e-basedsy
stem (
4mar
ks)
Answer
Li
mit
ations:
1.Separ ationandi sol
ati
on: Eachpr
ogram maintai
nsit
sownsetofdat a,user
sof
onepr ogr am maynotawar eofholdi
ngorblocki
ngbyot herpr
ograms.
2.Dupl icat i
on: Samedat aisheldbydif
fer
entprograms,t
hus,wastesspaceand
resour ces.
3.Hi ghmai ntenancecostssuchasensuingdataconsist
encyandcontrol
li
ng
access
4.Shar inggr anular
it
yisverycoarse
5. We aksecur i
ty
(
e)Bri
efl
ydiscussthefoll
owing: (
6mar
ks)
(i
) ValuesAreAtomic
(i
i
) TheSequenceofCol umnsi
sInsi
gni
fi
cant
(i
i
i) Fi leandPr i
nterServ
er
Answer
(i
) Val uesAreAtomic
Thi
sproper
tyimpli
esthatcol
umnsi narelat
ionaltabl
earenotrepeat
inggrouporar
ray
s.
(i
i) TheSequenceofCol umnsisInsignif
icant
Thi
sproper
tystat
esthattheorder
ingofthecolumnsi nt
herelati
onaltabl
ehasno
meani
ng.
(
f)Expl
ain"
Non-
repeat
abl
eread"i
nSQLt
ransact
ion (
3mar
ks)
Questi
on2
(
a)Crit
ical
lyexpl
aint
her
olesofdat
abaseadmi
nist
rat
ioni
nDat
abaseSecur
it
ySy
stem?(
6
marks)
Answer
Thepersonr esponsibleforsecur
it
yofthedatabaseisdatabaseadmi ni
str
ator(DBA).
Thedatabaseadmi ni
stratormustconsi
dervari
etyofpotenti
al t
hreatstothesystem.
Databaseadmi nist
ratorscreat
eauthori
zat
ionrul
esthatdef i
newhocanaccesswhat
partsofdatabaseforwhatoper ati
ons.Enf
orcementofaut hori
zationrul
esinvol
v es
authent
icat
ingt heuserandensur i
ngthatt
heaut hor
izat
ionrulesar enotvi
olat
edby
accessrequest.
(
b)Descr
ibet
hef
ourmai
nrul
est
hatAut
hor
izat
ionshoul
dtakei
ntoaccount
?(9mar
ks)
Answer
Aut
hor i
zat
ionrulestakeintoaccountafewmai nideas:
i. Subjects:I
ndivi
dualswhoper f
orm someact i
vi
tyonthedatabase.
ii
. Objects:Databaseunitst
hatrequir
eauthori
zati
oninordertomanipulate.
ii
i
. Acti
ons: Anyactionthatmightbeperfor
medonanobj ectbyasubj ect.
iv. Constraint
:Amor especi
fi
cruleregar
dinganaspectoftheobjectandaction.
Quest
ion3
(a)Brief
lydescr
ibef
ourkindsofacti
onqueri
es (6mar ks)
Answer
a.AppendQuer y–takesthesetresul
tsofaqueryandappend( oradd)them toan
exist
ingtabl
e.
b.Del eteQuery–deletesallr
ecor
dsinanunderl
yingtablefr
omt hesetr esul
tsofa
query.
c.MakeTabl eQuery–ast henamesuggests,i
tcreatesatablebasedont heset
resul
tsofaquery.
d.Updat eQuer
y–al l
owsf oroneormorefi
eldi
ny ourtabl
etobeupdat ed.
b)Wr
( it
edownt
het
wel
ve(
12)st
epsr
equi
redi
ncr
eat
ingAppendQuer
y? (
9
mar
ks)
Answer[
fol
lowt
hest
eps]
ToCr
eat
eanAppendQuer y:
i
. Creat
eanewquer y,sel
ectDesignv iew,andcl
ickOK.
i
i. Cli
ckthetabl
esand/orqueri
esy ouwantt ouseint heappendquery,cl
i
ckAdd,
andthencli
ckClosewheny ouaret hrough.
i
ii
. Cl i
cktheQueryTypebuttonli
starrowont het
oolbarandselectAppendQuer
y
orsel
ectQueryAppendQuer yfr
om t hemenu.
i
v. Selectthetabletowhichy ouwantt oaddther esultsofthequery.
v
. I
fy ouselectanexisti
ngt abl
e, cl
ickoneoft hef ol
lowingopti
ons: Curr
ent
Database( i
fthetableisinthecur r
entlyopendat abase)orAnot herDatabase
(andtypethenameoft heot herdatabase,incl
udingt hepath,i
fnecessar y
).
Cli
ckOK, andt henaddt hefiel
dsy ouwantt oappendandi denti
fyamat ching
fi
eldifAccessdoesnotsuppl yone.
v
i. Cli
ckOKandcl icktheViewbut t
onont hetoolbart oviewtheresult
soft he
queryortheRunbut t
onont het oolbartoappendt herecor
ds.
Questi
on4
(
a)Discusst
heconceptofOpenDat
abaseConnect
ivi
ty(
ODBC) (
10mar
ks)
Answer
OpenDat abaseConnect ivi
ty(ODBC)isMi crosoft'
sstrategicinterfacef oraccessing
datainahet erogeneousenv i
ronmentofrelationalandnon-r elationaldat abase
managementsy stems.ODBCpr ovi
desanopen, vendor-neutral wayofaccessi ngdata
storedinav ari
et yofpropri
etarypersonalcomput er,minicomput er ,
andmai nfr
ame
databases.
ODBCal lev
iatest heneedf orindependentsoftwar evendorsandcor poratedevelopers
tolearnmultipleappl i
cati
onpr ogr
ammi nginterfaces.ODBCnowpr ovidesauni versal
dataaccessi nterface.WithODBC, appli
cati
ondev el
operscanal l
owanappl i
cationto
concurrent
lyaccess, vi
ew,andmodi fydataf r
om mul ti
ple,div
er sedat abases.
(
b)Stat
efi
veadv
ant
agesofaDat
abaseManagementSy
stem (
DBMS)
(5mar
ks)
Answer
Adv
ant
agesofaDBMS
i
. ADBMScanpr ovide:
i
i
. DataConsistencyandI ntegri
ty-bycontr
oll
ingaccessandmi ni
mizi
ngdata
dupli
cati
on
i
i
i. Appli
cati
onpr ogram independence-bystoringdat
ainauniformfashi
on
i
v. DataSharing-bycont rol
lingaccesstodataitems,manyuserscanaccess
dataconcurrentl
y
v
. BackupandRecov ery
v
i. Securi
tyandPr i
vacy
v
ii
. Multi
plevi
ewsofdat a
Questi
on5
(
a)Dataintegr
it
yisenfor
cedintherel
ati
onal
model byenti
tyandr
eferent
iali
ntegr
it
yrul
es.
Cr
it
ical
l
ycompar eEnti
tyI
ntegr
it
yandReferent
ialI
ntegr
it
y( 8marks)
Answer
Ent
it
yInt
egr
it
y
Theenti
tyi
ntegr
it
yrulestatesthatforev
eryinstanceofanenti
ty,t
hev alueofthe
pri
marykeymustexist,beunique,andcannotbenul l
.Wit
houtenti
tyintegri
ty,
the
pri
marykeycoul
dnotf ulf
il
lit
sroleofuniquel
yidenti
fyi
ngeachinstanceofanent i
ty.
Ref
erent
ialI
ntegr
it
y
Ther
efer
ent
ial
int
egr
it
yrul
est
atest
hatev
eryf
orei
gnkeyv
aluemustmat
chapr
imar
y
keyval
uei
nanassociatedtable.Ref
erent
ial
int
egr
it
yensur
est
hatwecancor
rect
ly
navi
gat
ebetweenr
elatedentit
ies.
(
b)Expl
aintheconceptofgener
ali
zat
ionhi
erar
chyi
nrel
ati
ont
odat
abasemanagement
(7
marks)
Answer
Agenerali
zati
onhierar
chyisaform ofabst
racti
onthatspecifi
esthatt
woormor e
ent
it
iesthatsharecommonat t
ributescanbegenerali
zedintoahigherl
evelent
it
ytype
edasuper
cal
l typeorgeneri
centit
y.Thelower-
level
ofenti
tiesbecomet hesubt
ype,
or
cat
egori
es,tothesuperty
pe.Subtypesaredependententi
ti
es
NOVEMBER,
2018EXAMI
NATI
ONS
COURSECODE:CI
T843
TLE:I
COURSETI NTRODUCTI ONTODATABASEMANAGEMENTSYSTEM
CREDI
T:2Uni
ts
TI
MEALLOWED:2Hours
I
NSTRUCTI
ON:Answeranyf
ourquest
ions
Quest
ion1
a) i
. Dat
abasecanbedescr
ibedasamodelofwhatt
heuser
sper
cei
ved,l
i
st
and
expl
aint
hreemai
ncat
egor
iesofsuchmodel
s (
3mar
ks)
Answer
Threemai ncategori
esofmodel s:
1.UserorConcept ualModel s:Howuser sperceiv
ethewor ldand/orthebusiness.
2.LogicalModels:Representthelogicofhowabusi nessoperates.Forexample,the
rel
ati
onshipbetweendi f
ferententi
ti
esandt heflowofdat athroughtheorganizat
ion.
Basedont heUser '
smodel .
3.PhysicalModels:Representhowt hedatabasei sactual
lyimplementedona
comput ersyst
em.Thi si
sbasedont helogi
cal model.
i
i
. Di
sti
ngui
shbet
weenAssoci
ati
veent
it
yandSubt
ypeent
it
ies (
2mar
ks)
Answer
anassoci
ati
veenti
tyareent
it
iescansometimesrepr
esentt
her
elat
ionshi
psbet
ween
twoormoreobject
s.
Asubtypeent
it
yrefer
stoeachr ef
inedver
sionent
it
y
b)Sket
cht
hebl
ockdi
agr
am ofadat
abasesy
stem showi
ngal
li
tspar
ts (
5
mar
ks)
Answer
c)Bri
efl
yexpl
ainthefoll
owingsect
ionsi
naMicrosof
tAccessreport
:
i
.)GroupHeaderii
.)Detai
li
ii
.)Gr
oupfoot
eri
v.
)Reportheaderv.)pagerheader
.
(5marks)
Answer
d)Wi
thoneexampl
eeach,
expl
aint
hef
oll
owi
ngSQLcommands (
5
mar
ks)
i
) CREATE, i
i) ALTER,i
ii
) DROP,i
v) SELECT
Answer
TheCREATETABLEstatementi
susedt
ocr
eat
eat
abl
einadat
abase.Exampl
e
CREATETABLEtable_
name
(
col
umn_name1data_t
ype,
col
umn_name2data_t
ype,
col
umn_name3data_t
ype,
.
..
.
)
TheALTERcommandal l
owsyout omakechangest othestruct
ureofat
abl
ewi
thout
del
eti
ngandrecr
eati
ngi t
Example: ALTERTABLEper sonal_ i
nfo
ADDsalarymoneynul l
DROP,all
owsustoremov eenti
redat abaseobj
ect
sfrom ourDBMS.
Example:DROPTABLEper sonal_i
nfo
TheSELECTstat
ementi susedtoselectdatafr
om adatabase.
Example
SELECTcolumn_
name( s)FROM table_name
SELECT*FROM tabl
e_name
e)Cr
it
ical
lyexpl
ainwhyt
heconceptofdat
aModel
i
ngi
sImpor
tant
? (
5
marks)
Answer
Thegoaloft
hedat
amodeli
stomakesur
ethatal
lthedat
aobj
ect
srequi
redbyt
he
dat
abasear
e
compl
etel
yandaccur
atel
yrepr
esent
ed.Becauset
hedat
amodeluseseasi
l
yunder
stood
not
ati
ons
andnat
ural
language,
itcanber
evi
ewedandv
eri
fi
edascor
rectbyt
heend-
user
s.
Quest
ion2
a)Br
ief
lydescr
ibet
hedat
abasedev
elopmentpr
ocess. (
5
mar
ks)
Answer
Thef ollowingar ebr i
efout
li
nedescr i
bingthedat abasedev elopmentpr ocess.
Userneedsassessmentandr equirementsgat heri
ng:Det erminewhatt heuser sare
l
ookingf or,whatf uncti
onsshoul dbesuppor ted,howt hesy stem shoul dbehav e.
Dat aModel i
ng:Basedonuserr equirements, f
orm alogical model oft hesyst em.This
l
ogical model ist henconvertedt oaphy si
caldat amodel (tables,columns, r
elationshi
ps,
et
c.)t hatwi l
lbei mplemented.
Impl ement ation:Basedont hedat amodel,adat abasecanbecr eated.Appl icati
ons
arethen
writ
tent operformt herequir
edf unctions.
Test ing:Thesy stem i
stestedusi ngrealdata.
Depl oy ment:Thesy st
em isdepl oyedtouser s.Maintenanceoft hesy stem begi ns.
b)I
dent
if
yfi
ve(
5)adv
ant
agesofusi
ngadat
abasemanagementsy
stem (
5
mar
ks)
Answer
Adv
ant
agesofaDBMS
i
. ADBMScanpr ovi
de:
i
i
. Dat
aConsi
stencyandInt
egr
it
y-bycont
rol
l
ingaccessandmi
nimi
zi
ngdat
a
dupli
cati
on
i
i
i. Appli
cati
onpr ogram i
ndependence-byst
ori
ngdat
ainauni
formfashi
on
i
v. DataSharing-bycont r
oll
i
ngaccesstodatai
tems,
manyuserscanaccess
dataconcurrentl
y
v
. BackupandRecov er
y
v
i. Securi
tyandPr i
vacy
v
ii
. Multi
plevi
ewsofdat a
c)Br
ief
lyexpl
aint
hef
ourdat
abaseSecur
it
yissuesatMai
ntenanceLev
el (
5
mar
ks)
Answer
Thef
oll
owi
nggui
del
i
nesshoul
dbeputi
ntoconsi
der
ati
onatt
hedesi
gnst
age:
i
.Thedat
abaseshoul
dbesi
mpl
eandeasi
ert
ouse.
i
i
.Dat
abasemustbenor
mal
i
zed
i
i
i.Youshoul
ddeci
det
hepr
ivi
l
egef
oreachgr
oupofuser
s.
i
v.Cr
eat
euni
quev
iewf
oreachuserorgr
oupofuser
s.
Quest
ion3
a)St
ateandbr
ief
lyexpl
aint
hebasi
ccl
assi
fi
cat
ionsofconnect
ivi
tyf
orr
elat
ions
(
5mar
ks)
Answer
•One-t
o-one,
•one-t
o-many,and
•ma ny-
tomany .
.Aone-
i t
o-one( 1:
1)rel
ationshi
pi swhenatmostonei nstanceofaentit
yAi s
associ
ated
withoneinstanceofent i
tyB.
i
i.Aone-to-many( 1:
N)relati
onshipsiswhenforoneinstanceofenti
tyA,therearezer
o,
one,
ormanyi nstancesofentityB,butforoneinst
anceofentityB,t
hereisonlyoneinst
ance
of
enti
tyA.
i
i.Amany
i -
to-many(M: N)relat
ionship,
someti
mescal l
ednon-specif
ic,
iswhenf orone
i
nstanceofent it
yA,therearezer o,
one,ormanyinst
ancesofent i
tyBandf orone
i
nstance
ofenti
tyBt herearezero,one,ormanyi nst
ancesofenti
tyA.
b)Br
ief
lyexpl
ainf
ivechar
act
eri
sti
csofagooddat
amodel (
5
mar
ks)
Answer
Thef
oll
owingar ethechar act eristi
csofagoodDat aModel :
Compl et
eness: Doest hemodel suppor tal
lnecessar ydata?
Nonr edundancy :Doest hemodel specifyadat abaseinwhi chthesamef act
coul dber ecor dedmor et hanonce?
Enf orcementofBusi nessRul es:Howaccur atelydoesthemodel r
eflectand
enfor cet her ulest hatappl yt othebusi nessdat a?
Dat aReusabi l
ity :Wi l
l thedat ast oredinthedat abaseber eusableforthe
pur posesbey ondt hoseant ici
pat edint heprocessmodel ?
Stabi l
ityandFl exibi l
ity:Howwel lwil
l t
hemodel copewithpossi bl
echanges
tot hebusi nessr equi rement s?
Elegance: Doest hedat amodel provideareasonabl eneatandsi mple
classif i
cationoft hedat a?
Communi cation: Howef fect i
veist hemodel i
nsuppor ti
ngcommuni cati
on
amongt hev ar i
ousst akehol dersi nthedesignoft hesystem?
Integr ati
on: Howwi l
lthepr oposeddat abasefitwi t
htheor gani
zati
on’s
existingandf utur edat abase?
c)Gi
veashor
tdescr
ipt
ionoft
hef
oll
owi
ngt
erms:Ent
it
ies,At
tri
but
es,I
dent
if
ier
,
Rel
ati
onshi
ps(
5mar
ks)
Answer
Ent
it
iesar
ethepr
inci
paldat
aobj
ectaboutwhi
chi
nfor
mat
ioni
stobecol
lect
ed.
At
tri
but
esdescr
ibet
heent
it
yofwhi
cht
heyar
eassoci
ated
I
dent
if
ieri
saspeci
alat
tri
but
eusedt
oident
if
yaspeci
fi
cinst
anceofanent
it
y.
ARel
ati
onshi
prepr
esent
sanassoci
ati
onbet
weent
woormor
eent
it
ies.
Quest
ion4
a)St
atet
hegoal
sofr
equi
rement
sanal
ysi
s (
2½mar
ks)
Answer
Thegoal
soft
her
equi
rement
sanal
ysi
sar
e:
t
odet
ermi
net
hedat
arequi
rement
soft
hedat
abasei
nter
msofpr
imi
ti
veobj
ect
s
t
ocl
assi
fyanddescr
ibet
hei
nfor
mat
ionaboutt
heseobj
ect
s
t
oident
if
yandcl
assi
fyt
her
elat
ionshi
psamongt
heobj
ect
s
t
odet
ermi
net
het
ypesoft
ransact
ionst
hatwi
l
lbeexecut
edont
hedat
abaseandt
he
i
nter
act
ionsbet
weent
hedat
aandt
het
ransact
ions
t
oident
if
yrul
esgov
erni
ngt
hei
ntegr
it
yoft
hedat
a
b)Expl
aint
hef
oll
owi
ngt
ypesofMi
crosof
tAccessQuer
ies (
7½ mar
ks)
i
.Act
ionQuer
y
i
i
.Par
amet
erQuer
y
i
i
i.Aggr
egat
eQuer
y
Answer
Act i
onQuer y
Whent heact i
onquer yiscall
ed, thedatabaseunder goesaspeci fi
cacti
ondependi ngon
whatwasspeci fi
edint hequeryitself
.Thiscanincludesucht hingsascreati
ngnew
tables,del et
ingr owsf r
om existi
ngonesandupdat ingr ecordsorcreati
ngentirelynew
ones.
Par amet erQuer y
Apar amet erquer yworkswi t
hot hert y
pesofqueriest ogetwhat everr
esult
sy ouar e
after.Thi sisbecause, whenusi ngt hi
st y
peofquer y,youar eabletopassapar amet er
toadi f
ferentquer y,suchasanact ionoraselectquer y.
Aggr egat eQuer y
Thisi saspeci altypeofquery.Itwor ksonotherquer i
es( suchasselecti
on,actionor
paramet er)justli
ket heparamet erquerydoes,butinsteadofpassi ngaparamet erto
anot herquer yi tt
otalsuptheitemsbysel ect
edgroups.
c)Wr
it
edownf
ivepr
ocedur
est
ofol
l
owwhenconv
ert
ingamodel
toaschema
(
5mar
ks)
Answer
i
. Conv ertallent i
tiest ot ables.Theent itynamebecomest het ablename,
andt heent it
yat tr
ibutesbecomet het abl ecol umns.
ii
. Findt hecandi dat ekey sforeacht able, andf rom them choosea
primar ykeyf oreacht able( i
fpossi ble).
ii
i
. Repl aceone- to-one, one- to-many ,andsubt ypeent it
yr elationshipswith
foreignkeycol umnsi nt heappr opr iatet ables.
iv
. Repl acemany -to-manyent ityrelationshi pswi thanewj oi ntablethat
cont ainsf oreignkeycol umnsoft her elatedt ables.
v. Basedont hepar t
icipat i
onoft heent i
tyr elationships,sett hecolumn
datat ypef orthef oreignkey stoal lowordi sal l
owNULLv alues.
vi
. Nowt hatthef or eignkeycol umnsar ei nplace, fi
ndt hecandi datekeys
forthet ablesagai n( i
ncludi nganynewl y-addedt ables) ,andsel ecta
primar ykeyf rom t hese.Addsur rogat ekey sifnecessar y.
vi
i. Wr i
tedownt hef unct i
onal dependenci esbet weencol umnsf oreach
tableandv ali
dat et het ablesagai nstt heCOMP210i nterpr et
ationofthe
fi
rst5nor mal for msf orpot entialmodi f
icationanomal ies.
vi
ii
. Transl atet hev alidatedschemai nt oSQLDDLandcr eat et hetables,
i
ndi ces, andanyr eferent i
al oruni quei nt egrityconst r
aint s,inan
RDBMS.
Quest
ion5
a)Whatdoy
ouunder
standbySur
rogat
eKey
? (
2mar
ks)
Answer
Asurrogatekey(a.k.
a.ar
ti
fi
cialkey)i
sasyst
em-suppli
eduni
queval
ueforacol
umnt
hat
wi
llserveasatable'spr
imarykey.Theval
ueofasurrogat
ekeyhasnobusi
ness
meani
ngandisintendedonl
yasameansforestabl
i
shingrel
ati
onshi
psbet
weent
ables
(
thr
oughforei
gnkey s)
.
b)Discussthethreer
easonsf
orusi
ngsurr
ogatekeys (5
mar
ks)
Answer
Therear
et hreemai nreasonsf orusi ngsur r
ogatekey s:
i
. Per formance:Ifthepr i
mar ykeyf orat ablei salongt extstri
ng,theRDBMS
willhav etocreateanenor mousi ndexf ort hetable.Foreignkey sthat
referencethistablewi l
l besimilarl
yhuge.Sur rogatekey sareusual ly32-
bit
i
nteger sandcant hereforebemani pulatedv eryeffi
cientl
y .
i
i
. Primar ykeysmustnotchangev alues: i
f,forexampl e,theprimar ykeyfora
tableisanempl oyee'
sf ullname, thev aluesoft hepr i
mar ykeycoul d
pot enti
all
ychange( throughmar ri
age, orforcel ebri
ty-i
nducedr easons: "
The
ArtistFormerlyKnownAsPr i
nce").Asur r
ogatekeyi snotaf fectedbysuch
changes, parti
cularl
yift heusersoft hesy stem neverseet hesur rogatekey
values.
i
i
i. Noot herpri
mar ykeycanbef oundf orat able.
c)Br
ief
lyexpl
aint
hePr
oper
ti
esofRel
ati
onal
dat
abaseTabl
es (
5
mar
ks)
Answer
Relational tableshav esixproper ti
es:
i
.Val uesar eat omi c.
i
i.Col umnv aluesar eoft hesameki nd.
i
ii.Eachr owi suni que.
i
v .Thesequenceofcol umnsi si nsignificant.
v.Thesequenceofr owsi sinsignificant .
v.E
i achcol umnmusthav eauni quename.
(i
)Val uesAr eAt omi c
Thispr opertyimpl iest hatcolumnsi nar elat
ional tablearenotrepeatinggrouporarray
s.
(i
i)Col umnVal uesar eoft heSameKi nd
I
nr el
at i
onal termst hismeanst hatal lv aluesi nacol umncomef r
om t hesamedomai n.
Adomai nisasetofv alueswhi chacol umnmayhav e.
(i
ii)EachRowi sUni que
Thispr opertyensur est hatnot wor owsi nar elationaltablearei
dentical;t
herei
satleast
onecol umn, orsetofcol umns, t hev aluesofwhi chuni quelyi
denti
fyeachr owinthe
table.
(i
v )TheSequenceofCol umnsi sI nsigni fi
cant
Thispr opertyst atest hattheor der i
ngoft hecol umnsi nt herel
ati
onal tabl
ehasno
meani ng.
(v)TheSequenceofRowsi sInsi gnifi
cant
Thispr opertyisanal ogoust heoneabov ebutappl i
est orowsinsteadofcol umns
(vi
)EachCol
umnhasaUni queName
Becauset
hesequenceofcol
umnsisi
nsi
gni
fi
cant
,col
umnsmustber
efer
encedby
name
andnotbyposi
ti
on.
d)Di
scusswhati
smeantbyDat
aRedundancy (
5
marks)
Answer
DataRedundancyi
sacondit
ionthatexi
stswhenadataenvi
ronmentcontai
ns
unnecessar
il
ydupl
icat
eddat
a.Achangeormodi f
icat
ion,
toredundantdat
a,r
equi
res
thatyoumakechangestomult
ipl
efiel
dsofadatabase
Quest
ion6
a)Br i
efl
yexpl ai
nt heEnt it
y–Relat i
onship(ER)model .Whatar et heut ili
tyoftheER
model forthedat abasedesi gner ? (
5
marks)
Answer
TheEnt ity-
Relati
onship( ER)model isaconcept ualdatamodel thatv iewst her ealworl
d
asent i
tiesandr el
ationshi ps.Abasi ccomponentoft hemodel i
st heEnt it
y -
Rel at
ionshi
p
di
agr am whi chisusedt ov isual
lyr
epr esentdataobjects.
Theut il
ityoftheERmodel is:
o I tmapswel ltother elationalmodel .Theconstructsusedint heERmodel caneasil
y
bet ransformedi nt
or el ati
onalt
abl es.
o I tissimpl eandeasyt ounder st
andwi thami ni
mum oft rai
ning.Ther efore, t
hemodel
canbeusedbyt hedat abasedesi gnertocommuni cat
et hedesi gnt otheenduser .
o I naddi t
ion,themodel canbeusedasadesi gnplanbyt hedat abasedev el
opert o
i
mpl ementadat amodel i
nspecifi
cdat abasemanagementsof twar e.
b)i
. Wheni
sar
elat
ionaldat
abaset
abl
esai
dtobei
n1NF,2NF,and3NF(
3
mar
ks)
Answer
Ar elati
onal t
able,bydefi
nit
ion,i
sinfir
stnor malfor
mi fallval
uesofthecolumnsare
atomi c.Thatis,theycontai
nnor epeati
ngv al
ues
Thedef i
nit
ionofsecondnor malform stat
esthatonlytableswit
hcompositeprimary
key scanbei n1NFbutnoti n2NF.
Thet hirdnor malformrequiresthatal
l col
umnsinar el
ationalt
ablearedependentonl
y
upont hepr imarykey.
i
i
.Whatar
ethet
woi
mpor
tantr
est
ri
cti
onsoft
hepr
imar
ykey
? (
2
mar
ks)
Answer
•Apri
marykeymustnotcontai
nanycolumnsthatal
lowNULLval
ues.
•Theval
ueofapr
imarykey,whethercomposedofoneormanycol
umns,
mustnev
er
change.
c)Usi
ngt
her
elat
ional
tabl
esAandBbel
owgener
atear
elat
ional
tabl
esf
or
i
) A ∪B,i
i
) A–B (
5mar
ks)
Answer
JULY2017EXAMI
NATI
ON
Cour
seCode:CI
T843 Cour
seUni
t:2
Cour
seTi
tl
e:DATABASEMANAGEMENTSYSTEMS
I
nst
ruct
ion: AnswerQuest
ion1andAnyot
her3Quest
ions
Ti
meAl
lowed: 2Hour
s
1a. Def
inedat
abase. 4mar
ks
Answer
Adatabaseisacol
lect
ionofi
nfor
mat
iont
hati
sor
gani
zedsot
hati
tcaneasi
l
ybe
accessed,
managed,andupdat
ed.
b. Stat
ethecomponent
sofaDat
abaseSy
stem (
DBS)
. 6
mar
ks
Answer
o TheDat
abase;
o TheDBMS;and
o Appl
i
cat
ionPr
ogr
ams(
whatuser
sint
eractwi
th)
c. Giv
eabr
iefout
li
nedescr
ibi
ngt
hedat
abasedev
elopmentpr
ocess. 10
marks
Answer
Thef ollowingar ebr i
efout
li
nedescr i
bingthedat abasedev elopmentpr ocess.
Userneedsassessmentandr equirementsgat heri
ng:Det erminewhatt heuser sare
l
ookingf or,whatf uncti
onsshoul dbesuppor ted,howt hesy stem shoul dbehav e.
Dat aModel i
ng:Basedonuserr equirements, f
orm alogical model oft hesyst em.This
l
ogical model ist henconvertedt oaphy si
caldat amodel (tables,columns, r
elationshi
ps,
et
c.)t hatwi l
lbei mplemented.
Impl ement ation:Basedont hedat amodel,adat abasecanbecr eated.Appl icati
ons
arethen
writ
tent operformt herequir
edf unctions.
Test ing:Thesy stem i
stestedusi ngrealdata.
Depl oy ment:Thesy st
em isdepl oyedtouser s.Maintenanceoft hesy stem begi ns.
d. Thedat amodeli
sonepar toftheconceptualdesi
gnprocess.Theotheri
sthe
functi
onmodel.Thedat amodel focusesonwhatdat ashouldbestoredi
nthe
databasewhil
ethef unct
ionmodel dealswithhowt hedat
aisprocessed.I
nthe
contextoft
herelat
ionaldatabase,whatarethetwomodel susedfor?
5mar ks
Answer
•Thedatamodel i
susedtodesi
gntherel
ati
onal
tabl
es.
•Thefunct
ional
model i
susedtodesi
gnthequeri
esthatwi
l
laccessandper
for
m
oper
ati
onsont
hoset
abl
es.
2a. Bri
efl
yexpl
ainwhati
sadat
amodel
. 3
marks
Answer
Thedatamodelfocusesonwhatdat
ashoul
dbestoredi
nthedat
abasewhi
l
ethe
funct
ionmodel
dealswithhowthedatai
spr
ocessed.
b. Whati
sdat
abasedesi
gn? 3mar
ks
Answer
Dat
abaseDesi
gn:
Theact
ivi
tyofspeci
fyi heschemaofadat
ngt abasei
nagi
vendat
a
model
c. Enumer
atesi
xoft
hechar
act
eri
sti
csofagoodDat
aModel
. 9
mar
ks
Answer
Thef
oll
owingar ethechar act eristi
csofagoodDat aModel :
Compl et
eness: Doest hemodel suppor tal
lnecessar ydata?
Nonr edundancy :Doest hemodel specifyadat abaseinwhi chthesamef act
coul dber ecor dedmor et hanonce?
Enf orcementofBusi nessRul es:Howaccur atelydoesthemodel r
eflectand
enfor cet her ulest hatappl yt othebusi nessdat a?
Dat aReusabi l
ity :Wi l
l thedat ast oredinthedat abaseber eusableforthe
pur posesbey ondt hoseant ici
pat edint heprocessmodel ?
Stabi l
ityandFl exibi l
ity:Howwel lwil
l t
hemodel copewithpossi bl
echanges
tot hebusi nessr equi rement s?
Elegance: Doest hedat amodel provideareasonabl eneatandsi mple
classif i
cationoft hedat a?
Communi cation: Howef fect i
veist hemodel i
nsuppor ti
ngcommuni cati
on
amongt hev ar i
ousst akehol dersi nthedesignoft hesystem?
Integr ati
on: Howwi l
lthepr oposeddat abasefitwi t
htheor gani
zati
on’s
existingandf utur edat abase?
3a. I
nthecont
extofE-
Rmodel
,def
inet
hef
oll
owi
ngt
erms:
i
) Rel
ati
onshi
pii
) Connect
ivi
tyi
i
i) Car
dinal
i
ty 6mar
ks
Answer
i
) ARel
ati
onshi
prepr
esent
sanassoci
ati
onbet
weent
woormor
eent
it
ies.
a.UserDat a
b.Metadata
c.I
ndexes
d.Applicat
ionmet adata
UserDat
a:User swor kwithdatabasedir
ectl
ybyenteri
ng,updat i
ngandv iewingdat
a.
Met
adat a:Dat at hatdescribehowuserdataarestoredinter
msoft ablename,
col
umn
name, datatype,length,primarykeys,et
c.
I
ndexes:I nkeepingwi thourdesiretoprovi
deuserswithseveraldiff
erentviewsof
data,
i
ndexespr ov i
deanal t
ernatemeansofaccessing,sorti
ngandsear chingdata.
Appl
icationsMet adat a:ManyDBMShavest oragefaci
li
ti
esf orforms,report
s,
queri
esandot herappl i
cati
oncomponent s.Appli
cati
onsMet adataisaccessedv i
athe
databasedev elopmentpr ograms
5. Wr
it
eSQLst
atement
sfort
hef
oll
owi
ng:
i
. Toi
nser
tat
upl
eforSmi
thwhohas$1200i
naccountA-
9372att
heSFUbr
anch.
i
i
. Toi
ncr
easeal
laccountbal
ancesby5per
cent
.
i
i
i. Tomaket
wodi
ff
erentr
atesofi
nter
estpay
ment
,dependi
ngonbal
anceamount
i
v. Del
eteal
ll
oanswi
thl
oannumber
sbet
ween1300and1500.
v
. Del
eteal
laccount
satbr
anchesl
ocat
edi
nSur
rey
. 15mar
ks
Answer-
--
-i
Toinsertatupl
ef orSmi t
hwhohas$1200inaccountA-
9372att
heSFUbranch.
i
nsertintoaccount
val
ues( “
SFU”,“A-9372”,1200)
Toprov i
deeachl oanthatthecust
omerhasi
ntheSFUbranchwi
tha$200
savi
ngsaccount .
i
nsertintoaccount
ectbname,
sel loan#,200
fom l
r oan
wherebname=” SFU”
Answer-
--
-ii
Toincreaseallaccountbal
ancesby5per
cent
.
updateaccount
setbalance=balance*1.05
Answer
--
--
ii
i
Tomaketwodi
ff
erentr
atesofi
nter
estpay
ment
,dependi
ngonbal
anceamount
:
updateaccount
setbalance=bal
ance*1.
06
wherebalance>10,000
updateaccount
setbalance=bal
ance*1.
05
wherebalance10,000
Answer-
--
-iv
Del
eteall
ofSmith’
saccountr
ecords.
del
etefom deposi
r tor
wherecname=”Smit
h”
Del
eteall
loanswit
hloannumbersbetween1300and1500.
del
etefom l
r oan
el
wher oan#bet
ween1300and1500
Answer-
--
-v
Deleteallaccountsatbr
anchesl
ocat
edi
nSur
rey
.
deletefrom account
wher ebnamei n
(selectbname
from branch
wher ebcity
=”Surrey
”)
6a. Whatdoy ouunder
standbynormal
izat
ion? 2marks
Answer
Normali
zati
onisadesi
gntechni
quethati
swidelyusedasagui
dei
ndesi
gni
ng
rel
ati
onaldat
abases
b. Expl ai
nt hef oll
owingt erms
i
.Funct i
onal dependency 2mar ks
i
i.First,Second, andThir
dNormal Forms 6marks
Answer
Theconceptoff unct i
onaldependenciesisthebasisfort
hefir
stthreenormalforms.A
column,Y,
ofther elat
ional t
ableRissaidt
obef uncti
onal
lydependentuponcol umnX
ofRifandonlyi feachv alueofXi nRisassociatedwi
thpreci
selyonevalueofYatany
giv
entime
(
i)Fi
rstNor
malFor
m
Arel
ati
onaltabl
e,bydefi
nit
ion,
isinfir
stnormal f
ormi
fal
lval
uesoft
hecol
umnsar
e
at
omic.Thatis,
theycontai
nnor epeati
ngvalues.
(
ii
)SecondNor
malFor
m
Thedef
ini
ti
onofsecondnor
malfor
m st
atest
hatonl
ytabl
eswi
thcomposi
tepr
imar
y
key
scanbein1NFbutnotin2NF.
(
ii
i)Thi
rdNor
malFor
m
Thet
hir
dnor
mal
for
mrequi
rest
hatal
lcol
umnsi
nar
elat
ional
tabl
ear
edependentonl
y
upont
hepr
imar
ykey
.
c. Out li
netheprocessf ortr
ansforminga1NFt ableto2NF. 5marks
Answer
Thepr ocessfortr
ansforminga1NFt abl
eto2NFi s:
1.I
dent i
fyanydeterminant
sot herthanthecomposi tekey,andthecol umnsthey
determi ne.
2.Cr eateandnameanewt ableforeachdet erminantandt heuniquecol umnsit
determi nes.
3.Mov ethedeterminedcolumnsf rom theoriginaltabl
et othenewt able.The
determi nate
becomest heprimarykeyoft henewt able.
4.Del etethecolumnsy oujustmov edfrom theor i
ginaltabl
eexceptf orthedeter
minat
e
which
wil
l serveasaf orei
gnkey .
5.Theor i
ginalt
ablemayber enamedt omaint ainsemant i
cmeani ng.
Oct
ober
/Nov
ember2016Exami
nat
ion
Cour
seCode:CI
T843 Cour
seUni
t:2
Cour
seTi
tl
e:DATABASEMANAGEMENTSYSTEMS
I
nst
ruct
ion: AnswerAnyFourQuest
ions
Ti
meAl
lowed: 2Hour
s
1a. Expl
ainwhati
smeantbyaDat
abaseManagementSy
stem (
DBMS)
.4mar
ks
Answer
DatabaseManagementSyst
em (DBMS)i
sacoll
ect
ionofsof
twareprogr
amst
hatar
e
usedtodefi
ne,const
ruct
,maint
ainandmani
pul
atedat
ainadatabase
b. Li
stt
hreedi
ff
erentt
ypesofi
nfor
mat
ionst
oredi
nadat
abase. 3mar
ks
c. Enumer
atet
het
hreecomponent
sofaDat
abaseSy
stem (
DBS)
. 3
mar
ks
Answer
o TheDat
abase;
o TheDBMS;and
o Appl
i
cat
ionPr
ogr
ams(
whatuser
sint
eractwi
th)
d. Out
li
neanyf
iveadv
ant
agesofaDBMS. 7½mar
ks
Answer
Adv
ant
agesofaDBMS
i
. ADBMScanpr ovide:
i
i
. DataConsistencyandI ntegri
ty-bycontr
oll
ingaccessandmi ni
mizi
ngdata
dupli
cati
on
i
i
i. Appli
cati
onpr ogram independence-bystoringdat
ainauniformfashi
on
i
v. DataSharing-bycont rol
lingaccesstodataitems,manyuserscanaccess
dataconcurrentl
y
v
. BackupandRecov ery
v
i. Securi
tyandPr i
vacy
v
ii
. Multi
plevi
ewsofdat a
2. Expl
aint
hef
oll
owi
ngSQLt
ransact
iont
erms:
Lostupdatepr
oblem 5mar
ks
Dir
tyread 5mar
ks
Non-r
epeatabl
eread 3mar
ks
Phantom r
ead 4½marks
3. Consi
dert
hef
oll
owi
ng“
Order
s”t
abl
e:
Or
der
IdOrder
Date Pri
ceCustomername
11 2008/11/
121000HenryBank
21 2008/10/
231600Niy
iAlade
31 2008/09/
02700 HenryBank
130214018
41 2008/09/
03300 HenryBank
51 2008/08/
302000JamesAdeola
61 2008/10/
04100 Niy
iAlade
Writ
etheSQLst atementt hat:
i
) Findtheav eragevalueoft hePr i
cecolumn.
i
i) Findthecust omerst hathav eor derPri
cevaluehigherthantheaver
agePr
ice
value.
i
ii
) Countt henumberofor der sfrom "CustomerNiyiAl
ade"
i
v) Countt henumberofuni quecust omersinthe"Orders"tabl
e.
4½mar kseachexcept(i)wit
h4marks
Answer
i
.SELECTAVG( Price)ASAv eragePriceFROM Or der
s
i
i.SELECTCust omer nameFROM Or ders
a.WHEREPr ice>(SELECTAVG( Price)FROM Orders)
i
ii
.SELECTCOUNT( Cust omer)ASNi y i
AladeFROM Or ders
a.WHERECust omer='NiyiAlade'
i
v.SELECTCOUNT( *)ASNumber OfOr dersFROM Or ders
4a. Out
li
net
hedat
abasedev
elopmentpr
ocess. 10
marks
Answer
Thef ollowingar ebr i
efout
li
nedescr i
bingthedat abasedev elopmentpr ocess.
Userneedsassessmentandr equirementsgat heri
ng:Det erminewhatt heuser sare
l
ookingf or,whatf uncti
onsshoul dbesuppor ted,howt hesy stem shoul dbehav e.
Dat aModel i
ng:Basedonuserr equirements, f
orm alogical model oft hesyst em.This
l
ogical model ist henconvertedt oaphy si
caldat amodel (tables,columns, r
elationshi
ps,
et
c.)t hatwi l
lbei mplemented.
Impl ement ation:Basedont hedat amodel,adat abasecanbecr eated.Appl icati
ons
arethen
writ
tent operformt herequir
edf unctions.
Test ing:Thesy stem i
stestedusi ngrealdata.
Depl oy ment:Thesy st
em isdepl oyedtouser s.Maintenanceoft hesy stem begi ns.
b. Bri
efl
yexpl
aint
het
hreemai
ncat
egor
iesofmodel
s. 7½
marks
Answer
1.UserorConcept ualModels:Howusersperceiv
ethewor l
dand/orthebusi
ness.
2.LogicalModels:Representthel
ogicofhowabusi nessoper
ates.
3.PhysicalModels:Representhowthedatabaseisactual
l
yimplementedona
comput ersy
stem.
5a. Expl ai
nwhatsecur
ityinadatabaseinv
olv
es. 2½marks
Answer
Databasesecur
it
yref
erstotheprot
ectionofdat
aagai
nstunaut
hor
izedaccess,
al
terat
ion,
ordestr
uct
ion.
b. Out linet hr eeneedsf ordatabasesecur i
ty. 6
mar ks
Answer
Theneedf ordat abasesecur i
tyisgivenbelow:
a.Inamul ti-userdat abase,multi
pleuserstrytoaccesst hedataatthesamet ime.I
n
ordertomai ntaint heconsistencyoft hedata,databasesecuri
tyi
sneeded
b.Forthedat at hatar ebeingaccessedt hr
ought heWor ldWideWeb, ther
eisneedto
protectthedat aagai nsthackers.
c.Theuseofcr edi tcardsisbecomi ngmor epopul ar
,themoneytransacti
onhast obe
saved.Mor especi al
izedsoftwarebot htoenterthesy st
em i
ll
egal
lytoextractdat
aand
toanalyzet hei nf ormationobtai
nedar eavailabl
e.
c. St atethr
eegoal sofdatabasesecuri
ty. 4½mar ks
Answer
Someoft hegoalsofDat abasesecuri
tyar
e:
a.Conf
identi
ali
ty(SecrecyandPr i
vacy–dataareonlyaccessi
blebyaut
hori
zedusers
b.Toensuredataintegri
tywhichmeansdat acanonlybemodi f
iedbyaut
hori
zedusers
c.Avai
l
abili
ty–dat aareaccessibl
etoauthori
zedusers
d. Enumer atethreethreat
sofdatabasesecuri
ty. 4½
marks
Answer
Someoft het hreatsofdatabasesecurit
yare:
a.Improperr eleaseofi nf
ormationcausedbyreadi
ngofdatat
hroughint
entional
or
accidentalaccessbyunaut hori
zedusers
b.Impr opermodi ficati
onofdata
c.Actioncoul dpr eventusersfrom accessi
ngdataforwhi
chtheyar
eaut hori
zed
6a. Out
li
net
hef
ourmai
npar
tsofaDat
abaseManagementSy
stem (
DBMS)
.
10mar
ks
Answer
ADBMScanpr ov
ide:
DataConsist
encyandIntegri
ty-bycontr
oll
ingaccessandmi ni
mizi
ngdatadupl
icat
ion
Appli
cat
ionprogram i
ndependence-bystoringdat
ainauniformfashi
on
DataShari
ng-bycontrol
lingaccesstodataitems,manyuserscanaccessdat
a
concurrentl
y
BackupandRecov ery
SecurityandPri
vacy
Mul t
ipleviewsofdat
a
b. Explai
nwhatismeantbydat
amodel. 3½marks.
c. Listanyf
ourchar
act
eri
sti
csofagooddat
amodel
. 4
mar ks
Answer
Thef
oll
owingar ethechar act eristi
csofagoodDat aModel :
Compl et
eness: Doest hemodel suppor tal
lnecessar ydata?
Nonr edundancy :Doest hemodel specifyadat abaseinwhi chthesamef act
coul dber ecor dedmor et hanonce?
Enf orcementofBusi nessRul es:Howaccur atelydoesthemodel r
eflectand
enfor cet her ulest hatappl yt othebusi nessdat a?
Dat aReusabi l
ity :Wi l
l thedat ast oredinthedat abaseber eusableforthe
pur posesbey ondt hoseant ici
pat edint heprocessmodel ?
Stabi l
ityandFl exibi l
ity:Howwel lwil
l t
hemodel copewithpossi bl
echanges
tot hebusi nessr equi rement s?
Elegance: Doest hedat amodel provideareasonabl eneatandsi mple
classif i
cationoft hedat a?
Communi cation: Howef fect i
veist hemodel i
nsuppor ti
ngcommuni cati
on
amongt hev ar i
ousst akehol dersi nthedesignoft hesystem?
Integr ati
on: Howwi l
lthepr oposeddat abasefitwi t
htheor gani
zati
on’s
existingandf utur edat abase?
MARCH/
APRI
L2016EXAMI
NATI
ON
SCHOOLOFSCI
ENCEANDTECHNOLOGY
COURSECODE: CI
T843 Cour
seUni
t:2
COURSETI
TLE: DATABASEMANAGEMENTSYSTEMS
Ti
meAl
lowed: 2Hour
s
I
nst
ruct
ion: AnswerAnyFourQuest
ions
1a. Expl
ainwhati
smeantbydat
abasemanagementsy
stem (
DBMS)
. 3
marks
Answer
DatabaseManagementSyst
em (DBMS)i
sacoll
ect
ionofsof
twarepr
ogr
amst
hatar
e
usedtodefi
ne,
const
ruct
,maint
ainandmani
pul
atedat
ainadatabase
b. Stat
efi
veadv
ant
agesofadat
abasemanagementsy
stem. 10
mar
ks
Answer
Adv
ant
agesofaDBMS
i
. ADBMScanpr ovide:
i
i
. DataConsistencyandI ntegri
ty-bycontr
oll
ingaccessandmi ni
mizi
ngdata
dupli
cati
on
i
i
i. Appli
cati
onpr ogram independence-bystoringdat
ainauniformfashi
on
i
v. DataSharing-bycont rol
lingaccesstodataitems,manyuserscanaccess
dataconcurrentl
y
v
. BackupandRecov ery
v
i. Securi
tyandPr i
vacy
v
ii
. Multi
plevi
ewsofdat a
c. Whatdoesadat
abasest
ruct
urest
ore? 4½mar
ks
2a. Whatdoy
ouunder
standbynor
mal
i
zat
ion? 2mar
ks
b. Expl
aint
hef
oll
owi
ngt
erms
i
.Funct
ional
dependency 2mar
ks
i
i
.Fi
rst
,Second,
andThi
rdNor
mal
For
ms 6mar
ks
c. Out
li
net
hepr
ocessf
ort
ransf
ormi
nga1NFt
abl
eto2NF. 7½mar
ks
Answer
Thepr ocessfortr
ansforminga1NFt abl
eto2NFi s:
1.I
dent i
fyanydeterminant
sot herthanthecomposi tekey,andthecol umnsthey
determi ne.
2.Cr eateandnameanewt ableforeachdet erminantandt heuniquecol umnsit
determi nes.
3.Mov ethedeterminedcolumnsf rom theoriginaltabl
et othenewt able.The
determi nate
becomest heprimarykeyoft henewt able.
4.Del etethecolumnsy oujustmov edfrom theor i
ginaltabl
eexceptf orthedeter
minat
e
which
wil
l serveasaf orei
gnkey .
5.Theor i
ginalt
ablemayber enamedt omaint ainsemant i
cmeani ng.
3a. Ful
l
yexpl
aint
heEnt
it
y-Rel
ati
onshi
p(ER)model
concept
. 7½mar
ks
Answer
TheEnti
ty-
Relat
ionshi
p(ER)modeli
saconcept ual
datamodelt
hatvi
ewstherealworl
d
asenti
ti
esandrelati
onshi
ps.Abasi
ccomponentoft hemodel
istheEnt
it
y-Rel
ati
onshi
p
di
agram whichi
susedt ovi
sual
lyr
epresentdat
aobjects.
b. Out
li
nenon-
diagr
ammat
ical
l
ythef
ivesy
mbol
susedf
ort
hebasi
cERconst
ruct
s.
10mar
ks
4. Wr
it
eSQLst
atement
sfort
hef
oll
owi
ng:
i
. Toi
nser
tat
upl
eforSmi
thwhohas$1200i
naccountA-
9372att
heSFUbr
anch.
i
i
. Toi
ncr
easeal
laccountbal
ancesby5per
cent
.
i
i
i. Tomaket
wodi
ff
erentr
atesofi
nter
estpay
ment
,dependi
ngonbal
anceamount
i
v. Del
eteal
ll
oanswi
thl
oannumber
sbet
ween1300and1500.
v
. Del
eteal
laccount
satbr
anchesl
ocat
edi
nSur
rey
. 17½mar
ks
Answer-
--
-i
Toinsertatupl
ef orSmi
thwhohas$1200i
naccountA-
9372att
heSFUbr
anch.
i
nsertintoaccount
val
ues( “
SFU”,“A-9372”,1200)
Toprov i
deeachl oanthatthecust
omerhasi
ntheSFUbr
anchwi
tha$200
savi
ngsaccount .
i
nsertintoaccount
ectbname,
sel loan#,200
fom l
r oan
wherebname=” SFU”
Answer-
--
-ii
Toincreaseallaccountbal
ancesby5per
cent
.
updateaccount
setbalance=balance*1.05
Answer -
--
-i
ii
Tomaket wodif
ferentr
atesofi
nter
estpay
ment
,dependi
ngonbal
anceamount
:
updateaccount
setbalance=bal
ance*1.06
wherebalance>10, 000
updateaccount
setbalance=bal
ance*1.05
wherebalance10,000
Answer-
--
-iv
Del
eteall
ofSmith’
saccountr
ecords.
del
etefom deposi
r tor
wherecname=”Smit
h”
Del
eteall
loanswit
hloannumbersbetween1300and1500.
del
etefom l
r oan
el
wher oan#bet
ween1300and1500
Answer-
--
-v
Deleteallaccountsatbr
anchesl
ocat
edi
nSur
rey
.
deletefrom account
wher ebnamei n
(selectbname
from branch
ebci
wher ty=”
Sur
rey
”)
5. Letusassumethatthef
oll
owingstaf
ftabl
e(STAFF)hast
hef
oll
owi
ngr
ecor
ds,
uset
he
appropr
iat
esel
ecti
onoperat
or(s)t
o:
Chi
di 201 ECO Lect
urerI
Bel
l
o 301 CI
T Seni
orLect
urer
Aj
ayi 220 ACC Seni
orLect
urer
a. Sel
ectonl
ythoseSt
affi
ntheCI
Tdepar
tment
. 3½
marks
b. Sel
ectonl
ythoseSt
affwi
thl
astnameAj
ayi
whoar
epr
ofessor
s. 4
marks
c. Sel
ectonl
ythoseSt
affwhoar
eei
therPr
ofessor
sori
ntheEconomi
cs
depar
tment.
5mar
ks
d. Sel
ectonl
ythoseEmpl
oyeeswhoar
enoti
ntheCI
Tdepar
tmentorLect
urerI
.
5marks
Answer
6. St
atef
ivepr
oper
ti
esoft
hecl
i
ent
-ser
verdat
abasesy
stem ar
chi
tect
ure. 17½mar
ks
Answer