0% found this document useful (0 votes)
64 views21 pages

Unit-3 DBMS Notes

Uploaded by

archit kushwah
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
0% found this document useful (0 votes)
64 views21 pages

Unit-3 DBMS Notes

Uploaded by

archit kushwah
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
You are on page 1/ 21
4) , Ledute Meo “4 Functional Debenden ue + The functional dependengy cu a gebhonship tot exists exists behoern eo behween -keo uimibufes. St typical D puimnary Key and non. key Fitsibule within a table x7 xX dr known a6 delesmninant- Y va Known 04 dependent - we cn qeat > i mi dependant on oe ID on arniquely idontifies 420 Name - + “pes of Functional dependent i iy Taivial FD i non- triviol FD Taivial funchonal debenden i A—>B bos trivial functional dependoncy ip QB wea dubsek of A- @—- A>A 4, B>@ gn +toble Emphyee, {ID, tame} —> rd | ab vi taiviol Fa beowe TD ws subset of f TD, Name} Non- trivial functional Dependency + 5 @ wh a non- trivial FD ih B dt not a subset of 4 aon A—>R W Ccolled OS Complete Non-taiviel Fo. “A 2 when ANB w Noll, Ex- Ip—» Name Name —> Do@ “Lnhere noo Rule (38) + the Aaumelvongt aniems aig “eS hag t Lis used te Conclude functional depend delational database - ¢ The functional dependencies has ga tyret sh Sajere nee Sule Ie Reflexive Rule_t— ahlexive i i 3 ait Qn the geflerive sade 1B yaa hoe x ddesmines 7 A“ 1 Er ye fa bicdied Yeo $aibich 4._ Augmentation Rule == Lge ub Giles 2 Tal dependency - 3° augmentation » iy * dereamines Yo dihen Kz detesmines ya fer ony 2 ~ Example - Fon R (ABCD) » ip AS dton AC? BC 3. Transitive Rule i= gn Hos Sule» ig x determines yard y dateimine z eon x mut glo deleamine 2° ip xy and Y 7 2- eon XZ 4. Union Rule s— Gt Soys, if x detesmines et aot delesmine Y and z- y ard x determines Z, Hen % 5 Decomposition Rule + gt us He sevene of union gt Ga known as jule SE Says, ig X determines y and 2, ten * determines Y and * delermines 2 separately 6 Pseudo tuonsitive Rule — gn ted, ig x detesmines ¥ and YZ dateamines W, ahon Xz debsminet W- Total _and_fastiol Functional Dependency v DP Resliq) Functional dependency _?— Fastial dependensy occun Uahen 0% prime abtwibule OF pee oe gabset of 40h @—> DE Btol Functonal dependency i— —— nad _clepenc . ga any gtelabon, thene exists Ful FDS between ony 4wo odtvibutes * ard Y» when x fun cti orally dependent on Yard we not sppenctionally dopendost on any proper gubsel- of Y- a lAreicr Dre FD ~ » ABC — DF B— DF II otal FDS became Yeon J no Aubset oh &- s Aec > >F yy Totol PO's ce PF Pasbal F0's t — PF Lectuie no - 24> NORMALIZATION 2s » data in Ae dlatnkese 2 ge us tee process of organizing “ao 4eo sredunconey foro « Nosmatizalion J! ued fo minimize salatione ot aso ed ‘on, upiate and ddebon a swlation on det aundesivable chonatkanistics ike ingeahon » anomalies = 3 divides +0 0% able into 122 galler. able and links therm wang adakonship : Anomalies in OMS #— ; There 09 por ob anomalies bok coum when 722 ‘ dolabose 4 not amazed | updole gnomaly t— gn ~eo abous table, We haus vere grows of employee Rick os he belongs +0 a qnerttt of “es Corrpand- gp we want to "Gate Ha oddvess of, Rick then we to ale the game mot om Jeo aota wil beome inconsistent mn poo “Tnsexk romaly 7 suppose & 7? employee joins 4% company » Oho din under, trainin and as would! cwsentty not assigned to and depastenret: eon not be Gble to intel te gta into “tha table if ep - dept field deer aot ollocs rule. uo Delele anornaly :— i. ate: Ff oF O point of time +29 Conan spond as cbse ho depastment DEGo Zon delelin tae d v0 eS, ing emp. debt 04 “Dégo could G10 delle of employee Maggie gince she IS assigned ony to “Ris depatknent « Hew, aro Bo most Commo used nonmal -fonms :— IS rut nowral for C4 NED 5) Setond nonrral forwn (2 NAD wy Thind nonmal forern (3 NE) ivy Boyce ke codd rowral Burn (BCH) Fingt Nowreal fon i— ane ip it tontains an atomic value - o table Ganot hold mulhple © A Sdakion it be © gt dtakes tok an adtnibule of Values. St must hold only single - valued attnibute - © Gt ditallows te maulfi- valued odfibue » Composite oftta bute. 4 Bait, Combinahons Employee . enp-id | emp.nome | emp. Phone emp. stoke | 14 John 72 42826385 , ue 9064 +38238 20 | Hasoy 574783832 | Gihor : 12 Sam 4390342389 858383 0302. Panis 3 i vot in 1 NF hecue of Hulti-valued altibute emp Phone. The decomposition of ae Emplyee table into 1NF hog been shown below > 4272026385 $06 44282 38 544-78 3832 390 32 389 8589830302, Berord Notmol for (2 NE) i gdahoral must be in ANF. attsibules 04% +n qeo SNF gn tes Sond TOW | atl non ke uly functional deperdont- gn Ho forernas keg Be fats augue, 0 hel On SoHE yea dato, of feather 7- bh x He ox 5 yu i ibinte pe, each elornent ob oh waaale Key 2° 3NF vy used to +o athieus #0 dota eso Su no tyons\ gee _seail Example - Enable in obow table ap, Heme , 21b3 5 _- 46 07. supa Hey fay, [EPinane’d , Candidate key - 2203 non- prime lind bules — gn +e given able, ay absibuler except ED ate non- prime - . Heo, Shoe & ely dependent on zip and Zip doperdont on Ib. Tho non- prime alteubules (stale, city) transi tively doperdsnt on Suber key (ED) > gt vielatg to Sule 8 anf: Trot's why we need to mow “es city & State to Bo neo zip table with zip a3 O prmasy ley. Emplyee table aololo 02228 6@m0F- Boyce Codd nlosmnal Form (S6NF) apogee gd gt shaicke® an 2 AF nog 3nF- x ot + OR va Advance versio 2A toble ts in gene FR vey Fp XY" Auber key of +e Asble - oe Ton Ben, “te table should be in BNF 903 fom enery FD, tig 3 Spe eg ume Haro vi O Compon: wher employees Example - toh 's as wok In moto than one dopoatment gn tte abow table, FD os fellas + Emp. id —~ emp- Country emp. dept —> Y deph type, emp -THt- lo (an didole bey * Sem id, emp. depth 4oble us not fn BcNF beawe neither, Emp-Det “The noh Emp-id alone ase Ke To convert “+00 gion table ‘into Bene , wo decompose it into swe -tobles > Emp. Coun table , 3 Emp-Dept table 2 bmp. @ebt. Mapping table Emp. Gsuvtag table X\ LEmp- Dept | Emp. Dept No Datignig | D394 33 CC~™” UN | Terhay D394 300, | Shot D283 32 nv Develsping] D2Ea y FD's ave Emp_ id — Emb tountoay Emp Dept ~> § dept type » Emp Dept. no 4 tondidsle hay t= oa ish table Emp- id fi, am table > Eenp- Tept- fh gM date 4 CE bid Eonpo- Pebty peo, +a Jt in BSNF bewure lef Sida frit op both Ro F's ane Ke a Lceluse No-26 Fousrth Nohral form (4NED ein 4HE th ik Ge in GenF and hog © A salalion -uulll bi no multi-valued “pendeng + fon a dependency A —>8 ip fen a Single value of A, wmultple values of 8 jes salahon 4! be mul - valued dapendinty exists, Tr Ex' - a gtudect ‘ Dancing ‘ Singing arcing coricleel crie given Stilent, date ee bap Heo Counse and Hobby ase 20 independent entity » Hence, cea Ht nD salafionship behoeon (use Gad Hob ; gn tte Student tables o ahudert With 4 ji , compares ard Moth 9 cortoins +00 couuer, comP' oo = stu . A Si ing So “hol ies , Denc a 8 : dapenden q sind , which Jeads to wanecatoyy of ‘A data. anf, we Student- COuUe Dancing Singi 4 ‘Dancing couckel Hockey Skee ate : ‘ Leetuy slo - 24. 4 “Laclusion Dependency + Mulfivalued dependeney and Join dependency to quide database design although “Pay both Common Han Puncional — dapendencies - + Trctusion dependencies as ite Common They typitally Ahowo Aittle — influence 0” designing of Ye databose in which some. tan be used arp ters a dtalement « The — inthuion dependany Glumas oh @ selotion a fortained in otter columns: + The example of Tadusion dependency oa 0 Foweign Key - siedlahion wt Contained 10 nelaion , the sefesing key Column of tee gefersncd selahon 4m one tho primo fe we hove two salotions Asranslahing “two entity boty Su entity cy alto an § entity. « Tatuuion debendon twould be hapben . é its key asntiaser © td a selakion ur ontoined in tts gelation obtained by projecting on its key acted bules - + Qn Inetusion dependency athibutes Hot — paslicipate Inclusion dependency asa keg hored teak Rand § which od obtained th “teak eneny gw ip projechiny R on toe shoud not split gre ob fn an fncbaion dependency . 13m Practice, rnesk Li involved — only keyg - _Relalionod Decornbesition + when a gelation in ee Salahenal rode! su’ net in Appropriate normal form +2on tee decemposition ch Saloon Gi srequine + Sf ye selohon has no proper decomposition, Hen Mmay lead te problems like loss ob Tnforrnohon © Decomposition Js sted to Clieninole Some of He Phoblernt of bod design like anomolies , inconsistencies and sredundan + Types of decomposition — 3S lossley decomposition ~ 'D dopendeney Preserving Lossless decomposition s— « Sf tee InfpnroHon S41 net lost ram ee solokion thot? a decornposed , Hen te decomposition will be losslers. eo The lossless decomposition guonantees thak the Join of Sulakons auill Seautk in Heo Some galation ag it was decomsted - © The xeation di Said to be lossless decomposition if ” Joing of ot! Ae decomposition gis eo original swlahon employee _ Debontment’ © €xample - “Thin robles decornposed inky tno owlations - Employee & Department t+ -toble —Depostrrer Moaketigy Finance Produchon Testing how, when tae’ hos salalioni ase eine) on He fommon Gluenn 'Emp-id! Alen 469 Sesullant sealahions foo Vike Emplaiee _Depoakrment™ table - Hence , Ho decomposition ie loaslees fon decomfesition - Dependency Poererving 1 aaa ny oad Cute © 9b Gt an impoxtant Consboaat + Sn eo dependency presesvation , of leart on® decermposed table must antispy eussy dependency * Sf a selation R is decompased into Selahion Ay and Re , then +0 debendoncies Of R either must be a part of Rj Of Re o&% must be chsivable from the comb inahon Of FD's of Ri and Re. + Ex, Subpue Hare di a sulabon FD ger A> Be The melahonal R ds decomposed into Ri (ABC) ond Ra (AD) which ow dofendenyy oneseavia beaue FDR A—»aC R (A,B,¢,D) eth ~ Sia pak of sedation R)lN8d, Vv Teche 19-24 Lecline lo - 20 Multivolued Dependents + Multivalued dependency occut tohen “hee atthibules in table ase independent of exh othen bub, both depend on @ thind athubule. . Gt consists of blest tu0 atinibukes that ax dependent on a cthind athdbule . tal’s why it akoays rrequitres ot least Howe abtdbures - deoxe vt a bike monujacurer company Exampe- Suppose tahich— Produces oo colots ( white and black) ob goth model Nery Ye*- Here, Columns Color ond Manuf yeas one dependmt on Bike. Model ord Indebendext of each other - gn +eis (ose, shee oo columas can dependent on @ike_ Model - The be lled 08 aul fivalie below — Sreprosenttohion of eae dependencies dt howe Bike_ Model ——> Monuf_ gear Bike model —» Colon “This Gan be ead az “Gike- Model” mmuttidelenrnined Manuf yeu” and "Bike Hodel multidensnined * Colon” . bond oC Teeluae 9-3 Lest ro. st TOIN Dependency * le tables * 98 a table tan be srecheaked by Joining multipt and eath of eu dable howe a Aubset of the attributes of to table, tton +e table ut in doin dependency - Ha a qenoalization of Hult valued dependency + Toin dopendency Gan be seloled to SMF, Wheso, a dlahon si tn Snr, ig Hd alneady im 4 alk ond Ht connat be decomposed ~—fuathea - Example - Employee this table can be dewmposed into 42 following -teowr tables; Hrosefons it di not in SNF. Exnployee Skills EmpkyeeTob ' f = pur ‘Tein dependenty *— [Ceenome e.skins) , (Enlame, &- Sob), (e-skills, €. 50h) The above xdalions have Join defeadenay Trak would mean that ass nok in 5NE- salotion of Hee obows yeseo xelaHors ur equa) +o our omiginedd nelahon < Eon ployee >

You might also like