0% found this document useful (0 votes)
24 views13 pages

Database Systems MQs

Uploaded by

Gataha James
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views13 pages

Database Systems MQs

Uploaded by

Gataha James
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

MASI

NDEMULIROUNIVERSI
TYOFSCI
ENCEANDTECHNOLOGY
UNIVERSI
TYEXAMINATI
ON2014/
2015

MARKI
NGSCHEME

Ins
truc
tions
:
Sect
ionA:(Q1&Q2Compul
soryc
ont
aini
ng30Ma r
ks)
Sect
ionB:(Q2-
Q5Att
emptany3que
sti
onscont
aini
ng20ma
rkse
ach)

MARKI
NGSCHEME

KAKAMEGA2015
SECTI
ONA
Question One
a)Define the following terms: [4 Marks]
i.A candidate key i sa na ttribute( orsetofa t
tribute s)t hatuniquelyi denti
f i
esar ow.A
candi datekeymus tpossesst hef ollowingpr operti
es:
oUn iquei dentif
ica
tion-Fore veryr owt heva lueoftheke ymus tuniquelyi
de nti
fytha trow.
oNo nre dundancy-Noa tt
ribut ei nt heke yc a
nbedi sc arde dwi t
houtde st
royingt hepr opertyof
uniquei dent
ifi
cati
on
ii. A superkey i sa nys etofa tt
ribut e
st hatunique l
yi de nt
ifiesar ow.As uperkeydi ff
ersfrom a
candi datekeyi nthatitdoe snotr e
qui rethenonr edunda nc ypr ope r
ty.
b)Expla int hedif
f e
renc e
sbe twe ent henot i
onsofDa t
aba s
e( DB) ,Da tabaseMa na ge
me ntSys tem
(DBMS)a n dDatabaseSys tem( DBS) . [3Ma rks
]
Ada t
a ba seisanyor ganiz
e dc ollecti
onofda ta
,forapa rt
ic ularpur pos e.
Ada t
a ba semana geme ntsystemi ss of twa r
ethatall
owsus e rstos tore,modify,ore xt
ractinformation
fr
omada tabas
e
Ada t
a ba sesyste
mi sat ermt ha tistypi call
yus edtoe ncaps ulatethec onstr
uctsofada tamode l
,
dat
aba seMa nageme ntsystem( DBMS)a ndda t
abase

c
)Li statleas
tfo urr
espons
ibil
it
ie
sofada tabas
ema nage
me nts
yst
em.Fore
achre
sponsi
bil
it
y,expl
ai
n
theproble
mst hatwouldari
seifther
esponsibi
li
tywerenotdis
cha
rge
d,Ift
hes
erespons
ibi
li
ti
eswere
notme tbyagi venDBM,t hefol
lowi
ngpr oble
msc anOccur?[8Marks
]
i
. Interacti
onwi t hthefil
emanager
.
ii
. Integri
tyenf or cement
i
ii
. Securit
yenf orc ement
i
v. Backupandr ec overy
v. Concurrencyc ont r
ol.

Thef ollowingp roblemsc anoc cur ,res pec ti


vely:
a.NoDBMc and owi thoutt his,ift her eisnof i
lemanageri nter actionthennot hi
ngs toredinthef il
esc anbe
retrieved .
b.Cons istencyc ons traintsmaynotb es at i
sfied ,ac c
ountb alanc esc oul
dgob elowt heminimumal lowed ,empl
oyees
couldear ntoomuc hov er t
ime( e. g.,hour s>80)or ,air l
inep i
lotsmayf l
ymor ehour sthanallowedb yl aw.
c.Unaut hori
zedus ersmayac ces sthed atabas e,orus ersaut horizedt oacces spar tofthed atabasemayb eabl
e
toac ces spartsoft hed atab asef orwhi cht heyl ackaut hor i
ty .Forexamp le,ahi ghs choolstudentc ouldget
acces st onationald efens es ecr etc odes ,oremp loyeesc ouldf i
ndoutwhatt heirs upervi
sorsear n.
d.Dat ac ouldbel ostp ermanent ly,r athert hanatl eastb ei
ngav ail
ab l
einac ons is
t entstatethatexi s t
edpri
ort o
af ai
lur e.
e.Cons istencyc ons traintsmayb ev iolatedd esp iteprop erintegr i
tyenf or
c ementi neachtrans action.For
examp le,incorrec tb ankb alanc esmi ghtb eref lectedd uet osimul taneouswi thd r
awal sanddepos its
,ands oon.

