You are on page 1of 157
4. ER-MopEL INTRODUCTION TD oBMs . pata: Any fact that could be Recorded! and aaa Rane pwabare: collecHon ch Rebted data. 2 The datatgse thal conatns text and Numbew 1s called Woditional Database. => Realtime Databases + Super mantels, Firms. > Datawone house" Contains Cap armeunt of Qndq, the data ws ry | | tobe historical. P Neo adays the Aalabaser ane computerized and thre mathe | Bowe actheone that Defines, Conatrucls, Mani palate the RoJalhasep | Now, the cffesone that perfirns above Spaatons on the Database | ® alled “Patahase Maragement Systems < | = | DB + De para GASE Systems] 4. MODELS > The Various mecela that ase used when designing the database fa 1. High Level oF Concerstia) Models “> NAIVE UseRS Sacro | 2. Representational / dmple mentation Model > Used by eae mfetel 3. Logical Level/ physical Cote medelp sted whe, pa gel 12) & INTRODUCTION TO ER-MopEL ER Model= Entity Relationship Model CEohity, Albitutes, Reahonahips) | | Eatiry: Any object In cu Dolabare. | ATIRIGUTES: The thiegs thal describe the Entities anc called ati babes. PUUAIGUTES * a Cpatop exrties thay ane Used to deacibe Entities betten). { RELATIONSHips . Association ea enti ttes- Enhty (26, Raja, ~~) = Extension fancthe ER- Model we Use Enli ty types but not the Entities. 4. ATTRIBUTES . ; i Betta. > Attsiibutes ar use fal tnorden to descrtbe the entities Be The Attnibutes ade mranily casi fied into y Strmple Attributes (Ve) Composite Aibsibul es. | ay Sie Nolued (vs) Math valued! Attat kwes, 3 Stored (WS) Derived Attributes 4y Compe Alt nibuJes PERSON Nowe Sarbliame, FirstName , Middlename LastName (Composite Attribde) Aqe = Single valued Altvibate Puro = Multi valued Attribute MOB = Stored Atty bate | iow | Age > Derived Attn bute ; Composite Alvikale dese 7 i pe complex Altai lcs e Multi valued Att babe. 5. RELATIONSHips (4-mM) => Relationship is pathing bal Astciation arrong entittes. Requirement: Bro Hal Evan Employee cooks jor a Dep Crd a Dep i Exactly one bave fang Employecs Ee Necudlepom trent neec) not have oy Spl sea | Dayree 2 Hous enti dre, Hietpedt in every Relationship: Depec many ex ce pot pol "9 4 Oeq= 05 [for above diagram t= Binary Reahanship Condinalsty ot employee - 4 > condi nality cf parterent « Many « (m/a) RatiCtpedion or Puiwtance : Poorticl pode Min: oa; of Pethanships thal an entity can = Mtn canding uy } > peoticiqnhon Employee) = | > pect cipation (Pepastment)-o,(Neasly -funed department | Gendt have Cmpleyees), t coord: ratity Ratio Fork cipalion/Existance | Str dunalcondiatnn — sees for —Eniters: [| (ewe (vont or Reatemship: Protici patton Cathe enbsien | & chthe set ane pacticipakiog to Relakon chip) pega only one “menoy-1 manages at depeot ment ard) an empnjee Can Manage only one department.(Emp should tok ently in 4 depart ment) Re: eyo empbyce 18 supported bo Work least On cre Project Ard he can wk On many projects mucllas 5 6 ard 1 puppored fo hove alkast CURSIVE RELATIONSHipS 9) Be Eveng employee ik Aupposed to fave croc ily Qne AUpenvizer Superyines Supers Be ‘pee t N Em fom) Pp (ors) Conchinabiny ch AUP N Supervigee = | poet ci pation of BUpeWviner= © of AupoyiBec= O 4. ATIRIBUTES TO RELATION SHIPS can shiieonanyaide ae BeHen to ahifton Oo Pax i - oe Bide Ss tame i | Emp |}— >> - woo fa] Sage Sfardst— Bette not bo shi on any Aide Lemp }@< > rer | weft) ‘ © WEAK E» > when ever Any entity te nol having an. Key ath bale ther) auch an | | Entity 1% Called Ura entity, 49 the comak entity Phould be avocicded to the ao entity with a Relationship. called ag " Tdent fying, Relations p) Telent fyiney Petdion ship : © Weak: entity: =r > Vi dep point : Alanys the peaticipaton 3} See ay in an Sentfin Relation Ahip shod be” Total pasrticipahon: tL ER pipg RAM NOTATIONS La semity Was = Denved Mbibule (SJoures SD) = Key Atrowte eat fy = Muth valued re eH Base. = Composite Atnbube Sr ee 2 RELATIONAL DB MopeEL Om |; INTROOUCTION TO RELATIONAL DATABASE ep DoS LiON a lOg LEE > The mest pepe palabore model cred od Repesen tational level 1a Retatinal motel. SQL , SEQUEL ORecLe, IBM — CEDEME) poe 2. TERMINOLOGY OF RELATIONEL OATASASE Ie Relation: Table /Reltkon Sdension 2 Tupk : Row (Contatos entities) 3 Attribabe: Column 4 Domain :fAet 4 Values} Qseciat-cl Coith attatbabes) Jalon > RelaHonal Acherra: Heading of the tale - RCA,ALAcAy As) | dotenxiern Depee ofa Reolion: The no of atathales 3 Tope, TUPLE VALUES Ann = Whenever ur storie tn poor calan orden. Q Rdation Ina Terrony then Tbia Atored + Sn a Reldion no two tuples Can aye the Ame values 19 i) the ati babez- (no duplicate values). > fome values the athtbukes are ma Apeafied (present thenuxe Ge "NULL" Te that fiekt. > for Srampe + Name Compizer Of Phatrame, Middle Name, lastrame ard now a_ person Might mot have middie name £0 Middle mame ==Nut yp Domaln conntecinta Fotive schema ahould be Atomic. @ » Key Conshralnia=> No too Tuptes should have avne value at Entity Sete nity coshaints > Entine touple ahould fellow some Contains. Ay Reforn tal Integrity consbatnts + Applied buen two tables(Relations) = We can View a Relationag * Flat file structunet Shtuld be Atomic Composite , Multvalued albibules ape vel alioued im Relations b we 5. CONSTRAINTS ON RELATIONAL DB SCHEMA - KEY CONSTRAINTS | arate -consbraints coe Ako called” UriQquencss Constraints: Student Mons ————__~ oi (GENO, Srarne. masks) Y> SUPER Key Ct, Ravina, too) ro ot Cl, Ravindia,ioc)” 41 go a ame 4,4b, =r [SUPER KEY Altrikules) {oy hich na two touples have the | aame Values Irn all the Attr7 butes > Ary Mini mal Auper taey ta a “key *. (Sno) 3 Even Rettion is going to have a AUpen Key cy defoult and that Paper key is "Bet ofall Attni ules | > | aupenset of o eo isa supetier. | sip Ai wa bey, ard the ac/Rebshon/ale contains (AiAs%z 4) albibwl es then the Nod, superKeys thet can be formed % aaa td r e ei dl ee ST) or aerg to have boo Keys for a Relation then trey ae qping © be candidate Kays 9 Sf ue have feo minimal Aapen Keye | fer a Relation then shay ane called "Candidate eys! | =F ore of the | Kays of candidate toys ta choosen and tt ®gorng t Ply some Irpostant role while ue Inset some pumbers Are that key 7B called "PRIMARY key” rs x (A AL A, Ay) - Sk (Av A, As a4) (ay As A)- SE (A A, Ag) - se and Bey CH) ~ Sk and bey a indidat Heys = (Ag ag) Aa Ay on cts eS Mimal rence =r" primary Kat" doesnt allow "mouvaluca. &- ENTIVY AND REFEREN ty. GTR OcrY cones TRAINS => Entity coz Rawk that no prine aitibule should have nuit value ae Cepartmre nt PNOT USUALLY «wll GE PRymnry rey Uy Deparment RELATION fore 9? ier can have “ NULL" Values Unlike pairraony Key 4. ACTIONS UPON CONSTRAINT NIoLATIONS Lathe Adtor® that ane performed on the dalolaze one 1) Srscrtion on porforsing there actions OF prould in Li . MD DekUen 1 ee icine ah ae tem, SIR bid Oplate "srt Coveann Xe, Eng Reprentol : constrain) = Sythe above actions vidlale the constealios the de fouit action % to seject puch actons whch ae Sesulhing io Violation. 4 . thy * BS udhle' deleting the Constratot that get vieladed ia Refexentiad Sap hg aod the actions that must be taken one te Tgrome it Cheject Abe acHan) 2. Cascade Chelet ¢ the tuple ard alto delete the t upler why Ge Gen drehened by the above tuple ¢ | th, abadd be deleted). - 3 Sea Noll og Aome olbes value 8. COWUNTING 7 “gy oes -E -ExAmpe -4 SNe TI BOSE treason | ‘ Z J Given a Rettion R(A A, 4,--- An) | cardidale Keys (4, } » | on Clertents 0 ®@6 6 ; Tolad Took Keyss (% 24272 x On-) hires fA Nos ‘ ehiyaon-l * eae ceecdidote Here hAras te Cactidale Key TB AA, ot Ash AAR AA camwalm: 2: Finglec, Too er) NO eit tt Gauge alel ! 9-2)ele OO) Ee = NIK BxA--- (-2 Himes 2 k - Sei Now, If candidate Keys s fa,,4,] Vhe no of Papen keyx= SKA + SCA) = SK (A, Ag) = ago een Tl ot af 19 COUNTING THE KeOrehs pocisct 2, Reation R= (A) A, Ag--- An) ck= {A AAt Noo SkS= SK(AD+ SK (4,Ag)- SKA) Ag Ay) a) e 3 i Skate 2 + 25-2 ck faa, /AsAg |} No: o}, sk's - SK(A\A,) + sk(A, 44) = SCA, Ash) r x faa, , AP} > no of skin = SKA) + Sk(,a,)~ stc(AiAyAs) ae Oats ieee Skin S207 5 A! Noh SKIR = SK(A)+ SK(A,) +5k (A,) - Ske (A\4a) - sx (A, Az) ~ Sk (AAs) ? +Sk(AiAs A: ) : [= iin 5 digit ak i ae ae x] >R (ABCD) ck= (A, Bo) | No-of Sk’s= se (a) + Sk(@e) - sic (Bc) a ee oe! { iy ce le 5 rs SK= $44-2= (Oy @) Thee ox 4 steps to convert ERmodel (which fa designed ob Corey 3: CONVERTION OF ER MopEL TO RELATIONAL opel & STEP A Reva to Relational ere and Rprms can be applied apprpialely, = FOR EVERY ENTITY IN ER-mopeL We HAVE TO Come up WITH A RELATION IN RELATIONAL moneL, hm be we | | aS | Now ithe Relation for thin - Ak all} oa = we Student [Sno[vens[ Fn en ] > Every simple atta tale 16 meer in the table. > composite atbibule ts further clividedard ctlomic parts ane represented 10 the tale > Muitivalued entities acte not reprerented Ih the Relation (> Represent the patimany Key in the ER-meelel in the Relabion alsofirdesta } | 2 STEp-2 I> CONVERTING THE WEA ENntiEs INTO RELATIONS proiiiol Hey Pepe Kiar i Name <> Tal pa ply GS) Gore) Govt) fasta ty, fenaage] Z i | ° - cmecde A tabe/Relation for the axak entity and add athe nie Ailzibutes > Tdenhby the postal key in the wxak enfity and alao dentiby the Prtieraoy bey in the cesar entity Gberg entity). > Now add primany Ke] ef the ouonen entity Ceno) 04 the frien bey the war gat end make poohal Hey cf mak enhlyand the PEO} Alon < ae Fars Employee Relation | PK of ureak entity. The clelete 9 « os opemation here ta "Cascape” pelete which meant Hf you delete ors MOU ih the ownen entity with Zome paticalan “Ena” then ypu should delete ali the ents agsociakd with that Eno tn the weak entity alam = CONVERTION of RELATIONSHIPS INTO RELATIONS (TABLES) =D frpsirent] Pay aa END = aras is : r Employee Fassia Depootiment Noo Add the porimeay Key of one aide (Onetable) as the forego ey q Another table qereraty add the pk 4 (non- to! al yenti?cipabon) ds @ the fo iego wey of tre tote! participation tate. asl 2 the Rebhombip itselh contains aHibales add the atbibales License card! On the { ictpation Aide- tort poortic Pose , | one-one Pebalion | ae) / elit / / tO eal > sles yoo have total poniicipahon on both the sides and ane one ee eaists on bath Acs the Jn both the Reladions the no. a CD 7 Reisen Narne Fv ae | aii ons | ' . tupl will be eual and dathal case shore ts Toned of adding the prirany Key | cheimiceiento -thesoiherA\den Ge edan Jot on the two oebtions Into a alnyt Relation. _ Bae FEE og I alto taker tess spnce: / . tT ti ego red. Ga oi Aer 13 SRELATLONSHIT INTtTo A RELATION Ermhe) feovdale) @) Gem os Empler ee . [pe prermenf | = Ej. | Employee =) Tare the patimany Key of Azide in(iim) and oad oe faniegn Key to the (N 4ide > The Athildes On the Reblionzhips cole Ahifted to the ‘N? Aide > CONVERSION cE Many do me PELATIONS Hitt mr foo) B) Gam) QE 4 2 Cam [Empieyee e = 1 ae WmKsET | ee 2 | = us cannct vse foreign bey Repre pentation becaiase an emphye Can ook fue mae than one pooject ard apaojed caninye mine ine so as Be bn NS lea a ee 9 | | = create a Rebtion having the Mm Eid+ PNo= pic of Newtalle > how the altyitale on the Relahon ship haul be added to the neuly famed table. nee 6 STEP -& SPEAUNG With Muativewwep AMRIBUTE | = FON the mulhvalued att buke we coe 3°94 to creale a neolawe | | | | uti valued attibule Arel primary bey of the entry Gro, pnlo) [= DEALING, Wii .NARY RELATION SIPs (r MORE THO A Ep Pe >A, = | : > Now create a neurtable having the attalbules a7 patos ee f ai the entities. Ag] G mE ER- Mected Relational made} ; ———————" Entity" Relabian / petted Boon (11 and 1FN Reldianship (ype ———— Foreign Hey Cor Relagin) Min Relationship type ———— — Relationship" velahon' + 2pes Neary Relationship type Relation ahip elation’ + npes Simple Attribute ——— Altsrbute Composite Altthue Act of Aimple Component Attribules Mati Valued Attribule —— Relation and Foreign Key. Ralcbelac meee eS tn Bey Attnibute —— Prono bey. \ —— / (T 2005 QUESTION ON ER-DIAGRAMS an SH Hotel lng " Lee vain Room peraon. ' todqieg is frank Etrany Relalionzhip . Rent, payment be be made by person (+) exceapying Aiyferent hotel xooms Zhould be addadax on _ atta bute bo 0) Voted WY lodging ©) Pevsorn d) Nore. gli tel Us Bay tole) Reorm conatr® HNO tare -ared if we add Many peeple can Reride and Wwe Cannot Pal ail the Ren in ingle tuple > option AX > Let 6 daw the person tae bas pid, pname, Rent he eae ero ranghotels ard each hotel haa 12009 Rent, £0 wae cannot parallthe Penis hene ,=> aptione x >Incare of mmoy- many, Reahonship we create a new fable having | The pe of pooticlyasing entities [rid_]uino| Rent i alterna ) | 2 V2 [Sie the Reka Jionship _ lodging, The DHibwe Rent shod be on Lodging, | [0-GpTE 12 QUESTION ON CONVERTING ERT Rog Given the Insic ER An) Relational models , which ef the folowing is Seconect An athibate ofan ontily canhave moethan one value & Ap attibule df, an enty can be Companite. Fro Pow oh Relaional fable an atitbute aan bave mene than one O ww of eeladiora) fable ,analtr bule can have exai Hyp 4 vale ov M\ / eS a ER model Allritdes canbe compostle scope cl) (> option © tatta atoul Relational mectel art Relodional treetel om Alowd maltivalued Altaikedesr and Composite AtLibubes = INCOR gy a> option dd’ t% conedh since there shoudl be Crerlly one vertute try each fleid and can have NULL Vakien = CORRECT GATE 11 04 CONVERTION OF ER TO: ROG | Min no Of dabes: —_ E,CAy A, As) E,(4, RA.) Dabs B Ag, A Az) (12-GETE 05 ON CASCADE HELETE $0 CASE OF FOREIGN KEYS is Plowing fable faz two atbstisules A arcle: UhenA 2th: piterp7y | Fes Delexencing withAon-delete cascacle. ardc! is FF The et of am tapes trod must be adel teratly deletecl 10 preserve Lajeertial integsity wher the tuple (24) 18 deleted tas assjadGe OS D2 ©69G2(4.5) 4) (34413) (4) +The ‘eples that mast be dl tally 1 deleted one (5/2) @ 2) 8) @ > (4) in deleted > delele the 4 Containing +00(2) > Nevo on Saar Coase deleting the YOUR (5,2) G12) | becuase they conte = i. ae > Now delele the yous containing (5) =@/s) deleted W.GATE OB QUESTION ON CONVERTING ER TO Roe FE, - tu entities RR, ae too Rebhenshipa been Eyand ER, 16 one - }o~ Mang ard g 1& many to rrany + Rand R, doesnot have any alts! bates ofthe own. Wha} 16 the min no.of dabdes Tey udaecd 7 & Gay \9 pee fe [ fe] Min: no of sates = 2, OD No Oe NH IS EMTE Q3 Question on REPERENTIAL INTEGRITY = los! on REPERENTIAL (ERY. leh Rlaybic) and SCdieP) be tuo velakions In which “d! 2 the FE ofS! thal Defers te the poimaay Key a, R- considen the fohausing four operaho R ard 's. 2) dosent into R ©) Inset tnto's Which st} the frrowtng 16 toue aloub the arf erential integrity Constai nt abovey| Q +, ) None of arbcd can came ite yiobhion | ‘ ©) Oekte fom Rd) Pelete from s: | 6) All of abcd can couse violalion =. Both 9,6 can cause its violation Bot, b,c can cause it Violation. eee vv Sop 9 [4_| ‘- ; > dis depending ! on ‘a not a! 1 : ea =] aoe! [Eres s . ars ne ones Violation Srieningy 6 Tnto's’ ). ? Sntertieg Into"S" and — Peletion fron R’ ome qa ty Cause Nio lations - (may Cause we are not sure alocut 11) - & i" INTRODUCTION TO NoRmALISATION ! ; | oy ty we held the entine data in © Fingle. table it vom bake moe pce y | > Less Reduiretancay Thiet Aranccties 2 Neolovk Aramolies ill ccs) Deletion Arameies Update Ana mdli¢s. hes splitting The tales into Amal) dalles such tha) ou design sill rot corkain Ai) the above Aramaes and Redlandarey ts called “NORMALISATION | 2 Shorten to do Normalization we Use the Concest of Fundional Ocperden cies (EUR). and the Corcept of Cardiclate tee 2 INTROOU ¢ 10 FONE TIONAL OEPE NDENcies (a Te ad Neo + the Functional tener ip Ie Reckuces | i Recton darcy. a ro {6 Hoe the flinetional depend vey is Aske | ‘1 a [Py 9 fea wale of, At can go arieihe 41@ a | | Values dy Bland '¢' uniquely A> BC 2 ab en © [if UG: 4,04)-then} [iF Beadben | t(Be) = = ae Gy zen oe > Snitey ue pee thal the table tk in 4st Nownal form, * Next ond ne > Newt 3NF Bec se ee Abe feliosatag Reldion Instance ben mn abd To} the folios ng See oe arte by the Instance 7 ae @ vse ad 23y nae and | yor yy ©) Ye % and x52 (d)x2>¥ ond YOK a) XY DE and easy ; i L A» yan? and vere Holds Not bold es Hoda Holds 36 0) Y2>% and X52 9) xz>5Y ard ees + Holds Datbectht ap Notheid Holds Krseei| 1a36 5. GATE 2002 QVLESTION ON FoOls can From the felting toriance ob a adalfon Acherma R(AIBrC) 1! Conhde thar | DA fnckorany, dokmines Bard & flediorally dhe ede < 2 AmB BC ni 1 | ; mio AB and Bc ABP i d) A4AB and BAe f i | ' Cx () Aag Bc BPE aie + | | ® A>B R3C L a) hoicls NON L vy holds hold & hod® — Nat hoela. for this Instance | bt foul when ; ingzeorhon> Not HoLDS FoRmAL DEPINITION UNCTIONAL DEPENDENCY — DE BINT ONE OFM FUNCTION AUPE PRIDE Som gaqrée or iscguee hoe J: VARIous USAGES oF go's > Titentify Ackditional Furcioral Dperdenciea | } 7 Seenti fying Keys den ifeying Equakrees 4 pos a Flod ing minimal fp sel. Lee to peso etl the above adivittics we heave 2methods '> Snperence Rules > Suce foove (BY Closenie pet of Atbibates > Rasy ancl ten Raver pene. pln\erence Rules, a) Reflexive + A>B if BSA b) Transitive: AB ard Bac then APC uo Decompasition: A>Bc then A>B APC 4) Auginentalion : A>B then Ac—> Bc © onion: AB and A>c, then ABC A) Campastion: asp ard cD then Ac BD —__—_—— SET OF amt RIBUTES eal Dependancles? AB ‘i B= dendlied by at ard clomncad Foyt CDE D> AB that whabavie the Other altricabes thot you can uniquely identi by tee, At= {4,20} OFe3 ha Bt. {an} ct {0.6<, a5} ot. Lo} e% fet 1 onal eM fod,e0.8} ast fav, Bf} cosy’ [4.8.0] F.GATE 2006 QUESTION ON CLOSVE SET of ATIRIGUTES The foricasing functional dependenciex are queen: ABCD eahich one of the Foriousing options [8 false 7 rane MCAT faco cpa] Let (p= [a,¢.0, ce} ; enh DET Fancoa} © fastt= awed 4} CG . FOE : G5 SAMfer Pt Lop.g,0,£,D]= {Ac,0, £,pG} = TRE ® {ea}. {e,0,0,60]+ [4.8 04)- TRIE fh | | | | 9 fart: fac eo} =rnse D fant. Cain, c,0,6)} TRE DETERMINING CANDIDATE keys Given Relediony R(AIR.C.D) ard the FoSaIe ASB,B3C,C>p,D59 The Me, carchicale Keys rar can be fowmed © 21 (n= vp ofailtmbtad, fod be! Relahton) | Bator the love exampe No.cf Grodidale Keys tak ahould be Be SXamtnedia ot |. 1S, AL maximum. = Se SSL ane Le ce Rae, RIARCO) “the Ck length 4+- @ped) <© he - cK Of length 2 = (Ccn)Mec) Cnc n) (ALD = @ Awa cn of} length 25 MED cy P) (DA) (Ae XO) ~© cK enh a= MCE) dC) -@ ie! © : (Nou, Performs Pottors to Top “proach Now lela check if A) 1% curcidale Key 2 at. Laiacio} ft. A t& cardi date ay New, BT faiec/d) > (Arec of are eandiciabe Kays et Lare<, 0} = DY faiese:0} -. [No -of cKns 4 | Mote + dh A’ 8 a camdidate Key then anything thal contains a like @B)CAP) Can) CARL) CARD) - cst not be Cr Wey Cou be Ska. } MY ETE 1999 QUESTION ON, SEMTIE Ss : freata : R- CBS DIF) Functional dependencies ane (Cap, FA, Fo 9 D AB) then Ck=? AYCD R)EC OAE AD Ac fe) ae siete ma =) CCE) HBT LA Greig ane Hesrivanse Fore the RUS bub there Is MOY to determine CE Zo the — ony boclenive them bey hawing ceyh cx} a Soret = 62. COPY Ge, pa,08) at. functional dependencies = A7B der the Relation Acheme 8 (6,1,6,0,5,7, acne ae she, wt 4 [ifictione! dependencies {BF} {a}, Gj tol igh aad pepo MI, UY (Np ook. ural te te vey fort. | afer! Ofor} ©fcenect fe] : so) Given FOR = Seip] > {a} = (Ep 2G) {> {x3} > (> Gs) {Enk> (qjogmy > Ew SKKD OD {kl {mu} > (kK) > (Mm) y= fn} >() > 6) Z 5 thot (Epa VE Cerne FEL mmrT ots cante derived fom ue ae Git se Lemn) are there is Teway 7 coudd a) 4 now, (EF HH) = {e.F,4,6,7.4, KLM )N} e is the candidate Key. ancl Fe rnecl ie {Er} is cay € Key fe Veg 3 SATE 05 QuESsTION ON CANDIDATE Key ; Comsiden a Relation Acheme R= (AIBC, OF, Hon which dhe Fatiowtng finchora) dependencies bed? [ASG CoD, ESC.D3A} uhalare the Cardidaje Keys of Re O)AE,CE (LAF, BE,0F AEN, GEn,CcH JASIEN, OCH DEL (a=) . Candidate Key should Exc i baa Contoin Et. OL Kk bE iow, (F Nyt = (Este how, (ens frac} Toia) 6 aWsibal er athe ~~ ru)t- {Aiec DE, np > ase's [ EE a 4 WEN - Came, DEN} En {ce} AEM, BEH, DE oases” Nae cK CEN): fain neh Hos seis | 14. Gare 2013 QUESTION ON CANDIDATE KEY Picistion @ fus @alltiules AGCDEPEM -Fielda GF Conain only athomye okie. Fefcu se, Ase, Boe-E A ForEGl ts aact of ny dependencies: ro that Ft ia caadly phases ot Foe thot had -for Ry bow rmarey dus does R have? 24 cise, + ff SSAA AC C pot) KbevéF aA) BocrH EA FRIEG J Now, DY fp] \ : ' 2 any" CBeoE FH) Pe Sqn) eo Pan) > (8n)"= Gvene pa) ~ (60) | Cex) x > €p)*= Cer) % stunt = Cun) x >(ED)*= (ARCDE Fan) No of Ck posalble ane = 48 = >) (ery(En) (FD) IS ExAmples on CANDIDATE Keys —) ae ec ee YS =I, ° R= (ApcoE) €D> fapc.c70, Ge} C Y= anése => (B= (A BepF) Now, 6 Ge) faseo, e} rit SAB’ 18 the cand i Jy - ‘ABCOE) FD {apsc, C30, BseA} Serco = (CAucse er < , a oo” {8 E:A,¢ of ~ "BiB the cardidale bey . e No'o} super keys. 24- IG, - f @ RAROEF) FOLA-se, cad, EF} > (neey"= (aacdep) a vt , > (ce): {aiaee cent F] > ‘Ace inthe ce and 23s SEK axepas oe © & fecn, Fo- {ae —>c0,0>A} 2 (n)T (ABE5) > now (OE fe} Now (AB) (AG c,d) (cay (¢,2) * Band (0A) ane. candidede Heys (0)"= Coi,A, 0) i op! COM BIDOTE Key -2 16. Exam pies R= (Aecp) Fo= fasser {C7A, v8} Now, at. Sa} Two allvibde Keys: (ABE CARED) ~ ; (Ac)*> (Ac) 5 w.f\o] (apt: (anec)— f. CBed*= (Behn) - .. Ye (@0)*- (oO) = AB,AD, i u (ae (copay Bc, pare ckis ck ore: AB, AD, Be, cD. EXAMPLES ON CANDIDATE KEYS - 3 edo. R= peb EF) FOS {are CD, OE (EF p34} how, Bt.fe} > @b)"= CABCCE F) > €8)= CAecoe f) _ CK = GB) €P) (08) (ERR + (De)". (ARcdEF) = Bets > €B)> cavener) re > G8)" @BcvEp) [3. CANDIDATE KEY- Exanrpce - 4 R= ARSE) FD= {aesc, cp, DEG, Esp, FA} “Now, | Now | Now, Now), jat oa By: GBeve ABEF) x }a =8 : rx ct -©pe€epay (Ae): ep) Apex pt -(@EBFAC- 2 €1 -Efa OF)? MP) Ae FA rye EFA j y (Bey = GepAcn) ~ vi (8F)'=(BFAcDE) Cand ‘0 aie candidate Heys AB and BE, BF axe Candidate Heya. mples a= Are, OEF | ae ‘ _aeeeeD a7 BODE F oe? AEF wp 7 pow Now, ate ABCDEF)~ (c)'= AgcoEF pte) * ee ches (bep)"- (OEFABC) Oreaan pte x = to. ExAMPLE CN CANDIDATE KEYG lp: EXAMPLE p CABCEE) - ee fa 3B ,B>6, cp, P74} Now, Now, (ey: fe] (EY = (ecoAy~ (ce) = (cepar)— (DE)* = EAC) ~ (e)'= (AERO) No-of ckis = 4 ZL EXAMPLE On CANDIDATE KEy-7 4 ROBE) Now, Gare At= Aecne)~ SOME 7 —) @'- Ep Ep eieice St= p E*-(Gaecn)~ a (Po. (aecoe) ~ 0) = 6D) (eb) "= CAecpE)/ CkRane AE, Be, cd |The Ck'8 one : AE,BE,CE DE / FoR SUB RELATION - ExAmple-( Now, Given Relation R(Gen) (e@d"- & (Go)'- an a aod idate Key 8 (€o)t= 23. CANDI Date KEY FoR SUG RELATION R(aecoer) hols: faeces, app (C30, D>E. EF, ED} Pind cardidate eye fon P(ORF). Given Sub Rdahon 8, Corr) t a eS (8 4 Tre cardidate Heys ane QE ET =febr} of ={F} ' an CeNDIDATE keys Far SUS RELATION - Exaile $ } | R (ABcoe) ! FOS FA Ge cose 60, € =A} what are the candidate Keays of R\CArce) $ wen Aut Relation R (Ace) t Y= ABE DE Po ‘ pe = PLA Bo * One toleuse ) Carclidate Heys a7, DF Cb mot Intake) AE, Be CKING ADDITIONAL pols - E- einen the Aemantiog of the Polabate we Can derive mare purcticnal Depenclencies for the existing poe by applying Soyerence Rules . p(AB) and the functional dependences ade fe tet eA \ Xe SNOOP Linctional dependencies ome 4.%4= (6 o> IK p > & | aga «AB The Too} “eldltHoras ps posatbe one Gleng with quen Fs AB Bop $e AD “B39 Ae : XA AA “B3A Aga ' } } 4628 “A>B “898 *B>B = Bl tpn} pepeoree fos ese *P2AB vAsSAB ~B>AB BAS ee eae alee —— The NO-o} FOIA possible Onthe table ane(v) '3 i Nes H CHECKING ¢o TIONAL pols- Example 2 Rec) MLAB Bc} mei vy 4 hy eH NK = BxB= 64 Fr Pq Cooly one Fp posstble with 5) = tp A taec}~ § pis ane possible with Lilx ~at becuase AT {Apc} 2 Sr Be} = 4 Fpl coe posible wlth Lip beaiaze Bt. {ec} 2” 9 one > Zep ae powble with LYs2¢) becuase C= ee oe farc}-efD Ae acy ec}= apple ‘(saat | tte Valid: fds, , + i yt > {ee} = 4 +60 Ter fave ]- era . EW Rt 4243 tUe BLO 2. GATE 1705 QvESTION ON ADDITIONAL FOS Tha schema ith athibules AiB<,D anclE, felicunt rg 2d of FDR a GNM AB, ASC COE ,B>D/E A which ¢] the fotowing PO ip NOV Implied by above sel? ] A)CO— AC + Ue ED->CcD A fl ©) BCD fi Now, Co) fepenane} 2eD")= (a) ~ porate dS) fc —> Be GY Len} - Nor posciece eo: foeve af ten % mv @c)t ae eo ef - Cis possible 3 EQuAlence of Ep's Fi fase Acad ,EA0-€ >} h| Gi fAScD, Fan} cae both dhe finctionad dependencies Kqpaiveled ol pat check iF covers G) ie how to Check 8 take cach FO in the Ad Gl and find wether Wi dovivasse from Piernal fed pow check G2P, tore cach en o'r and check spit isola Implied in G! Ornot Now, F326 Now. G- fasco-E San} , v - Covenechby Coxced by F 2a E re 7ai'9 WOR rd SSF 4! ACAD Eso, je F pea oe E>} check whethentheneamederi vale fer'p ae facioh 7. aU 4he Gochoral dependencies in Fane | | wr {acint Coxered by S , ny ©): {ena} Both the Fok ‘Pland Gi one Equivolknt- | Js exemple | a EQUIVALENCE OF fos Exem ple 2 FELARBBC,C>0} cheek whether thexettwo pile aoie Egualed or &: [A> Bc, capt rdf F26 > Take Each FDo} Gand check whether it 12 dem vale fiom’ - 2 Aa = Nowtake AT fam pl and check BETA present! ‘ Inet Ae fa a eo} = Asee hads = Cap 9% ct. Spc} Shade 2. F DG Da 0 = | > The Fos Of F oe 498, Be, cp check if they.ane i Covened by Genet To: AY = fainc] fA ap hada} Bt. fe} for. ta md covered by Gi} GDF Cott the farctional dependencies core mot Equi vatut | | | | ): Eaul NPLENCE Of Two gOS ExAmpie-2 Fi {458 Abc , nA DE} I> Fz fae, Bsc, cA} Gt fA sec, 0Ae} e Gi TA 0c, Ban, cA} SF 2G > At ing: Grech - ec a 7 OTin F = Fo, enc} . 7 i Gio vat ine: fai} AaB 4 i i =) (aay fare.ch ABoc— iG > ot {n.8,0} Oe Acie ODF I > ot. £a1B,<, 0} DEX ’ a 7. These tuo FD!5 one rot Equi valent ; FRG = Aling- {aac} A->ac ~ i => Bling = faa} GaA buds | poe BD rer fang cmt mt i P ORF FS now ating: frac ssa NOW, BT tot: {Rac} Boer > WERE GER apes fe Sean} Cap holds ‘ 0 Bethe the itech oral dependencies are ful valent. | SI. MINIMAL CONER Tf we have aset of fanctioncd Crperdencie sp’ andi, we could minimise TE tb ctr Ad of funcional depencercien GF FU that 'G! coves F' ard “fF coven G' and Gis minimal, then Gi called Mima) coven oF! fo FIND. A epee To Eine MINimpL Sep sph the POS rach tral RIS conaln Single attribute. far APPL ASREA Ic Sata c une find the Reckindant POR and delete them ferry the pete | & (478,8¢, 4c} > {498 aoc] 3 Fird the Reckindant attibules on Lis and delle them Gx: ABC, A-can ke deleted if B' contains “A! &) > B>C B canbe deteted iP at contains ‘BI => ADE Minimize [ASC AC —=>0,£ AD, EH} 0 pate ACa7 Oy EA, [> Wis pmdudin uncleat (Remeve/delete ‘his production and thy to find Et In the Rematoing th IL comlaing, 'D! then” Eb" 16 Redundant PD: et Tre Me Dp D>" Esp" 8 Redunclart. | Mase, Acad, FAD, EH This ust be Redundant if ct contains at en fet ey e This ust! be Redundant if A* Contains c then, at fac} 2 ACSD ketones ASD ASC, A>D/E SA EH Ep } => A>cp, ES AH | Se Minimar coveR ExAmple-4 Mininiae fase, cB, 0 AGE, Ac =o} © 4>8 csp pra DSR pec ACD Seo, Redundant pt fora,.o} BAB kdenivabe Ac>D IB not Redundant et SEL OS So face} @s Now AcSp canke deleled ff A! conatngc 64) Cleontatnsg >B, C58, DFA, 0S, ACD Now, ALLA, G ) 1) am Ac>D cannot bedeleled. ct fev} 33. GATE-2ol3 ON MINIMAL CovER Te LAs sc, poe, cc} it te, mini) coven of [ABI DE, Mog 7 Ect Bo} Fp Awec | DE ABR—>E Ec a , 407 Laic.c} . The canncthe cle) =) a5 Minienal set Afese DSe,ESE} not He Minimal Coven, The mimal cover “ be {pe AGE /E act 34. LOSSLESS PEComposiT iiss | Mainly Nomalisalion 1s aba spitting the tables © decomposing By the tables , 40 while decom faring ux Should, see Zome proper One Auch proparity iA" Lossiess decomposition! = uhen we decrpose a Reletion ux should Check. that there iA a Comman atlvibute In batho thern , if not check wwhad happend 10 below example. a ay ae a aod 2 Sots patducd B we anole ; 21 bi re fae, 2b, ¢, fa, b nag Spurioos Tuples. ABC las 4B BC a, b, ie LOSLLSS DLComposiTION Aa = , | > The decemposttion ts | ay, Gy, i | ay Bag Loreles ewhen the Common Mal Gs Ss altxibute 1 “ey to one | ee Of, the beuckes-(arg or B06) erro AU Li ¢ (RoR, J *) (Bink) = Rte.) The S c } 2 [ : Ide akeyin ary 7 4 dhe wedalion (RnR) AeA akfirb) da? Ps ——s ReaieD i preserving)” Bp rRESEAM f Now, Saiep cain) Poster to7 mean, n fo (Fur) = 4 et A bs => The cepen dency pesoving Ww nota mrardatory ie SE DECOM posiTioN— Example 4 R@e<) . FO: fA>8, Bsc ,caAt R(Ae) R (Ce), => Now we need to check the lossicas decompo zitfon arc} Gas . presen vation ' — ete AGO © Tia decomposition is lateless beasare +the fomman variable th RR =B and ‘Bisa “a a] attyibute fo Rec) {->e sc}, Now, R,CAB) R,(Bc) Z 7 Bsc 4-8 | are the Non- tei vic) Dependencies . Gan ghar —— Nowanvivead et. {eca}] G2 Dependencies et: fea} (cae i eee: co ; = ASB BIA Adc ae : : und, ~ ARB Bsze cA ie i 78 The decorn potion ia loscleas ard Dependency presen vi EEO B>6,C>b, DA) a Rea, KEW Nod 9: (AB, 86,9) | ofoe bm 4 Dz (ane ae Be. a Given OF RE 16D) (am) b= (ae c ur oN ess Lost ut SS (arc) (cOR not Fal (a ebase presowed) fe The Decomposition ta Loslesé and) new ~ FD [ae a. DE ci STIGN Example 4 ’ See OR eRe R (ABCDEG) | FEL AB—< , ACB ADE Bp cf, E 3G} D: (ABC, ABE -FG) AGCDE EG) tow ABT -faB,c,0,, Now, Efe ag} *. ABSc 1% posse > The decomposition iA loseless 8, (AGOE) REG) raecom portion ta lone ar “and Depercensy rae ‘ oMposmrion Example 5 » “cor! Fue ee oon) R, i (OE). CDE , DE) He (rcp) (be) ecto AecD k, (DE) pre OE” 5 2B De p2pr | E 0X et fe) (G)>P- “. polg- A>eed ye e> ‘ how Ats ARCPE D aoe + Bc 30 BB s DE ct CDE bie pe (Bc)'= Peve | (Bp)'= BE | (€p)"= coe (By! i sf Sux pot Includebecuase ‘A’ Haelly Pye jenive every @)t AB, AC; AD wil deaive atl Attributes Go)! Ahir vious! ) thing the Obviously | are) they wil) become SKA. “The decomposition Lose ss and) dependency presenving. ale R(ABCDEG) ee a SA, ERG} Fh Aesc, ace, ADE ‘BAD, Be > (48,2, Anpe, EG) & ~B Be AGDE EG) ee s/ ABE Neo BI feo} Bis not the Heyoh AC 2 The decompo sHion 18 Lossy decorn postion 42. FIRST NoRmAL FORM The process of Removing the Redlands ip Nowmali zation pa ai fee =7 000 uttimole aim ts to Reduce ata toPeNE tt, hot by the ime yee convent the table Toto Rone focre one S) be any Redunchrey (Redindores. Oo”) (> INF > INF aN tenp 18 Known | | => 1NE 7axyh hed the table has to be Flat. = By dlefaut Eveny Relational Nalarawe en ae . tin Firat Nowmod fam Hivaluec and Comporite valicraste allowed in ANF . OND NORMAL FORM INTRODUCTION pit wp assume Ce have a table having attibules ACC and jhe functional dependenctes thay ane aliawJose ABI /B5C ano, ABC AEA Bc Ble Bc | WIth one allaibule, Key ia nol posate Gis & Ry with 2 atti bwes GE (ave) .. @nyhos the copacily to become Cardlidade Hey now, AR > pay albal AP, (Comstnation) Can delemine ce Bocts gs ay that BC dixeif can detewnine'¢ UrQucly '> The 2np ays that if your cardidate key ie cantal ning moethan cre ott bute then a pool of the dey Ahould rot determine anything ehe- > 2Np 18 bated on fall Functor Dependency a pootiol cependeney ielourd Apor of the x clelenmines Ome thing) This tabe iz Nok WwW 2Np beaunse thee 18 potted dependency (Bc) in the cardidale Key (839) 7O ux should -liminak: Fextal Fay | frontal deperdterey a Ape Z a] FE] —» Bt Be JP [BacAk tt toncleae areas ce Ea RBC Rat | FD preserving. R@ecp) = Po: f4asc, gop} whol fk He highes Nowenal foun Aliated? > By defpudt Brow Relodion si) be fn INF : => Now find ali the candicde Keys ALA BE GD 2. AB) 18 the candidal: her 43% ABCD Now, the thee altri bute Candidate Kuyp core. possible and they should not contain (AB) ih they Include then twill become epee: (ac! = (Aco) (eco) (acpy (Ae) > aeco E50 ys prottial Pxperdeney Now, find ata me ED RBep) ps R (ancn) SS woh Ba a* 5 Rien) RGD) JZ Rerpalng ue inserted sothad we shod} A] : + have fome Common pou ABJc 8D FD preserving too él Loskss decomposition » lies NF ExAmpte 2 ve paw COEPaNT RD) ABC BoE EF candidate Kay= ABO: AD GH Avi (Avo) (aecoe rans) Wot eres AD > Gill ‘ a eae pooitiol Dependene ABVC New, find ai the closes of cil paaticd Dependencies (find clorarca oh left hand Aide) and by to acate a new table by tacing aunoyy All the altsibubes which ose deermined by Auch dependencies Gey" Cavey (es) (ence) ANT 06,05) Rado Ef Gus) R@ Bdoe -) RAG Abe ath ied ERE oo ATT RRR Oe N27 AY (4,5) oe | ae PA AST 46 2NE Example 3 R(agepe 5 Fila | Candidate Key = (AC) BBE cp} ig ua portal clepenclencies amie AB c>D Now, at {Ace} ct fe,o} Asn RA Pe of) ie sees gin ore eal \ noo, if He cantidale key foro fabe Isa Alpgle allat bale Hhol is the only candidate +ey then the Relation iS In and NE, $9. THIRO NORMAL FoRM INTRODUCTION SNF2 NO Transitive Depenclencios Transitive Dependency: Non foie allsibute Transitively ckrencing Nhe ye ‘ 4 Ree) 1 Fo: [a 56 Bc} eK: {A} > No poovad bependenc ire. | rowee Cardidak { bey | “patme allsibute The allvibale uchich f8 2 pot gh flon- prime atttbale! The all sitube whichis Nota port of the bey. ne Candidale A>B Some Ga Transitive Dependency Now, Bt {ec} e (aBé) al ie Ge iesenion Be Az Leskas Necam por Hon 48. SNF Exempe 4 R(Aec DE) ro-fagse ,B>p, 08 } ck= AB) now. peouial depen dercies ane BoD = {2,0} RIA we oe) Ab-9e pe is the Panattive Dependency retent th table gop | 2 Nag Dt fret rR (B02) Ee PH ASA a BP NE AB =< 44. 3NF EXAMPLE 2 R(ARC) po: {AB><, c=at Now, Candidale bey = (B)= KO Now 7 {5} ; (Ap) + {AbCh~ = candidole Keys (ecyt {aca} oc eo (ap) @) | + Alladie Primcattst oes VY OV ENE cre fpotal deperdency= posite-Key > Non prime altsbule | 1 > pitme alistbue pelos ime alttule C frie ols bute Hoe Cra ie nol poottial clependeney he curate a 2 \eSq) % rot fortial dependency Ea ROGCDEP) ck: ABC A—=>D = portal dependency. The en ABC ‘ Note Boc tial dependencies Sntihe Ghee dale there eneuno poortial cpendencics pea 18 ny Be Sane tive cepencteney g Non bitme altibwe > Nonprime oltathwes 4 : f a Reo Pre — * Seabee 2} Non ptm Alby bal: =aleals | attatbules _ DOE Rare pe F) > Ep eee } Tanai tive Dependencies Boc “ee Prot Tranathve dependency 7-The above Reblion cloernot contain Tanzilive dependency ©) wt. The Relation tin NF SO: FORMEL OE FINITION or \ A Retdiom) schema

