0 ratings0% found this document useful (0 votes) 16 views9 pagesSubject Test-1 DBMS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
toring ri Snes B66 an 8,0) inet ancat dependences 8-6, ¢-> ABE,
ie Aalst eyo ames hel he awigssemetitrae!
so Rae tad Rens
cous eth toe RFDSare [AB G--AEBEABE-"F)
tether 34D 2nd ig Now ey oye lst Fb threaten par dependences, young eco bt Rot pr)
egegcton en GEaF meant nae
oot more pra
teem ancsua eats
‘su 4p) 0 224, We, AL), A AE WS)
oo; ore nten
heehee
“rvs TS peti rl wi ones ai ied nl Rds caneby Ton Thar 2 Read operon, REO) Not ute aprons
I Tysplcedbeo T, tare no WER deendency, nF aependeny Sone ge ako antes T, pace eT,
Spal nlesaeasttintore
12_14_15_ 13 cane pace ampere out 5 ase) = Sot
TETRIS MTeante sacedanyuere out 5 pass = SC
Tetle l esigs = 5 5= 10
e
o;:
Cone in ng ey a, 2, nd ae
a)
So
=‘hepa tty wh the many
ommanmagstmintontip=nasiumnostdtcenteepecea erin cnty athe any. Tl, nm pebeensin “ot ome
‘Consider aration RIA, withthe FD's{AB6-r BE and D> AB} Then find the number of superrys of Rist " “
Ca cama
A superkey isa combination of columas that uniquely identifies any re
‘Within @eatona database management system (RDBMS) tbl.
“ere, Candidate keys are (DC, ABC). Therefore
No.of super keys = 2S-2) #245-3) -2"S-4)
Sr42=10
‘oa nn ge ein nmap eth tt
© erent
OO on retort
eo:
© 5 Fran(lexs)— 2)
1 we conver the below E ~ R model ino relational mode, the maximum
umber of tuples possible i elation Teaches is
wet
Professor Couse |
ener crs
‘Here, | professor can teach I course and 1 couse can be taught by mile
teachers
So, couverted relational mode wll contain to tables
1. Professor (Pi, Pname,.. (ther atibutes), Cid) // Assuming column
ane for example, Pid isthe Primary Key and Cid isthe Foreign Key
2. Conrse (Cid, Cuame,.. (other atibues) )/ Cid isthe Primary Key
Now as Cid isa foreign Key in Professors table, rules of Cid in couse table
will boa subset of tuples oF ed in professors able.
Hence maximum aumber of tuples sequal othe tuples in Profesor able.
ev etitnse
@_—_weeeertnesineresrsmumbertupesin couseWatson ae wia eAR > €,€°4) eescampensit BEM: Men chan erate
© "i vestitrsc wasn, pnt pening depen
© reverse tpn een
© tertvete rb ith tiptoe:
For given FD's {AB->C, CA} , CK= {AB, BC}
INF , 2NF and 3NF is satisfied and. C-> A is violating BCNF rule so
‘decompose the relation
Here, we can decompose the relation into 4-different types.
(Casel: RI(AB) R2 (BC) itis not LLJ, DP but satisfies BCNF condition.
‘Case2; RAB) R2 (AC) itis not LLJ, DP but satisfies BCNF condition.
‘Case3: RAC) R2 (BC) itis LLI and satisfying BCNF conditions but itis
not DP.
‘Cased: RI(ABC) R2(AC) it is LL nad DP but it is not satisfying BCNF
conditions.
ome the table an ure geno
“henaichotefooningsttene we core?
W glondgzstep prin bee reat
1 gland zene iret
o-
———
Seventeen
as
Comet opon
lute and teste aga ili aed stats and enh nd wee© [eat verre #2)
iia
© [Yee [Ye em. scees 2)
© [Pee [Perm oes 2) om]
alert a mg
aaa
(Bhar tet ano
Fevanabes es any many edt an at wat earth apg cesar 8,
om cabernet
Conse 2a th einige.
encom, tpn Rad Deh hefooning ona eden
{eamane-> carte
i> aane er
me, a> Rd)
ithecnatasesredsigne uit ong eas
(cane care
(rg cnmnexo
15 (eames 0)
‘hen wats eset emaon Dat ene staat
(Coons aye) wth D5 extant]
"2p cantons car nF pd carte Co)
13 Coons pl ot wth (creme, ne =p oo] an phen)
‘enn mocurhecnes ries Tops prey bee nada ep Daten tren ar orireive
epson hee tie
ode arta) gest pny ey elt ae omen a >
totes tn ot ening er oma
o- concn
‘nto cre le, er, eae may WM he en A aac te
porto easyer
{ho herstaon se oc wea stat en hat cant ay har ated th Pinay ay arena ne
epntecy are eset oer at
‘Thou oe sowed to aces fro a ofa rer They hae ting igo sane datas oly ing gh for
{ome endo ros ata Vth te caret earn DEMS wih seta he vensent
(Ose ‘ome opionSohne: Ot Searty
Dn seer propery in DBMS ge the poverto provide lifer ee fcc const erent pepe
© weston
eects
om saan nna
Reston RABCo}nth O5[A2B 5,620 DoAtheoen eecmgend esvoretans RL ndsz cht sige
‘oat tnomalem nd SOF adonsnenton samy Theshene rer tanto decmoertnens eRe thet of ates
© zee
© xnR-u
© nore
@ BnR=9 “erent
-ifar maleneccooomnosenn arlene rts Nib bythe camped ts anni stheconen sre
Irottea inate ie aemozod ste Non eno ean RlshaNt js Bross mmestrbaee ena
‘nee Hees aneconpontionaes eM
Foreconpostontbely RIE"?
“ore tn |
Joweranseloreny fit dtinaictngin more oneaatonss'sterand isting nny one anitiswitenineeresn theca
been tomy
Owen
OQ men
OH m0
am, et 1
amen rer YO14 7) acl ryan re ae 15rd esc
‘emcee Wo wea tutte Yrs be aid rere area le Sie
‘mn ttn may aatan thar equa recess rat be he ate a
we
Re
e000oo.
Initially the value of x is 1.
Perform operation x = x ~ | and value of x is 2. This value is read by
‘tansaction TJ, which is read by T2 and so on,
If transaction TO fails, rollback the transactions T1,T2,T3,T4....Tu-ly
because the transaction TI reads uncommitted value x from TO, so to get,
correct result, T1,T2,T3,T4...Th-1 have to be rolled back and to get the
original value of x= 1, transaction TO is also rolled back.
so finally all'n' transactions are rolled back.
Comet poe
an
Consider the following schema and relational algebra query.
‘Student (Sid, Sname, Sage)
Course (Cid, CourseName, Credit)
Enrolled (Sid, Cid)
Hag( Student) ~ Rag(Oagancs (COUSE) M Enrolled)
‘Which of the following is correct about relational algebra Q”
© west saco nie cntintoton cnet tens
sabes Manto
esterase cotesnateton oss wih eer nor aos
"Ssloredt Estas)
What the above SQL query prints?
select count(*)
Consider the following able:
cid [marks
1 [io
2 [0
3 [so
1 [so
5 [so
Comet opon‘The SQL query is selecting the exam mark which is exactly inthe middle,
i.e, median of the marks,
ow, sph gbes wnt
osetia
Emenee on, 04. Bet
sins oer Semctds tos:
SLLEToept ROM Emp WHERE SMa’ GROUP BY De RANG NG [Sa > (SELECT ESN FROME,
Thecututuitbe
© wees th argent opis antag the ration
Oars avnge ye aoe anesthe nes etheepatn
© reser trae sn sma ene emai anette oon
© reser stale cml mer tan te eget etn “erent
Fotonrosatectig tent thm 208
Sconsqonrosetig oestrone
Intention tint ANB.
foecancrmie te aie by eng honoring AN.
ew ee)
‘Consider a table R (A.B,C,D.E) with functional dependencies as :
AGB
BoC
D-E
‘Table is decomposed as D={ RI (A,B) ,R2 (B,C) ,R3 (DE) }.
‘Thea decomposition is© rn sg ante
errr pertain, Comet opon
Admonpetensoast
(nn str ocompesetaer sapere longa
(tletacot attest nan sold be hey nat ketone,
wecanertycetio Alt) Fa) ALT) = 9
en
© _ etter tts ress
ttc pig
“aoc ey thy contented outs srcal caeera tht Dt theo te ety th ly Sa elngag tome
bees cho terpenes he roslyn the aearRol seater lure amber oleyrerAbsouthe miata!
lye Sethe ag tase mre ta the imam ube hye renee eds Tetal Weleda
orth
‘eta areola he one depend -=Y9-02 wD = 1 The cecompaton toh
‘vt
© rhe nt seen roering
on)
han ene pri met opion
Given , sot of dependencies X > ¥ , ¥ > Z, Z > Wand W > Y and the
table is decomposed into (x.y) , (yz) and (y:).
Lossless property is satisfied since intersection of (xy) (2) is y and y+ =
xyz which is superkey for (y.2) hence we can merge them Then intersection
(x,y2) and (0) is y+ = yw since Y¥--> Z and Z > WHence the given
decomposition is lossless.
For dependency preservation , we have to write all the direct and implied
dependencies for each of the subrelations.Lers write for each of the
sub-relation one by one.
a) For (x.y) X > Yidiect)
'b) For (y.2) : ¥ > Z(direct) ,Z > Y¢implied from Z > W and WY)
€) For (w.y) : W > Y(direct), ¥ > Wimplied from ¥ > Z and Z > W)
‘Now for checking the dependency preservation , we have to check from the
original FD set whether each of the FDs are satisfied from the FDs which arethere in the subrelations.
‘Now X--> ¥,¥ > Zand W-—-> ¥ are also there in subrelations 50 n0
concern here.
For Z.--> W,, we have found the implied dependencies Z > ¥ and ¥ > W
from which we can obtain Z ~> W-Hence this FD is also satisfied in the
subrelation Hence the given decomposition is dependency preservation also,
rhe ane teetering
om panes ta
ae inrawaiNiakswhere a end stans ea
© mre,
es comet opion
{Aten hat pean princi a pr a ence carck prin
‘ashes acinar wtntystanacen vt render ou ter tans et er oe sat adit ene, i
tetrad er orate te acon, hens arta
{aman we ans and ny peeing acon drm i ern an ico bt cn eect ant
hoctvea te arene a rey sc sed ch. he te ote tice ances
ont te tong ala Mth logit rh rn
=~
=
= ~~
EECERE RPE EEEE
Lung esther 17, 49,5 2d ag nh pened aren he eo
‘erg heer th cer 5,4, 25 4a dg ee opps oe etna tate
eo
om
ef Comet opon
tant tether tpt nee ering 15nd 25 es chng the te src ay te dng amine
“riers src chang When ing edbrcon lbp nee seen eon thea 7 |
‘eer enn 9209472 Fly hen 1 etm ebro pbs tee wontons iy thera ee.
otanet ering nadine o015,825and ils hong teste When ree at mate wit sng he eo
Eiatee hens acelin cei oon intact he dle it chargthe ered