d)Exp
lai
nthed if
ferencebetweenaweakandas t
rongent ityset.[4Mar
ks]
Answer:As tr
ongentitysethasap ri
marykey.Al
lt uplesint hesetared
isti
nguishabl
ebythatkey.Aweakent i
ty
sethasnop ri
marykeyunlessattri
butesofthestrongent i
tys etonwhi
chitdependsareinc
luded.Tup
lesi
na
weakentitysetarepartiti
onedaccord
ingtothei
rr elationshipwitht
upl
esinas trongent
ityset.Tupl
eswithi
n
eachpart
itionaredist
inguis
habl
ebyad i
scr
imi
nator ,whichisas etofatt
ribut
es.

e)Wec anc onvertanyweakenti


tyse tt
oas t
ronge n
tit
ys e
tbysimpl
yaddi
ngappropri
at
eat
tr
ibut
es.
Why,then,doweha veweakenti
tys et
s?[4Ma rks]
Ans
wer:Weha vewe akenti
ti
esf
orse veralr
easons:
•Wewa nttoavoidthedatadupl
icat
iona ndconsequentposs
ibl
einc
onsi
st
enc
iesca
us e
dbydupli
cat
ing
t
hekeyofthes t
ronge nt
it
y.
•We
ake
nti
ti
esr
efl
ectt
helogic
a lst
ruct
ureofanent
it
ybei
ngde pendentonanot
here
nti
ty.
•We
ake
nti
ti
esc
anbede l
et
e dautomati
cal
lywhenthei
rst
rongent
i t
yisdele
ted.
•We
ake
nti
ti
esc
anbestoredphysical
lywit
hthei
rstr
ongenti
ti
es.

Question Two
AMMUSTr egistr
ar’sofficemaintainsdataab outthefoll
owingent i
ties
:( a)courses,includi
ngnumb er,ti
tle,
credi
t s
,s yll
abus,andp r
er equi
s i
tes;(b)courseofferi
ngs,incl
udingcours enumber,y ear,semester
,s ect
ion
numb er,instructor(s
),timings,andc l
assroom;(c)students,i
ncludi
ngs tudent-i
d,name,andp rogram;and( d)
i
ns t
ruc tors,incl
udingidentifi
cationnumb er,name,department,andt i
tle.Further,t heenroll
mentofs tudentsi
n
coursesandgr adesawar dedtos tudentsineachcourset heyareenroll
edf ormustb eap propri
atel
ymod eled.

Constr
uctanE-Rdi
agramfort
heregi
str
ar’sof
fic
e.[
12Mark
s]
Documental
lass
umpti
onst
hatyoumakeaboutthemapp
ingcons
trai
nts
.[3Mar
ks]

Answer
:
Themainent
itys
etsares
tudent
,cour
se,c
our
se-of
fer
ing,andi
nst
ruc
tor
.Theent
it etc
ys our
se-of
fer
ingi
sa
weakenti
tysetdep entonc
end ours
e.

Theassumptionsmadeare:
a.aclassmeetsonlyatonepart
icularp
lac
eandt i
me.ThisE-Rd
iagramcannotmodelaclas
smeet i
ngatdi
ffer
ent
pl
acesatd i
fferentti
mes.
b.Thereisnoguaranteethatt
hed atab
asedoesnothavetwocl
assesmeetingatt
hes amep l
aceandti
me.