isin 2NF only cveny Non Leivial FD xy 7 | eTthey yx f oy ». hich : a the following iS albwef in BNF f , © 2) proper subse o} wa Aupotey % ¥ iS a patwealtvibute Cle > Neon prime Charkal dependency ) ©) Non- prime 5 Aon- Ma C Rensitivye drperde ney) ) Proper scrlact ayo +Nonprime > Nonprtme Giacaltve dependeney) AY Popes Fabs cb Ob CK = proper Auosel of Sthenan Gree pop) val { yen cord: dade Bed= (aay Cawsey ’ ) now @8)> (ABECDE).”. @p) 18 the candidade hey . Now, A>FC eters the postal dependencter won A fat Bt foe hoo , 88. Geng Example’ @) Rate) FLaasd 6} i > The candidale Hey. A ye (Add) at fat ~ @By- fac} (AB) Cac) ane candidate Keys > MRe ; C- faeny Coe Prime cttt hubs, 1 + 6. Thene ante partial dependencies in the table | a t rs Hc. Th 4ae ts In BNp beatase the Cardidal tay Conaing an f Ahe allsibutes (All the atibles in the Rebstion are fame | al tribe) ' Now, Acc to the CONF the Lis shoddbe Superboy > ap)" frre} S c fc 6} Nol eipenten > Nee : ‘ ' Now), Age va Losieas Decom > Ac ce g FO +a maa cop a im (ost) 54. Bene Exam pte iL R Benes Guts) F:Gesc, Adve, BF, FOGH, bo73) carclidale bey= CABO (ancbe Ex 79) | Now. GB)" GBC PGHDTTE) SAB ame only te prime attsbue? RG@ocpepGuT gs) : ae R@orts) aR (Ban) R(ABe) > No POs => en A> DE Bop ABC ing anh ae a TD TD (ree) AB Ac re Be oe wom) (6A) (Fe4) Tn BNF GG) Aspe pSty Oop FosH | STe check BONE definition every LHS ofthe depen denery afpticable | Pa tele should be a Siperitey, 2 The Relations thal cue gt wre ' } RCAor) | eg, (ora) 8 (OF) RC pou) | Rsaee) A>DE D>2>Ty BaF |) poan | AB2c Benp | Lape} ] o fous} Bi feel pt Frou! At fase} | A=sk O=Sk Bese Fé ABE Sk oe @rdi date toy - C aa (aneSE fans 3) Bee G8) (Age DEP alias)_an) cence ay Sn. Bore prlme AtebulerA > At Jraura} B* fener} Poo Gop, isthe postal dependency >et fenery ui A>2GH Bap 1s post be , Now, (bebe fan 13) 4 Gooch) |G curs) | RGEC? (and PD RCABCOEP Git a) AGH . PREP A>GH G>D ABZC GS Gt yp | Now, ee AB>< fas Qs) (4anr) SEF BO Wty Asm Dorp BSD = The tables ane 9) W153 AGT 3) DE F mein BONE 4) @o s)AaC 86. BENF Example 4+ Aialis. D R(acce) FO= {ABE , B35} Candidate Hey (48)2 (ands) UE {CABcD} Ga) 18 the condistale tay d Nous, There ade no pantial dependencie, Now, PBCSD isthe Tranihve deperceney , Be in Nola Supa hey ABCD Bcb Aec | Mp and Bene Besp 4B 53 BENE Examples a A R(mBcr) FD'fa>8, cp} ce: fac] Vase pine edt bales ABCD “poi deperchny: oe e320 [row at fae} °o En ay on c™- fe,0} AB ] np (ASB BENE ExAmple -¢ _— —— - “R:GBPL PT) Prof pop 7 SL Aso} Garclidale hey= CARY: Caupipt) >). Geer, {eK=a5 ‘4 B—>pT | pt (pad ADD ere po, pai! Dependencies = R(ABotpT) forms RCAD) REPL RAB) ASD B>pT Se vst) , sk ree 3. BENE Exarmetf 3 Rérecre) — Fofa sec ,co-3E, Rap £7] Carch date Hey = Gaur, co, Re} All the ttibules ane frtme ‘ => SNE ‘ PESTO check wheihen the Relation % tn BENE check the Sandieral, Orendercies ard find whether the LIE 18 a Buper Key er not Ampe > at. (agcoE) >A is Sk — P5E Ss Kc0)T peas)? COIs pocce es 2 (B)4 (8,0) => Nal Sk nn hare 2 ©) (e,n,Qap)= FIRS Bop A>Be EA ABCE B=p Asie FeNE E> A0c 4 Pic SAE S) BNF Examples- pratt AND 62- PARI? Recep) tofrasc > DA} > candidate Key {ar} Foor 2. @e®)L0R ax candidate toys. I> priral dependencies are Absent - Therhore the relation 721 2Np % Nansitive depencleneler adie notthene ord ‘p' 7% not Aare All proeaie P Ter RENE the Lite shold alinys bea Zupen bey,and hee ‘Dia wot Super Key Innsn Ptfpat Aco loaders Detempo sition DA BD PaBIaNGe (GB) Cac’ - cacy ' Ronp (2 ae ae (B09. (epnc) > BD Sc Moles) Or On ay nyt. Goa) Now, find if ABSco ts frtaved uxteg pa and bo3c, F > @A)™ (aa) ABSco is val prevewed. 4 Sie ve 1 Depeadeneay presaving failed. Example dy fase, BaA,B><, ca} (tae)) Bar hs y= “Ge Dees) - poe) At. fa pep} et | aodidets diye See ot ent nx Dd. fo} how Bare pime allbibiles + Now, pasta) dependencienore nol press Conly Srgie on cke Now fer 3NF check the tis, LHS mut be o Aaper Key ov dhe Ris Ahould be a fate alistbule to (SO) Voe'a F Not Sic Nok prime Now, cb fev} atts bute i R(ARcr) f ais 4 R,CeD) | R (ABE) loss aud 1P Preserving | * A>B~ E50] «a pana seend Ben . Np Gatinia) SF BSC pe es Bene AND 65. PART- 2 &. BNF - ExAMpLE 10 pert 4 AND 6S P. 2 R(agepe) Foi fas 2c, ¢30,07F ea} wi ron Candidate ey= ( yt, (ABtBe) vi tel Nee ae): [asene] An the attebulet (e)"- foc0,c,a} are pre atin @)* Sere nc} | ap isin 3NE (8). foe,n,c Dh eel ¢ a ae For Benp, very Lie of the functional Dependency abcul pained Q . AB->e -y AB(SK) | Beh Now, ct (eneA) DE (coco uot sic's 3 Esa ABceE i i. ar | (oe A) €9)) -» adding & ( § a >» ; por [cop ABC) tone Not ak Creve (CKECbef) MED fe, No commonattstls lossy de composition Now, R, CAB) R, (ep) at. (A.B) cD). & (2) Be, ; Fes Saki ae | a [ro =e oy Depenclency preserving, 1a e Y bee siy ee fon R wdith an amocialed sd of (0% (FI 18 deccmpored inlay BCNE - The Pacandlansy Cootsing ow of farctionnd dependencis) inthe Seats Al | Rekions is. P Zero Bene = ©% Redline ies) }) More than Zeno bid less than Of BNF decernpo8s ten ©) Proportional to the ste oh F* + Sddewri nate 61. GATE Question ON NORMAL SATION 2 Gare os eer ycne: Ae the Feteroing slalerenté abou) Normal forms %& False? M)CCNF is Sbider than Sup (Left hand Side Should be GSK in Benp) CTRUE) &) losees, FO presen Ming into NF ts alusays porslble (Puc) oY lolesn, 6 w 4 BONE « “ "(We Cannot GuaARUDi) | A) Any Rebation with 2 atlvbubea ein BENE. (tpuc) Lis = Key (SK) | Rls = Gales Geos A tobe tax fide fy) fF, Fs Fa Fg OMA the faticxeing funcional dependendes poe, , Hon Tig fg hal isthe NE oh the Relation? YING b) 2NF ©) 3NP d) None ae Now, — Cardiclale wey. CAR Cr, f ae) + Gaye Grats Fy fi) Fi WY Cantideb Ki, \ | q \ Ni en (O.9, Bs para) epenctenclea ae preset o 2NE% [oh Now, LHS shod be Rupe fo Th ave SKA Hug fr ang => Fj =3NE a qe a sagven h Abe tleeolg ik Tue! boy adedicn in BNF TS abo In gene (NA aluccy 2) Big ten RUMAIN BNF ih every non “prime atts tule fe! on _fanch onarigy depended on every fs ope Ki DEEN oly dation in BENE i& th 3Np aD Sead J) NO Relalion can be tn bob Rene and 3p (FALse) 68 GATE: QUESTION ON NORMAL Seq ion 3 see ne) | Nae Ce Ln Garr -14 Apime attibube oLa relation acheme R18 an attribwe thalappaa a) Sh an candidate heya eh Wp rere Carstidate hey ope 9 Sn a foreign Key of d Oy io the pormeny. ey oh Re Gonsidey RGEC? Fo'faasc, e=a} Ahoothal Rig in ang bubrot Bene Now, Carel) cate Key Cae Cane) Cy Cataey (ce) (are) 4 a Je the velation Tain = SNE Allare pre atts bubex AB Ye { Not In BENE —A ‘notsk oy dae-43 Feb) , abcd contains atomic values (No cempotrte Ord tm Hivebe) Perforce bad} MING eaboctiong Now candidate heye (abyt @bed) b) ane babootingur, ©) IN 3NF ap ob bac d) None a TE QUESTIONS oN NORMALISATION 4 ay pe a GME -9q, teat R(stuv); post tu, vv, v>s} ord Le Ganda) ’ be adecomporition such that RNR #¢ . The deccmposttion thy &) Not in 2NF ck: Cs y= (stev) a ») Ty 2NP bd pot tn ang OE Guys) [ Allane Sh BNE bu notin ane vt= (uvst) fp Pim D2 eoth 2Ne and 3NF vt Custu) J? NFS Sip 4 ¥ J0-GeTE 200) Question ON BENE R@ecr) isa selediom. hich Of the lc does not have a = Jen pen dencay Preserving Cen clecompos Hon? AASB ,B-sc0 ‘ 5) a>p, Bsec>p WABsc, cA a) A Seep option: A—8, B>cn R(ARep) 2 ck- (A)* (akc) No ae) dependencies 2 2NE ~~ depency = @so) Aveo S vA ; Loses B Coan) Bep Ss popwed BecD Benp option By A>B ,B>¢ cap | + Tansitive ck peadenues 7 NO fuatial dependencies ek ABCD cK A (A= Aecp) —__________ BAB S>C | CSAP Nicks Gu) Cu) eae camael CAR A the pootlied Deda 6) B= \c/n,0} ApcD as CAD Bo Now, BT-G C>AD 2- coc “Al. GATE 2002 QUESTION Rakion R’ ts decomposed UFIng ase oh EDR F and Rekation S! ts decempored Using Another tel of pls Gi’. One decompesiion Ie tn BENE and other ig in SNF, bab TA not Anmon alich tacchich Te make quesenteccl identification ..ahich ene ofthe following testa Bhould be ed) on the clecem postions? 1 | @ Depenclency- prer eration =r Benp may rot have dependency preserving < me Hf b) losleae JOO > Beth have losless bob we on. eg we Tijeventiate then SECNE definition », Erasgh tp prove PCNF table ard othex cudomatially i eee (ibe aap SNF definition _, Not Enough) ONE canna! be identified 2. Gere 04 QUFSTION ON NORMALISATION at prels alo sil She The Rualion acheme —shident performance Game, caneno retinoGrade) | J PO the pop Name, couvse No eget Ra INO, Course NO > god. | Nanxe —? ell No. RallINo = name Me highest Pomel fren of tht Relation Acheme i 9 Np anp NF 4) 4NF ‘Candi dase Key no)". (eno) FoR a Eaar® Leh us assume, name-A — FalINo=< Aveas - RAR Dp CourseNo=B. qrade = Ly Axe » | am ea Now, candidate 4ey= ( BL Gincs) BB (AB) (Agen) Efe: L are cKs => (AB) ER) => prme aitribubes ae 8)"- Capen) ABC @e)*= (pe) Now, pottal dependencies ome Absent os. 2NE U NOD ZNp check | AB =Sk \ cB > Sk Axe SLR %! nok sk bub Ris ia prime ottribute SNE COA > Hs mot SK bw Rug ia prime atte S N&O, BONF Check SLs should be Super Keay = 4B=SK cB= SK Bene xX a A Nol Sk eget QUESTION on ON NORMALISATION Bion Empdt4 ts defined ud pelitiaihy coede Ona +e pinconde a Slreet, eth, Blake and) pincode Pee we only one ety ane ate N80, for ang Pincode, there is only ore chy and state - Also, for any given Peel city and alade there tm just one pincede -Jn Newralisation Jams Empdt4a tsa sidalion in a) ANF only SON © NE A) Gene =A Street Let empeode eet =C aaa Te AGcoe hame = B city = ee R(aecne F) Given Empode)is the cundidate Key > A> BEDEF ee DE ene > FE Nous "A! 1H the candlidate hey > No pastial dependencies ante resent > 2Np UT > Now, BNF check ,[UWA=Sk or Plis= prime ottwtade] F bE yume Not sic Nok prime 3np X 14. GATE 93 QUESTION Whidh one ch the following statement 1x Folbe? 3 adation with Lattrbues 16 tn BeNE ny dation with evo hey having only One ally bale 7% tn aNF th 3N 9 A Dime attitude Can be transi Hydy depen cent on “J ? cat GATE 3 Ame LISATION US: GATE 2008 QUESTION ON NO Considlen the Relation Ahernep of Librasy OF A 6 c p c i Pook Crile, Acthor pcetaley ro, publisher, yeco, price) 4 C Calechion (THe, ter Cabolay 90) wh the deperdenci en mB i- Tle Author —>cadaleyoo a. Tle, Author, purolisho, ye or GD. patisher, yrar title = price Assume Chuthor, Title) is the Ieey for both ache mas + whicheh the Pewing Blatements ane bue ? @D Cath Boek ancl collecHon ome tn BcnE 4) Beth Boot and Collection ane in 3Nf only 12 Pcok 15 in 2NF ard Colledionts ty 3Np 9) Beth Gok and collection ane in -NF only Bo: Book (ABCD Ef) Cadleckhon (4 Bc) colle dre Goo FoR AB=>c Now, (Bc) @ecber) Cc ABDE ABR => ABSe 4 DAE fF cm 4B £> ABDE | ( DAE >F) } Allaxe prime ie 3NF Collechon= BNF ATE (T-08 AND 201% QUESTION ON NORMALISATION functional dependencies are neu to had ABSCO/DE ps C3, fer He > 82S The Relahon aches “R’ ts tr BNE LINE bud incenp ©) 2NF budmotin anp PoNetin 2NF Now, Candidade -key- ¢ ~ayt (ABeD ERAS Noo (AP) @BCDEP&) .. Cis) isthe candidale oa Now, the functional Pependenves ane aoe DEP CE } Pansitive lepencten ay Pose @say pasta) dependency Pech in) 2NE 5S: RELATIONAL ALGEBRA 1) INT Ropu —- TION To RELATIONAL ALGEBRA Frey Cala made) 1% a aes prartsoo to Ton'ipulas, t sppore: pew ‘i pula the dalo. > Relotionadmrecle) p> Relational algebra C Imp for Gave) ea Relationa) Calurcutys how te quit) Relalicral calucalus is a declarative language Cchab woe E coant) => Relational Abela — cpevaltens CGsraliest Unite}, wen thaws can pepo on any Rebbion) | =e RA= REF Zale operations | TK 2 Pagjecton Gelecting columns) © : lection (releding Roux) et CRoss product (Beturen tuo table) (Cormbine ztaltes) | Relic) Ageia faa proceducal language (ots) ue can) § — + Minus (set di pherence) 2 > Reranne (tone Name + the allvitales) Relational Algebra Exrymeslont > Baqyuerce ae oprations > 0): Onterzection Ana, = p-(a-2) eh) a8 = Pt: Tin (a x¢ ») (oy using Cron, preduch we can Wok On more tuples Alma) tanec ) UV: Union (same as onion EY onda) 72 Tvisten (Hx, -) j

You might also like