You are on page 1of 13
Sem (CSE / 156) RE 5. plain informal design guides fr rtation schemas. Database Management Syitom fen assembles dyaumialy generated HTMI pages fom daar ucry rel Fer example conser the a customer who wants ox a tem oer bows OF searing sito find). Before ase ca happen, these aso go rongh ‘seis of sts Shes tates tor sopping bse, se bas ove et shiging res and crt card umber (nes she hasan account at thes) a She as to fnally confirm the sale with x od siping ents ded. Canteiog, the flow among these steps and remembering akendy excited tps done the nile of th application. Data Management Ter Datitensive We aplicton involve DBMS Module-4 ‘The four informal measures of quality for relation schema sear {Seman fees str Specie hoo iy tes al see ina tle fhe eon a ther sri hw tr cre lee iene mi: Gude Dotgns nisin sheen ob ey spi ioc Do ‘Scobie ies mae slips cath TD Reding senna alas ntl See srg pe sd svi wpe. mont ‘rin Aroma “oir employee no EMP DET mut ites tte ‘ofr ha prt emp ns cea det oe ew depres pats ro poe petit EMF DEP rato Tal yoda ts ple lees abs ence To inst tren ects SN st ia ly DEP cs tpl pred Grpmcstancnple coy donc ey Dail omar fan employee tuples dled fom EMP_DEPT tat happens to repeat st. ‘employee working for paca department, the information eonceming ta ‘parm ost roa the database. ‘Modifcation Anonaties In EMP_DEPT, i the alo of oo ofthe ais of» pacar dpe i ‘hngol sry the manager depres then all employers ia etape who work Inia deparment fave be upe. Guideline 2: Desi the fae elation schemas so that insertion, dln, ‘motieation anomalies oar. Reducing teal abs in ules. ei 10% of ployee have ofc, tis beter havea spate elton, EMP_ OFFICE, ater tana atibate OFFICE. NUMBER in EMPLOYEE. ‘.Redacing the nal values topes ‘NULLs ca have multiple interpretations, sich the allowing: = The mite does ot ppy to this tape Fx example, Vis tats may ot pp Sustar Exam Seamer + BCS - Model Question Paper - 1 TeUS aden, «+ Theat alae fortis minor Farexamgl fe Date of Si may te eninown fran enplyes + Theva is now but ben tat thas nt era eer yet For amps ‘he Home Phone Nomber fer an employee may ext but aya be vale ed onde yet Gideline 3: Ave pling tutes ia tae eaton woe asses al ‘Generation of Spartans Tule Spurious Tepe se hes hat rot inthe ‘sil elton bit pened by trl in of decomp stelatons. (Galdtine Design lation sens so that ey can beastly ONedon primary Keysorfsgn Keys ina way tat gure a prions per rors 1, What isnormatzatin? Explain third wormal frm withexample (ears) eraalzaton of data te proves of raleigh given lsion chemas aed nite FDs ad pray keys achieve he deal poperis of () mining ‘endian (2) nang he zero, ele, sd pate anaales ‘Thiam eased onthe cnc of tnstive depend ‘fisonl dependency XY ia lin estate deanery tarsal (ates 2 hat et bet of any ty he ein ad sh X Zand ZY ole Tneter wor, aeation ein NF, whenever inion dependency XA ols ine relon either) X ia spehey of be eo, of) Asa rime au te lato. Pte! Roe: "line Clans nt Dept on Key” if ‘ttn do oot contiute to a dessin of ky, ono tea a ear ble Foal Deion: elation in third oma fo NE) fan ony itis aN tndoreynoakey atte onitvey depend te pia Ke. Las INE: Risin INF ill aman vals ae ato. ‘ INF: Risin NP PR isin INF and every oak ates fly depndeat on tel. SNF Risin SNFATRir2NF andevr oak otibutes onnasiely dependent athe le. ‘Salo Euan Senter B e & "VW Sev (CSE / ISE) Database Management Systenv oR 2 Write the algoritha for testing now additive join property. (Smarts) ‘Aus. Testing foe Nowaditive Jin Proper) Inpet: A uciveral rei 8 a JsompostionD Ff functional dependencies 1. Crest an inital matrix S with one row fa each elation rin D, and oné column _foccach atcibute dR 2 Set Qi. j= bj forall mati eas. (* each bia distinct symbol associated swith indices Gan. 3. For each row i epreszting elation schema Ri {fr each column j representing wecbute 4) {Gf elation i icles atrbate 4 the sti) a} (* each a is a distinct spmbol asccited wih index () 9) 4. Repeat the following loop until complete loop execution results in no changes to S {foreach functional dependency XT in F (foc all rows in that have the some “pmol i the colunascoresponding Wo atibtes in (make the syrbols in ach column that corespood to an atbutin Yb he sein al these os as fll any ofthe rows bas an 2 symbol forte soma, set the other rows to that a 2 symbol inthe columa. [fn a symbol exists forthe tribute in any ofthe rows, choose one ofthe 8 symbols that apes in ae ofthe rows forthe aibute and set the other rows to that same & symbol ia he column}; }:}: S If row is made up eaticly of a symbols, thea the decomposition has the onaditive join propery; otherwise, it doesnot b. Consider R={ABCDEF} Fa's{ AB—C,B-E, ADF}. Check whether decompositions lossless. (Barks) ‘Ass Key=AB - R= {ABC} ‘ Re (ADA RF) Decomposition is astes for any 2 eitonsR, and R, RaR—R | RaR>R ARR RAR! Ie et sco tc sy Module-S {RL 2... Rm} of Randa set (mars) support in SQL 3 logical unit of work (ie a single SQL statement). made can be specified 3s READ ONLY or READ WRITE. The default ) WRITE, which allows update, inser, delete, and create commands to mode of READ ONLY, as the name implies, is simply for data es ae Se eee Databoue Management syiten’ Tse poe tat sw anne om rs pase ropes te “ever, We ot ont to esl Cal pro ic ae ‘ble pplition go eames fom he ITM frm Exam Ctseip wits ne inp ‘wei, ‘pac ei Te isan inte gee tht of sed fr CO sig diy aie module provi ig ev! iis the Clot ‘TheCl mcb sacra liz of tons fori COI | danse | Savasanes we pics ove cade hon ee, inte eter eres Thee ps emenons on Row ted ns om rappin ieee bon sc em ri Sea "plo npn ado they ae econ very ppl wth We ees “Riles Soi nme cs aves ee ayer htc with cs a TTP Te las ovis mcd ch ar oGe a JPost ee agers PTO. edi ds tack 1 the cle vis HTTP Seve: emnmat tg er ren (neh a ip) ed 9 extn the cs | tino ean. : ipl ini) tay rae te ge co iin Resting Gus” ah (c8cs - Model Question Paper =2 “imple domain consi aie ‘Seebe Noraal Fora QF) Nore eon to cnce ol wee iy aston denen i reneral stan ay, ‘iets! S=- aie dpy dos tbl a Aeon hg Fe Prine arte tn i lly Rta dpe gh 2a ean a cn be eae liv hea yh my nn ain eto tal Spo on ayy ‘sation ein ake “lini Reba Date, fan aii deeds Fry elec Fy rove a a sepa le yp Pea ar anton sin soca eal fom INF) idea iy roy un key tite aly dependant nthe pinay ey Tae Namal orm OND) Thad pall ee dependony frets pe ry oes Zt 03 Ube fay Key! heel Here nd oY hl tn tar edo ein i: 0 INF eons Pa A pandncy RA bole he etn er Xs asap i ey A a ime atl of he ato. Pract Rue ‘limaas esr te Depeuson on ey yates not conte ta, Jom Altice hid normale GNF) if ony ii Sieve non eye oat dept on th pray. ‘hat ancien denen? Esp? ‘et Afanctonl dependeney (PD) acon tw tos 0 Ft ar ee eh on ier aaa oh Seta oe er Frat reer pee a dpe tcraceecrenttieeaeaa an “The FD. hols on Rif analy i fal poste relations ‘uples ofee o the ater K, they alae on the stints ae ee ” Frraye : ase sv (CSE / TSE) Database Management Systenv ‘the single arrow de es “functional dependency’ © X Ycamalso be ead as "determing J” # the double artow denotes gical implication” > OR Explain the following {) Inclusion dependencies i) Domatn key Normal Form (08 marks) Ans. i Inclusion dependencies were defined in order to formalize two types of interelational constraints: , foreign key (or referential integrity) constraint cannot be specified as a functional ormultivalued dependency because itrelates attributes across relations, ‘* The constraint between two relations that represent a lass/subclass relationship also has no formal definition in terms of the functional,maltivalued, and join dependencies. An inclusion dependency R.X'= 10000 (ee in fom apy ii elt name aS ) fice ven me 1 meas me on 9 kan ose and umber ~ eno end dune “ty nb oo tS | pete sae, comms eds) fom project, dept noe ate an pmb szmo 0H y pan hss oa nun, =" Module-4 4 ai cai be diferente ito ea » type, Jon the EMP_DEPT relation vane ito EMP_DEPT, either the atbute va ui joyce work ror NULL Gite npg ), For example, {0 insert a new tuple ae oer 5, we must enter all the atribute value consistent withthe corresponding values rate with Tasertion anomnal ales ‘exumnples based Insertion tasted by the follows cnt ha jepartment a yet rks in departient num rectly so that they are oP ples in EMP_DEPT ye that has no employees as yetin the EME to place NULL vals in the tributes fo Tine only ay fo do this is Deletion Anomalies: of deletion anomalies is related tothe second Asam station f we dele from EMP_DEPT an employee pl tt ee the ast employee working fr «pacar department, de ng that departmet is lost fom the database. eI EMP DEPT, ifthe value of one of the anibuts of ¢ hanged. the manager of department 5 the types of ise, the database enployte The problem fappens 10 Nodifeaton Avomaies: pacicular department isc Fremployees who work in that department must be updated; otherw ito update some tuples the same department vil different employee tuples, wil become inconsistent. we fl Sr snown to have two different valves form which would be wrong. b. Definé Mativated dependency. Explain fourth normal form, ‘with an example. (063aris) ‘ans. A multivalued dependency X Y specified on relation sohema Ry where X and ¥ aro tosh subsets of Re specifies the fllowing constraint on any relation ‘state r of Re IE ott end esta csc [X= hn wo urls toes in cart the following popes, where Z denotes R= OC). ‘* Aceltion schema R is in 4NF with respect to a set jes F (that eee ce erro mt ‘multivalued dependencies) i valued depedeny K- Yin PHT Xisa upey +45 The following poi ee resent yanager ik ‘# Anal. Aeytelation abways in BONE since it has oo FDS. Anal ey etn sch asthe EMP tn, wich sm Daath MVD rane Pame| Dna a INF ‘+ Aehtion ttt AN dt nov MVD mast be dese 0 evet tit ase ofan in aN 1 The dsomporon eves the refdoc eased hy he MVD. Conder the waiver ation R= [4 1, , Bs J an these of functions dependenses = (0) Ch 1A) = IG, MO) ‘What ey of 2 DesomgoRint2NF and then 3NF relations. (8 Marks) ds Koo (AB) INEAB—C A= DERD=1) BaFaF—GH BNEAB=C ASE Dau bor Fon OR 1 a. Deine Noman jin property decomposition od write ae of Aetng for om aioe rn propery. (iM) ‘Ans Adeomgoston D= [I, R— Rn} oR haste fs (eons) on propery nh epee st af deeds Fon Rif eee one ‘rf staes Fellow as were ithe NATURAL JON ofa De (eR, sit) “ein for Nenad an Proper fap Aiea ping D= (RI RZ... Ra oF Rand set Feffinctnal pons {Crean nal at S wiht ow frac ao I nD, aon elma iforchatrbae a BSc fr al ic ois (oh a sinc ssl seine wenden) orc row eepeseig elton hems {ioccich column} erties A {elton Ralston et 6, >a ee a din ‘tol saaeste whide() Tepes flor np ls ole op exe sis nao cnges ws y (Grech ances dependency XY nF {fra wen tha ve eae symone coun competing baer in 16 ‘Sasa En Seer sal these rosa: any ofthese mine ee G9 “nye ea Secon epee sone ree a ews rhe dhe tes th ae Synltecole Tate seo 4.9 Siding ober esr a os hlatin Ri 0. sti he ating FDA Go Jari foaine Canmea overt oP rincDem Folger we aed eo Aen aint oes H Emre a= eo seb aa tof FD ee Eno e AEA Some Since ane iat free onmae? ae ee SG earn hy age sly nee tlt the decomposition has the ro Dib (mart) Modules ea, Decass ACTD proper ofa database tases. (mart) ‘Aas RelerQ No.9. 2, Mal Question Pape -3 ke Enplan rans spportia SOL, (smarts) 1 SQL vorsacton 3 lol an of work and granted 19 be atomic “raccion ints is Jone impel mien patiulr SQL statement ar ‘ecouneed Evy ent mtbavesn expels, which seers COMMIT ‘Sale Esan Seater wv |} [less {_—_Loeals ino _| soot ints | eon | p93 ios [a0 ‘Once | 1000 wor | seo Frame | See ot | thon | Banal ro)? | Janes Bont o)3 [Pate [Myson oj Chueh | Mangala ois LAT [eta ‘Coane [Cy ‘gro | Mansi infoos | Banos tafe | — Myre ‘Once | — Keni Wire [Bay TSP Nec me. Cy fam wars w Lives ‘Where W Prame =, Pame wad rane = "WIPRO (i)Selet Pram fom wads Were (ipsa name om works whee Sala > (Sela § Max aay) Fo was wien ime =" Ole (iS Pane Fm wos Lins odin Wher W Prame = LP ame aod W.C name =1.C ane iad ciy “Lei: 2 Want you ite an lgeritin tnd else sfatoibate, (Qatari) ‘Ans Csureoran Atiibate= Tea ri kn coy sid em ‘aldara corre of hat arb set clef wu st x} is dented [x Aleit = 2 ‘Ssrstar Exam Seer BCS -De02018 / Fame 2019 {ep ASG FFD, onset wn Xex epee ux: x, fee tn diay ta Uaioe dX) |. Eapbia any ro otra quay measures employes fra relation sera po) (emai) Ans (patina semantics toate a relatos = Sonesta omen tt ‘East eapainsemaiies of elation nde beter ween dean TOPE SERA om alley ype ad eltehip pio frmato tapes a pt noma: Mist yn een shen ina ell ge ems wih ope oma 4 son hem ht pte abot are pein he scm ely tthe yam ht pie te dab wl pe corey 6 Gien low are es FDS elation R (hy BC, Dy E) «A hey sual? DA BAB—CD-—AC DE A—8C,D—AE (06 Mors) Ame (ABCD, 5) X= {A= B,AB~C,0-+AC.D-+E} (ABC, DAE} XeYOCCOVERS Vex. (y=ABC(AD=ABC {B)=DAE ac (AB)=ABC (0) =DAcen Serle Eas Sane 3 CBCS - Deo 2018 / Jan 2019 V Sem (CSELISE) Database Management Syitov XCaven¥ VOneax Yerba andy ae eant oR 4 4, Wiatdoyoumeanymlvletdreneney Espa the NE wit eam (Works) ‘Ass Maine dpa conzyene offs onl frm (0) Seesmic tne a te irenameire shales arenmeee ee Ser teeny ‘We can state the following points = = pero a op ci inure sees Enune [ Prane | Dane i sos x [oto Swit |__| Aon Smit |x| — Asan : ‘Sei | | — ot paige EF toa Tb to ANF eins EMP oes nd EMP DEPENDENT, EWP Pajoae ar DEFENDENT| ee ‘Sai [ sia [Jan ne Sem | —y—] [Sei] oo ee ‘Swept and ex three dierent Webige eave INF ating sie a “eal (een ‘Ani Thre technique chev INF i (Remove ie ite tht Vtes INF and pace a oat eon et ~ lcans long wit he nay hey D numb Deprine,Te py hy of iis reaton sth conbition {Dube D rat A itn pli re «locations ert foreach cts ofa depen Ti decompo aoa {elion INF rston Alton sha at tia NF Deprnet [Brime [D wonber] Omer -ss0 [b ecatons J Simple sae flan department Deparnen Grane [—Dasniee [Omen [Dia Rear s 1 = airs < 2H ie Headgs i 300 icc [Ni veron of ae nin WS ‘Deane _[Dnunber] Dmgr-sse [Divers esreh |S | 100 | Banga Revech | 5 | 100 | Hath [inet] — «| 200 | Mangalore ewig 500 Mysore Constr the fatonng elation foresee, Datesod fsman- am ‘oamisnn, denn Asse aca a eel by mail aletoneaed hon rity ky ar sakman Ain deptotencr are ‘1th rin in EN 2NF or NF Why ory ot {How would ee urea hs comply? (dora) ‘As, Du sld™ Deco ‘Ssnan-90~- Commis T_[ovesnen | 10 0 [2 framene| ir 000 | 55 3 fosesa0is| | anon | 6 4 [aoenneis | 500 | 5 _[ounsani9| 29 200 —| 0 TT ton NF Bsa iar Rv I We {G) is wn nt 2MF beep epenlny Doon dep on (6) ian aN esc a dpedeny ‘Sarl Ea See 38 > ne Set gaat ay BASS Seen : ba WHERE BOOK - sb Module - 4 we seen tr bese ontheonespteftransitivefenctinna depeedeny? i * Fapia the same with an example (08 Maris) we dependency = : Ase Trassie ti &buse on the coocept of transitive dependency. A functional ae saeschema & sa transitive dependency. ifthere exists a sepeaderey XY c iG Re late hey nora subset of any Key of R and oY sold. The dependency ssa —* Dmgr - ssn is transitive through because both the dependencies ssn —+ D number and D er a key itself nora subset of the ssdancy fo Dmge-- ssn on D number is is not a key fo EMP - DEPT. INF if is statistics Asconding 19 oods on {INF and no noe peime arcibute ofR is trnsitively dependent on the primary key The relation schema EMP - DEPT in the figure is in 2NF . since no partial dependencies 0a & key exist . However EMP - DEPT is not in 3NF because of the transitive dependency of Dmgr - sso oa ssa via D number. We can normalize EMP ~ DEPT by decomposing it into two 3NF relation schemes EDI and ED2 shown in fe) 51 — Poumber | Hous | Ename ] Poame [ Plocation fol or FD} 2NF normalization [wr TPamte[ous] [Gen [évane] [Punter [Pome [ Poon fasmmelenret ys Lf od} Trane [an [ Bioe [Adie [Dnonter] Drame [Omg] 3NF nomaization | [Game [oe [itae [eis [Deane] [Baim [ Doe paeipeto tT 'b. What is the need for normalization ? consider the relation. EMP-PROS- {ssn ,Paumber , Hours, E name, P name, P location} ‘Assume (ssn, P_number, } as primary key. ‘The dependencies are { ssn, P number} — Hours ssn E name Pnumber— {Pname,P location } Normalize the above relation to 3NF (08 Marks) ‘Ans. Normalization = ‘Normalization of data ean’ be considered a process of analyzing the given relation Schemes based on-their FDs and primary Keyso achieve the desirable properties of | ()Mininizng redundancy {@ Minimizing the insertion, detetion and update anomalies 32 ‘Suastar Exam Scanner a CBCS - June/July 2019 Lae tam is = ieee] Foy eee t ros t t INF wormatization | [Cae [Pranr ian] [as [Ege] [Pour [ Poe [etn pene oR adeney ? Fi thew 8. a. What i Functional Dep cover algorithm forthe following fu Peta D,B->G AE» BA» D,D BEY ‘Ans. Functional dependency itisa constant tween wo ss of AY Demcen wo sts of tributes X and ¥ th a Spoces» const onthe posible tuples can form a elation eesti is tat foray two tpl | a in a have Fa) ctf they most also have | f01=6 61 (08 Marks) | atibutes fom the database It is denoted by X subsets of K | nate eof R. The {or the following functional dependency, Minimal cover ABD, B-C,AE-*B,A—>D,D-+EF$ After decomposition. AB=D [syd JAB—D pc [Boe (ABy = ABDEF Ae~6 [BBC | (AY = ADEF Aad [AEB [(B)'=BC Doe |(ereae [AEB DoF - [A+ (Ay =AEBCDF (AHA (Ay = ADEF DE [(D")= DF DF (o2)=bE MINIMAL COVER ABC BoC AEB —Sanitar Exam Scanner ;

You might also like