a
)Inyourownwor
dexpl
ai
nhowda
tai
nte
gri
tyi
sma
int
ai
nedwi
thi
ntheda
taba
sewhe
nconc
urr
entus
ersa
cce
ss
t
heda
tabas
e [5Ma rks]
- Whe naus e
ra t
temptstoupdatearow,alockisappl
iedtotherow
- Tr ansa
ction/lockinginfor
mati
onisplacedi
ntheblockhe a
der
- Whe nanotherus erat
temptst
oupda t
ethesamerow,theblockheade ri
scheckedforacommit
tedf
lag
- Theus e
rwi llha vetowa i
tintheroll
backsegmentheader,unt
ilthetransa
cti
onf r
om thef
ir
stus
eris
complet
e
- Whe nthef irstu se
rc omple
testhetransa
cti
on,thene xtuserwi lllocktherow andhavehis/
her
tr
ansact
ione f
fected

Question Three
Cons
idert
hei
nsur
anc
edat
abas
e,wher
ethep
rimar
ykey
sar
eund
erl
ined
.
Cons
truc
tthef
oll
owi
ngSQLquer
iesf
ort
hisr
elat
ionald
atab
ase.

pers
on( dri
ver-id,name,addr
es s)
car(l
icense,model,year)
acci
dent(report-numb er
,date,locati
on)
owns(driv
er -i
d,lic
ense)
part
ici
pated( dr
iver-id
,car,report-number
,damage-amount
)

a) Findthet otalnumb erofp eopl


ewhoownedc arsthatwer einvol
vedinacc
ident
sin2014.[4Mar
ks]
selec
tc ount( di
st i
nctname)
fromac ci
d ent,partici
pat ed,person
whereac cident.report-numb er=par ti
cipated .
report-numb er
andp ar
t i
cipated.driv
er -id=person.dri
v er-id
andd atebet weend ate’2014-00-00’ andd ate’2014-12-31’
b) Findthenumb erofac cidentsinwhicht hec arsbelongingt o“IvyIsaac
”wer ei
nvol
ved.[
4Marks]
selec
t c ount( dis
tinc t* )
fr
om acc i
dent
where exists
(select*
f
r omp arti
cipat ed,person
wher eparticipated.dri
ver-id=person.
dri
ver-i
d
andper son.name=’ IvyIsaac’
andacc i
dent .
report-number=parti
ci
pated.
repor
t-numb
er)

c) Addanewac c
identtot hedatabas
e;ass
umeanyv
aluesf
orr
equi
redat
tri
but
es.[
4Mar
ks]
i
nserti
ntoacci
dent
val
ues(4007,’
2001-09-01’,’
Berkel
ey’
)

ins
ertintopart ic
ipated
sel to.
ec driver-i
d,c.l
ic
ense,4007,3000
f
r ompers onp,ownso,c arc
wherep .name=’ Jones’andp.dr
iver-i
d=o.
dri
ver
-idand
o.l
ic
ense=c .l
ic
ens eandc.model=’T
oyota’

d) Del etet heMazd abelongi


ngto“IvyIsaac”.[
4Marks]
d el
et ecar
wher emod el=’Mazd a’andl i
censein
(sel
ec tl
ic ense
fromp ers onp,ownso
wher ep.name=’ I
vyI saac’andp.dri
ver
-id=o.dr
iver-i
d)
e) Up datet hed amageamountf orthecarwithli
cens
enumb
er“
KJE539”i
ntheac
cid
entwi
thr
epor
tnumb
er
“ AR2197”t oKSh.300, 000.[4Marks
]
upd atep ar ti
cipated
setd amage-amount=300, 000
wher erepor t
-numb er=“ AR2197”anddri
ver-i
din
(sel
ec tdriv er-id
fromowns
wher el i
cens e=“ KJE539”)

Question Four
a
)Consi
dert
hef
oll
owi
ngt
abl
eins
tanc
echa
rt
Cre
atetheEMPLOYEEtablebas
edontheta
blei
nst
anc
echa
rts
howna
bove
.Choos
etheappr
opri
at
eda
ta
t
ypesandbes
uret
oaddi
ntegri
tyc
ons
tra
int
s [6Marks
]

CREATETABLEempl
oyee
(emp_id NUMBER(10)
CHECK( e
mp_idb e
twee
n0to999999)
,
Emp_na me VARCHAR( 30)NOTNULL,
Addr es
s VARCHAR( 50),
Join_dat
e DATEDEFAULTSYSTDATE,
CONSTRAI NT empl
oyeeemp_idpkPRIMARYKEY( e
mp_i
d))
;
b)Youar
eas
kedt
ode
signada
taba
ses
yst
emf
orahe
alt
hcl
ub.Theda
taba
sewoul
dcont
ai
nda
taa
bout
cus
tome r
s ,theirtraini
ng,c ontac
tnumb e
rs,et
c. Show t
hema i
nste
psyouwoul
dpe r
for
mfor
des
igninga ndimpl ementingthedata
bas
e.(Don’
tshowthea
ctua
lsc
hemas!
)
[
6Marks
]
Databases t
udy
Databasede s
ign
Impleme nti
nga ndloa di
ng
Test
inga nde valua
tion
Operations
Ma i
ntena n
cea ndevol ut
ion

c
)Inyourownwor
dexpl
ai
nhowda
tai
nte
gri
tyi
sma
int
ai
nedwi
thi
ntheda
taba
sewhe
nconc
urr
entus
ersa
cce
ss
t
heda
tabas
e [5Ma rks]
- Whe naus e
ra t
temptstoupdatearow,alockisappl
iedtotherow
- Tr ansa
ction/lockinginfor
mati
onisplacedi
ntheblockhe a
der
- Whe nanotherus erat
temptst
oupda t
ethesamerow,theblockheade ri
scheckedforacommit
tedf
lag
- Theus e
rwi llha vetowa i
tintheroll
backsegmentheader,unt
ilthetransa
cti
onf r
om thef
ir
stus
eris
complet
e
- Whe nthef irstu se
rc omple
testhetransa
cti
on,thene xtuserwi lllocktherow andhavehis/
her
tr
ansact
ione f
fected

Question Five
a)What is the meaning of the term ‘functional dependency’?
Ifiti
sinvali
dtohavetwoide nti
calvaluesofXwithdif
f e
rentva l
uesofYthenYi sfuncti
onal
ly
dependentonX
Why is it important to establish functional dependencies during
normalization?
Norma li
sat
ionisapr
ocessofs
e pa r
a t
ingFDs :2NFremovesfunc t
ionalde
pendenci
esfrompa r
tofa
compoundke ytoanon-keyat
tribute( pa
rti
aldepe
ndenci
es).3NFr emovesfuncti
onaldependenc
ies
bet
we ennonke yat
tr
ibut
es(t
rans it
ivedependenci
es)
.BCNFe nforces3NFforallca
ndidat
eke ys
(
remove
shi
dde
npa
rti
alde
pende
nci
es)
.

i. Give TWO reasons why the WORKRECORD table is not in third normal
form. []
Tobei n3NFthedatamustal
sobein1NFa nd2NFbuti
tisnoti
n1NFbec
auset
herearer
epeat
ing
groupsofda
taegthefi
rstr
owc ont
ainstwova
lue
sforGr
adeNo.Ther
ear
eals
otra
nsit
ivedepe
ndenci
es,
egbe t
weenGradeNo.andGradeTit
l e
.

ii. Fully identify one occurrence of redundant data.


Thei
nfor
mat
iont
hatGr
adeNo.GR1hasGradeTi
tl
eGri
nderi
sprovi
dedt
wic
eands
houl
donl
ybe
pr
ovi
dedonc
e.

iii. Write down the functional dependencies implied by the table.

empno 
empna me,Pr
oje
ct_no,De
pt_No
pr
ojectno 
Proje
ctname
Deptno 
De ptLoc
Gradeno 
Gr adeTit
le
Emp.No,Gra
denoStar
tdate

iv. Normalize the table as far as third normal form showing the
intermediate stages and the primary keys. Write down any
assumptions you make.
INF
T1(e
mpno,empna me,proj
ectno,pr
oje
ctna
me,de
ptno,de
ptl
oc)
T2(e
mpno,gradeno,gr
adetit
le,s
tar
tdat
e)

2NF
T1asis
T2.
1(empno,gr a
deno,st
artda
te)WORK
T2.
2(gradeno,gra
deti
tl
e)GRADE

3NF
T1.
1(empno,e mpna me,proj
ectno,de
ptno)EMP
T1.
2(proj
ectno,proj
ectname)PROJ ECT
T1.
3(deptno,deptname)DEPT
T2.
1asis
T2.
2asis

v. Construct an entity relationship diagram to show the relationships


between the structures you have identified. Write down any
assumptions you make.
Onl
yst
oreDe
pt,Pr
oje
ct&Gr
ade
sda
tat
hata
reus
edbye
mpl
oye
esa
ndwor
kre
cor
ds.

Mult
i-val
uedDependenc
y-apar
ti
cul
arva
lueofthede
ter
minanti
sas
soci
ate
dwit
hasetofde
pende
nt
va
lue
s
Arecordshoul
dnotcont
aint
woormorei
ndepe
ndentmult
i-
value
dfa
ctsa
bouta
nent
it
y.

f)Define the following terms:


i
ii
.A candidate key i
sana
ttr
ibut
e(ors
etofa
ttr
ibut
es)t
hatuni
que
lyi
dent
if
iesar
ow.A
candidateke ymus tpossesst hef ollowi ngpr operti
es:
oUn iquei denti
fi
cati
on-Fore veryr owt heva lueoftheke ymus tuniquelyidentif
yt hatrow.
oNo nredunda ncy-Noa ttr
ibut ei nt heke yc a nbedi s
c ar
dedwi t
houtde st
royingt hepr ope rtyof
uniquei dentif
icat
ion
iv. A superkey i sa nys etofa tt
ribut e
st hatuni quelyi denti
fi
e sar ow.As upe rkeydi ffer
sf rom a
candidateke yinthatitdoe snotr e
qui rethenonr edundanc yprope r
ty.
v. Data mining t hepr oc e s
sofe xtr
a cti
ng va lid,pr evi
us l
y unknown,c ompre hensiblea nd
acti
ona bleinformati
onf roml argeda tabasesa ndusingitt oma kecruc i
albusinessdec i
sions.
vi. Da t
awa re
housingisar epos i
tory( ora rchive)ofi nformati
onga ther
edf rom mul t
iples ources
,
st
or edunde raunifi
eds che maa tas i
ngles ite.Onc ega there
d,t heda t
aa r
es toredforal ongt i
me,
permi t
tinga cce
sstohistorica ldata.
vii.

g)Explain what it means;


i. Fantr
ap;thisiswhe namode lre
present
sar el
ati
onshipbetwe ene nti
tyt
ype s,butthepathwa ybe t
we en
cer
tai
ne nt
ityoccurrencesisambiguous.Itoccur
swhe n1:mr el
ationshi
psf a
noutf r
omas inglee nti
ty.
i
i.ChasmTr apthisiswhe namode lsuggest
st heexis
tenceofar elati
onshipbetwe enenti
tytype s,butthe
pat
hwa ydoesnote xi
s tbet
we encer
tainenti
tyoccurrences.Itoccurswhe r
ethe r
ei sarel
a t
ionshipwi th
par
ti
alpa r
ti
cipati
on,whi chformspartofthepa t
hwaybe twe enentiti
est
ha tarerel
a t
ed.
ii
i.Funct
ionaldependencies this is when ana t
tribut
eisf unct
ional
l ydependentifitsvalueis
det
erminedbya nothera t
tr
ibute
.

h)Differentiate between data analysis and functional analysis.


DataAnalys
is=est
abl
is
hingthenat
ureofdat
a.
Funct
iona
lAnalys
is=est
abli
shingt
heuseofdat
a

SECTI
ONB
Que
sti
onTwo
Adat
abasecontai
nst hefoll
owingt abl
e s
:
game_record(gi
d,player
_i d,posi
tion,number
_of_goals
)
pla
yer(player_i
d,player_name ,te
a m_id)
te
am( t
eam_i d,te
a m_name )
game(gid,home _team,a way_team,ga me_da
te,goal
s_home
,goa
ls_a
way)

Thete a
mt abl
econtainsde t
ail
soff ootba l
lte
a ms ,t
hepla
yerta
blecont
ai
nsdeta
il
sofplayer
sinthet
eamsa nd
thegamet abl
econ t
ai
nss umma ryde ta
i lsofthega meswhicht
heteamspla
y.Thegame_recor
dtabl
ec ont
ains
rowswhi chdesc
ribethepe rf
orma nceofi ndividualpl
ayer
sineachgame.Ass
umethatt
a bl
escanbejoine
don
ident
ical
lynameda tt
ribut
e sandthatthea tt
ributes
home _t
eam,a way_te
a ma ndteam_i dc ontai
nva luesf
romthesamedoma i
n.

i
.Wr
it
einSQLque ri
eswhi c
hwi l
l:
a)Lis
tthete amsina s
cendi
ngorderoft
eamna
met
oge
the
rwi
thac
ountoft
henumbe
rofhome
gamespla yedbythattea
m;
Selectteam_name,count
(*)
fr
omt eam,game
whe r
et eam_id=home _t
eam
groupbyt eam_name
or
derbyt
eam_na
me

b)Li
stt
henameo fthehometeami nvol
vedinthemostr
ece
ntga
me.(
Ass
umet
hate
achg
amer
owi
n
t
hegametablehasadif
fer
entvalueforgame_da
te)
;
Sele
ctteam_name
Fromteam,ga me
Whe r
eteam_id=home _tea
m
Andga me_date=(s
electmax(game_dat
e)
Fromga me)

c
)Listt
henameo feacht
eamtoget
herwit
htheda
teoft
hemos
tre
centhomega
mepl
aye
dbyt
hat
t
eam;
Sele
ctteam_name
Fromteam,game
Whe r
eteam_id=home_tea
m
Andga me_dat
e=(sel
ectmax(ga
me_dat
e)
Fromga me
Whe r
eteam_id=home_tea
m)

d)Li
stt
hename sandpos itionsofSof apakaplayer
singame
swona
wayf
romhome
.
Sele
ctplaye
r_na me ,pos i
ti
on
Fromteam,ga me ,ga me_record,player
Whe r
eplayer.
playe r_id=ga me _re
c or
d.pla
yer_i
d
Andga me_record.Gi d=ga me.gid
Anda way_t
e a
m=t ea m_id
Andteam_na me=‘ Sof apaka’
Andgoa l
s_awa y>goa l
s_home

Que
stionThr ee
a)De scribet hea dva ntagesa nddi sadvant agesoftheus eofada tabas
ema na
gementsyst
ema soppose
dtoa
tra
ditiona lfilema intenanc esystem.( 5ma rks)
Di scus sionofi ssuess ucha s:

I nfle xibil
ity

Exc essivepr ogr amma i
ntenance

Re dunda nc y

I nc ompa tibleda ta

Cos t

Compl exity

Hi ghc ostoff a il
ure
b)De scribet heANSI /SPARCt hreeleve la r
chitec
turefordat
a basema na
ge mentsys
temssof
twa r
eand
expla int hea dv anta gesitpr ovi
de s.(9ma rks)
Interna ls chema :phys icalda t
aor ganisa t
ion,physica
lforma ts
,indexes,poi
nter
s,bl
ocksiz
e ,da
tast
ora
ge.
Conc e ptua ls chema :Logi calcontent,c onstrai
ntspecif
ica
tion
Ext e
r na ls chema:Loc a
lvi ewofda ta,subs etofconcept
uals chema

Loc
alVi
ew Empl
oye
e.Name Empl
oye
e.Name
Empl
oye
e.Addr
ess Empl
oye
e.Soc_Sec
_No
Empl
oye
e.Addres
s
Empl
oye
e.Annual
_Sal
Us
er
Us
er

Conc
ept
ualVi
ew
Empl
oye
e.Name :
Stri
ng
Empl
oye
e.Soc_Sec_No:I
ntege
r DBA
Empl
oye
e.Address:
Str
ing
Empl
oye
e.Annual_Sal
:Double

Conne
cti
ont
otheDBA

I
nte
rna
lVi
ew
Name :
Stri
ngLengt
h25Of f
set0
Soc_Sec_No:
Int
eger9Offs
et25
Address
:Stri
ngLength5Offs
et34
Sal
ary:9,2decOff
set39

Ama ppingi srequir


edbe t
weent hediffer
entlayer
sinthear
chi
tect
ure.
Advantagesa nddisadva nt
agesincluding:
Dataindepende nce
:s upporte
dbyi nternal/
concept
ualmappi
nga ndconcept
ual/
ext
ernalma
pping
Datashareabili
ty:mul t
ipleext
ernals c
he matapossi
blewhi
chprovidecontr
oll
edacces
stopar
tsoft
he
conce
ptuals chema.Se curit
ysuppor t
edbypr ovisi
onofext
erna
ls c
hema

c)How are database structures at each of the three levels specified in


most database management systems?( 6ma r
ks)
Int
erna lschema:STORAGEc l
aus
e,CREATEINDEX
Conce ptualsche
ma :CREATETABLEst
ate
ment
s,i
ntegr
it
yc ons
tra
int
set
c
Externa lSchema:CREATEVIEW

Question Four
b)What is the meaning of the term ‘functional dependency’?
Ifiti
sinvali
dtohavetwoidentic
alval
uesofXwi thdi
ffe
rentval
uesofYt henYi sfunct
ional
ly
dependentonX
Why is it important to establish functional dependencies during
normalization?
Norma li
sat
ionisaproce
ssofseparat
ingFDs:2NFr emove
sfuncti
onaldependenci
e sf
rompartofacompound
keytoanon- keyat
tr
ibut
e(par
tialdepende
ncie
s).3NFremovesfunct
ionaldependenci
esbet
we ennonkey
at
tri
butes(t
ransi
ti
vedepende
ncies).BCNFe nf
orces3NFforallca
ndidat
eke ys(re
move shi
ddenpart
ial
dependenci
e s
).

vi. Give TWO reasons why the WORKRECORD table is not in third normal form.
[]
Tobei n3NFthedatamusta l
sobei
n1NFa nd2NFbutiti
snotin1NFbecaus
ether
ear
ere
peat
inggroupsof
da
tae gthef
ir
strowc ont
ainst
wovalue
sforGradeNo.The
reareal
sot
rans
it
ivedepe
nde
nci
es,e
gbetwe e
n
GradeNo.andGr a
deTi t
le.

vii. Fully identify one occurrence of redundant data.


Theinf
orma
tiont
hatGr
adeNo.GR1ha
sGradeTi
tl
eGri
nderi
sprovi
dedt
wic
eands
houl
donl
ybepr
ovi
ded
onc
e.
viii. Write down the functional dependencies implied by the table.

empno 
empna me,Pr
oje
ct_no,De
pt_No
pr
ojectno 
Proj
ectname
Deptno 
De ptLoc
Gradeno 
CodeTi tl
e
Emp.No,Gra
denoStar
tdate

ix. Normalise the table as far as third normal form showing the
intermediate stages and the primary keys. Write down any assumptions
you make.
INF
T1(e
mpno,empna me,proj
ectno,pr
oje
ctna
me,de
ptno,de
ptl
oc)
T2(e
mpno,gradeno,gr
adetit
le,s
tar
tdat
e)

2NF
T1asis
T2.
1(empno,gradeno,st
a r
tda
te)WORK
T2.
2(grade
_no,gra
detit
le)GRADE

3NF
T1.
1(empno,e mpna me,proj
ectno,de
ptno)EMP
T1.
2(proj
ectno,proj
ectname)PROJ ECT
T1.
3(deptno,deptname)DEPT
T2.
1asis
T2.
2asis

x. Construct an entity relationship diagram to show the relationships


between the structures you have identified. Write down any
assumptions you make.

Onl
yst
oreDe
pt,Pr
oje
ct&Gr
ade
sda
tat
hata
reus
edbye
mpl
oye
esa
ndwor
kre
cor
ds.

Mul
ti
-val
uedDependenc
y-apar
ti
cul
arva
lueofthede
ter
minanti
sas
soci
ate
dwit
hasetofde
pende
ntva
lue
s
Are
cordshoul
dnotcont
aint
woormorei
ndepe
ndentmult
i-
value
dfa
ctsa
bouta
nent
it
y.
Question Five

You might also like