0% found this document useful (0 votes)
24 views

DBMS UNIT 2

The document discusses the relational data model, focusing on its structure, components, and key concepts such as relations, tuples, and keys. It explains the importance of primary and foreign keys in maintaining data integrity and outlines the use of relational algebra for querying data. Additionally, it touches on constraints and operations within relational databases to ensure accurate data management.

Uploaded by

alp14158
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)
24 views

DBMS UNIT 2

The document discusses the relational data model, focusing on its structure, components, and key concepts such as relations, tuples, and keys. It explains the importance of primary and foreign keys in maintaining data integrity and outlines the use of relational algebra for querying data. Additionally, it touches on constraints and operations within relational databases to ensure accurate data management.

Uploaded by

alp14158
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/ 38
* as , Re Relatinar Dea Mocul—7 — < 5 @ oe ; : 4 Basic Pefini Hons => The RDM prank Wn de porrn tables. “The .xelohimap .*\ t moc) ts based an mare meuticad thig Ong’. hos q Solid twarartcal. founclottie, The Rom Convicts q te Feito. S Component 2 ‘ 4 > Pai Shuctuve: Dota sor gonzedll tng ' rhe tables: calh .ixnws sctnd Olawng { (eomein, rape, eb butes , aie), ebarchentles , schtimas) ord ees.) : 22> para ma pulaHion. @o vo erdul Opert™ fewte de. SPL hangs) an Urtds sos mani puter, ora’ stored jm tHe vel. Quote). [D. para Tare grthy FactitHes ne 1 raciueol ea { Spe ty —_busfaess melts Heo - pot catee ¢ Integrt clouro. bene dhe 9 S t C Siege rare ih? Relational. Pala Relationayt Detta Model. Relating) model Conce pps > ~ The — velencu model represents yy be A A collection o} relations. a { an ) Re\oHon ca) mo clot termi nelogy +O rely | ts Ct Co OOoler f (Ss called ot tuple ; Column kh Cul rig cally j On day bute tte yg eae 18 Cotlad q a Welahon, Tho dl abo WY pe ots cn bin ft type g. Valter dno can appear In each COlUmn i wepresented by oy domain Possible aia For eoash At bUte thn is cu set 4 Permitted ice C3 eng fi Domain-? — So3 % citomic voles. ioe GS _con'+ pe further Divteto , or thor - ctowu' Verlures a ap VELL Avy dpe dometin sis the welout tency | MuUKod x fa Aevtece Hy pe f 2 aN wt. tlt! “oie che Holo they AG op — a ce ce eur prienrarton a ig a ae) G 0 Suppose R 13 0 YeloHon Schama and ] Ba, Po, Pn, are Ser Of CT BU bet Oa 2 schoma. then tise holtut ay Re lout, Scheing i] : 1S ROAs, Axny Po, & = An). =] > —— s. Atnoted ba He neon oni esi, nam Ls Follbuser, Cin pave nttuses ) by he saan re At betes jn thot 1)? fer es seould pave, $ EMPioyce if £ mp0, Name, Dept_Nomw,sal) Relatimal Keys = ; p Primary Key? wot mura ke Able fo Smee 5 anid peeve: crow chokalinsa rel®, > bexdion #. ) olodai voto ‘Stored _tristtnbur ont 4 To _tchapemes dis gece, Crary swt Brevis hove g Pk. fA eK jsiael re aes 9 idtntigies 2ach v0 ig Heer! Do Eme i erahans we £xp g fi mg Ep aaa |Foreiy = 2 _ Key =z O}ttn we! mus ve Present dry s2isip bel woo terhler eens «ths Is ps? = ACCom plishd Thro ygh the euse iF Forvedn keys, pe & ®Q_PK is an outhrt 4 ure (Possibly compose) | a in @ vel 4 DB. dred Server cer mrerpy = a : . “Cl anoney VOIP) NL thers Some DO, al ae d : a 0 I Comsicdtr the rel s Mp ond DEPAatMIN - oan b | j : : ‘ : neon bop a (Emp- -£D Mame, Dept >t Notwnes, Say) saa PBPARTMENIT (Oe ps —Name_ 5 “‘Locantent » Fax) . i PE ; s0s ) FA_attnbure Pept Name fs aq PK iin FP aan erry lows a sey pee clare, a2 any Emp iWin an opr. to whtth he/she Seen a A : CII yned, Some. aurmors emphaize. omy dw faut tthe an ort burt. 1 ae eke by tie wirg OQ --doshid wndoy biney Sup ias a vl! Erp i tC Cmp— 2D , name Fropeniies of Relation 2 Q). tusp ecilnun siomct) da nef au stables Ee ie . ree ics E veprenuled by stpavtkt 21% fe compose, ave or okpremuled” Wa. Air Limnu cen poll akibol (nik hone _folowtensd : eS? Boch D091 unipet jumon hwo. rows {na sel A ax idlinH cats: ; . tail Bap Loch. ott bure Cor Colu ran). salting Fable hos Ov UNG nome. ‘ 4 | Si Then geqaunce o columns (Lett ro-rigu!) instanigcanh, Th. Cotumh sort! Can be - inter charged co |Hwouwlk chow tig Hee P pata ors Lak the vel, Ne 6. TH Sequin te— oy vous. (dope bottom) | is dangnigé ant. As .colm cplumns , th ows ne 2) wey bt. intercharged Or stored Via t chotee | ones me become «Ake PRD iis Oebh paciry 5+ © thewevernyofas t's usually. hetter foi _¢ hoose iq PK © wl a Bing le ovthribure , j aNo- ay out} ib doled © 22d ih naregrity (o:stvaints The Rem Accayvaty OY toyveton Qn ¥ Q DPB schima On every - DB 1: : 7 o 2 Qmnshaints con ke applied OM! the be wahen, the PBA End Users dafine the PB the Schima. The DBMS. cheeks these comsialnits whn a DS app ts wun, 1) Bony Tregmty Constral nts. => ReqArptoar tc. i) Ernity J.C. —> P} stores thot Mo_PK value Con be nul, Ths ts ecause tre PE valu. is used ro identity individual typles Sn a _veltuldinn Having anyon aor Pee 9 Pk Ymplies spol Mie con nak _icltntiay —S9mstG rules. £ D Refrental Le Cee Pr isto. Gmdition which. ensure Thala 0 vrdllag tho appears: ont: weoudon yur a gre seg ajo. o/ppears ~.dar- 9 — Cee tn. another velaHon. (the Repreni 4tyso “ovelaHons - Poloriona) DR. rund earaPlish gp furbiby. ye) Bi foes They tlio enrure tra loowh wails 9 tube; be - Ups oyidtby ae) fied he | + 7 —__j dF We 7 7 | SKK on en bu sy inediee oUt sues [asin no | eee pp TOL WHP ie, oo dup Whig 4 ve OWA oH vd? Bilis ia Super of antl dey a) be | stupént _ Pegi No . Name Parnes Nom Clos: Adv. = ke. Pala manip atottion> s | -to iat fy “euple——guiquuily Ina) : - z rel pany Conn Fetdig n we BS 27 an manip alothoy > Query La Wg aage.<>i A qury Le is atlases §n— whith @ user TROLL ES inge 0 qe 08. . : sje Tht wrlattimal cat bra fe pro cectuiray , tohereas He) tuple orelerioncs Cotcutos ae domain _ relcutleonal » cobetultur, are non o procedured | t a : a So ie 1. Releldonel olgebra > iThe: relahinal algebte Ys Go spruce ctuye query language. Bt consists |) of a Sue of O percudons thor & onacrahes ‘ velclHins Os. tlP 2 procure a mits relotion 3 dho'y Yesclh. . =e > > ae Funcla mente OperaHons > The sete ond. Menamet operat” are Opereitions , _ becacrt they ” SELECT Opernhnr Use © Peres Supte Se | PTs sotneh iy ho = thn $0 p96 ee SORES — Greate t &o4 - 80, 000, ay) Sagas (Emptoyee) el Alory> Z0, ooo ee aur ao , a 7 “To setter orn tuples whore . setory greaie than 30,000 +t worl. fn oltpine. A: j Guu ry 2 Saettoryge70;000-AND Se Employee) a A 2 cu { S42 To solu tre emp. tuple cond Ci ther eerdin Owe i Tokipine. 4 and mice over 28,000 peryear oy { Woritin -oluprn:5 ard. mole covey hie i » mp Pie) f Bdyyrs SepN0 Le, AND Sal72s;a00) OR (onves PND Salon) <5 hanch “name = © Pergividye Uean) Fomor?) 200 (dean) 617? To cis enh 9) ; c g =e nome be Salary. mploytes Givst= name; tos gus Frame “Utame, set (Employee): & Gr ebiorinakes. cuplicore Atples, 227 Wo velrieve the Frome; Lame aul eae %. ~ au employees whe work tn _elipkno. Ss. Quy? Wen ty sat Capiats LEmployee),) pottepyt G3? We wre te qui tobi et lean mes & amb. oy be loan as! f spaces A Quy? toan -narnbov,, anise Clonn) Composihes 9 — Raletienal.~ On@ratens% <4? tind rose. eu tomers oho Que? Teasromer- nome ( Seu < Saquine Of “operation peet.5— Emp <—= asl abc el Son in Aloe Gnlen © RES wR Union compatible ? Tso xelaHims are 8 (0,8, . is ay Sor and $ (8,62, Or) ant sold to be tnion 1 SOG fompalibie id hw have Same otkance. and ae eka dem (6) ¥ Lefer ae | TTS enon tho the velotions have be samy. sp ta ds Ao. oF Aktyibutts and ear Crvets pon chiig pairg. ih ow ettmbutt hon tee Same domain. ou? z ' “D Parvin Considay a query fo dind tro rams oy a 2itner ~ bank — Customirs she have eiihey an attounh ar 4 an! en @ loan tr bow. Quy > iP Gard tH nomi geo AU CUthomee witwig R | loan, iu bank . I: eee f Gina the OWLS oy AU COitomiys colt Gn Gtr 8 R Sve tral sebayut . AN ces Omi Kane Wwe Wied Att _ Cut shomes Ritter OY both oy itt _ bus 74 & genst_in mos Situations. i Be Oe 4s Ha usual ser unl ats me wer ccompenere Fe eee Be orga sig bel Bacio i ee we Ftqulye Inak two. as held) 1p Wa A ond Spur py teint at This isij= they oma) hover sams nelly OT) 4A | —= Se =a Hl The Ser dbperence Operation, chinored hy = fr2 . CWO ws ta. do Find) dupler thou art in oy c-e. 4 wi bur an not in, anomir. The expen dat A-s peduw a rel? Comteuliatg there tupur j,, = Ro butt woh jnus.s : it Wt Gon Find at) Customers % the Lan. who RO | howe. on acount bur nob ca dean. toh { sm a 1 TTT cusreney eine Cotposiiny ) TM ie poor ups 5 —_> nti > ' ; < t St digpertnte fs nor Commuter. a Ex- it), -S:% S- 8... # The tis 1 tel? 1 Rog Cmt'tion upto 19 Hay fond4 AND Cent 2 ~—— Teoranl— (Feeney Se | - f y TN _Cortesion Product Operation.“ Oc) > | ALL POSSI ble — Comdbr'novten. i fx? TNWSP) Loucp ar ' cee FOO), 01, b) O40), bray, coph)y C0) a=) 3 ‘ Geis urtd sto Grmbint tuples’ Arom twos “yal? + Suppose Rand sore two velovons. REAL, Ar,-—) An) soit, P tape £ $.(6) ,B2,—8%) poh) tuple thn thy reat, 9 Contestant pret is a TP AT with tm auiniburer and. Pr types - TV (Oj Pra ne Any hy Ba — am) Sggrovinn = At se Retine th name g enth Femal emp, &hiy 5 Ai pendent. . Query > Pematr Ernp Ss SSers 6? t€mp) © : ] Result {4 < [acara oat foe Passi Con) om ( Depéndink % Resa 4) = Pichuod Gap Eric. = Empro. . tex) tex : * Resutr < WT, of Protund ae) ENom, Tiare Dtpendink Nand runchreme: ameounhs Round—Hiil 400. Pownbwn _ roo Late Pextyrrdy, __b6'g | if ee ferryvidy, __ 200 Redwood. Soo Customer Nanye PAams Heyes Ro —bermwe- x Joon [uxe- 20 ; e ero wr romeran ye + = —_— oye Sano oe Rey neue A “a Re] Lal \\RoundHiti|. B09 > Ly YOLAVC | Dovsntoun. levo uty \ : = uy Suppose thal we wont to din de ncurss AM tiprimirs whe have a lean ar the Perry riage branch. | Tyra Garower Xloan) nchanamt= Derryrtdge" ‘ a“ borvo user. Loan nLMbey < Loan. lo on number C Tyrant nant =" perryridye” ——— Se Tg Ge wantonly those Hy ples Gp benvewerx {pan that perrcun. to customus —& Q } Un the! Penrynid yt, branch. Fi nly, = Sinte— we wank _. toe. thos G_-ponyetrim « Sek Gntersarier..Opearion. (0). Bo TS ind al -cuitonmais..ooho hove» born ata cmd an atcouwh. -* “tg B ao = borrower) AWN, Aapositey ( ee Casey ame” oe CStomte na: 9 Go Ras = & -(e-5) ne wel" having OU tuples drouk Bes oy hwo. apecigied welooas Udon ts __chenoted B yrs) s with Born on Atroume 7 forte Doo — Rarearch » Morakin = ae Sr is aoa > Combine “relaktd.. 44 p)e_qaum wo Telotios Into pip Auple _4ncur ag dois tenditions . “Toe _celonint 2 (Ayf, Baap (81 .62,-8) taka nae rel? —F (Ay Pap Ay —— Pry Baby _ im) end Toroi_ne. — cAkhibutes = ne AbK SS q (k) C1 Pam? Nevo pany Unary Reladimal Operaltans t RENAME -> “@. Tr danke hy P (rhe) s Ta_Some coer, we 4yY wank +9 vero Nal ne Pee ee ee “i oy pre, 2 {%) we Ful own a query eg ees raulhip\e al Operahians fe w Meee awry qe fora Oe opexar* AE 72) ‘The piney Q@BNAMA opsral® e - C cant he ev ehnel Fagen : cov eh Pores sed by ays £. foil0 gems 7 1 - é ~. vt charges bam = dt, we) 9 naeee Z | ~— Fs Teil) aes 2 Naws mlascy, a 84-62, Bs, Ge we um! Btn 5 pega Speola) Core of equi-jain tn allen CMobHe x spedgred Mm An Aietds fonda = Ae Saye name Fy hokh yelost i cu spite a ___-Usie Can perform a sdoburay Jorn only rf ot ___ deve te gay Cone ea eis btw oe Is adil rane nae wy awe, Emp-- PLP + < re. (ependint) Lpnly pnt eamntt, pete (emer) <— AN Emps Lmphep iow (emp ar moper) FNowe Lmome fa - (emp PA £rop.- fete AN, MoPtpabmprsi, \ he posit -— getter pom f Lhe The Division Operaton. Go) = Th dinsion. operatién; dunottd ky In sured fo queries trae Include tet phrcue * ford” « athe division aperotin fs aettanh spel pea spl al * oyind” ce Guia, sror SombH nt, OMT. in’. comers) Resuttd < C an pra). Modal Pr J. Resutt <— TT yong aK _ CRerath »» Emp) BD dind the nonw AL emp. Lohe tooks om ow prejeds towhe| by cepts ~> od j ( ( Quy? HT MTT gg C6 patie «Pou ' a pts. Pro) 4—- TT, em ( Proje ) } ory ‘a saee : pNoweeal DrSemay jeer) fe r Allpy. << Tone, prec ( wertts-orr) Resrtht (Cmprag— ( All_prej + Dept Tm Prnj ) \ + sa g Z . arts wil rap. Pmpne = wcl4o Raggett . 8um ep avg . 5) ymin 3S Cx= a To-vahien. © Quary> er cao), doprn0 rebate Arpiee- tha, Ls Emp sorte _in —- ord. thant *6- =e ot (Emp) ZONS> CoUWE Empre., fn salary Or Cou >. | Ole aE DAL. Contemp me. Average tala ; Bung? Grist ie rans 9 Onnp. callin two dy Adm | lop tn clink. [ena turbo pexotyat RUA, << AND_o}_ Dep en + CERO cn) Rosdet (0m pro.) <— Wee 5 ee eS cLLE — ot} KN 4 ENQUAL , LNG pet Outer join? A ek operct ons ont conti | —— ouity’ join, that Comoe Suet Seni spruwah — Sei) abt sre tuplestn iQ nal Emp we wank bo. keep \ Some a Join wilh Aebiitan & or AW those ins gy x All those th bom. —nutoittons gare bas s oy \ % cohtthy xe nok — thy hawe rnattlat'ing types 14 c the otter yvelatons. 2 dete Oahr Join =a Rigi outta Join rt full our Join be 7 ; emnp- nol #)) The ouky soln opentida 15 @m gro lths tag a % pe dolh operat’, {0 cleo colts missirg a 4 E Rego 20 (nouruval doin) z oD > ete OURY Join pa) => Mfr ower Join y o pied’ Ki ps ee enory tuple inthe Parr AUP reLebiow ay in R PAs fone Ove vs qu ples ts q, tee Mibu Stn dec with nu voaluts, coo eee P+ fosces _cu_tup)es ror lid nob mutch cathy poh a Join? Se enna > Right oarr Jon PS. Rirtny ee —— fn second ay re ysis 22. DAS it no raokechieg tap i Fn Rajan Halibut 9} Rin eee oe yest ave qed Ooh nud vali i S) Fu Ouky doin —> fr Keeps aon . (A both te eee ni i whtn pro maltht'r tuples are. a ‘nO det im toi wi esti as ex : a Bere Ty [a7 I Ge PO LE too = Ap IA joe iS S q a b @ 2 E 3 4 ) ! 3 4 AW aA b Outer tution > Zp fs used to trie th a du pies qoam_tuic— “valoda ls eee art_nok Um'na COmpattble. bub He yell padi ally See ieee bares oo Relational Carers —> Reloncl coulerutuy ts, | ) soma eatery Language ohn Ut. OTE cme daalgamm) SP> fala on Te ry Q Catal, eg ond igen $b ,01 passion 4 Haw is no cltsGipHm 4 how to €veabuoe a \ Ruy { b naenaa Seta speiqes aha is by | Q._coleulus_Sepresiter peu = be? . i , tran hoo ko velvet. th. So_ Th ja 3) Qe —_Jekmtnt ae Yron— pro Cequyed loogusy ae vohose Comiderd 4 Batuconal “caleuiu, Is “bastd Oh a beeing logge Callid pridicake Codey % gu) bot melthumabtcal — | mel uct = There ane 2 types of chelortanal Coueetus, | <> Life ) Typle taleutur belo Domain calculus gt D Taple Cobartis —7 “The > cechurc QyLLLyy Log wong J coithoul sti bot iqormettion . sup) e veloutg jt |tonod cohave + is ty ple ver Conslional expression fnvo} Bish oy qpumry ts the ger conditions. <2 piven te AML GF ern « whose Sal . 1's anes $0,000. gue f bptoway buntane | Bnployee Lb) pe ba 25920) at ee <3) Retrieve the dak 9 @irrh £ cme oy re emp — % t iB whose paw ts Mahesh Kumar, . S mreabath Quy) $008; tAdd | Employee lt) AND be Entawts AND t.L-Nome= Suns emp. & Ais Sclovy voho 7 BB) Rerieve thal none op belongs 4o— olipr nn, AL. 4 Ucgasrys + - Prams, ts naw ts | Employee (4) AND t, DNIG Sas Universak & £x?steaHial Quinte a CY) &> ©. tuniversal _dopotes by Existential danoked by we nied to detine the fuple yartables im gor mula ol A_typle. vooialie ici quantified vataunivs — nuh Ve Topantifiens (4%) _ O— Olrwit tet is — 4s ae y € tava —_. gnigtenkt EAcis oo aL o. knan 2x0P nese i quakiqier denoted ae (¥L) ce) universa rss aormala fis True ie F evaluate, to fup)ts hay vole ik 1s alse. ex Leas a 5 Qo tan'oy. d A and ys. v9 Perrlove dra nanas a oe empl fe. yor sda W800 cheoovkmyh” —a 4 coho woo’ . t a e f% ~Prlanie, ts Looms, te cuoldloress ) Emologen ey | AN Dd ) Coe parent 1) AND As dtm = ; : £, dno AND. id. ddan = © (+ search? } a <2> for every project located fn emnol 5. 1 RO y , whore and 4 a is Com pavison 1 = ee i . on ¢ Re-2G2 Frat oy at te have assigned every airmbals op A. aeldtin. Tro _ clakobae an. tH clonal. ' > petrieve tm 008 L£ adders g Ho employees Chose nome is Mahiol Stumeoie. . iu Employee Mame) HNant, Pmpnes) Dos, Addriss, 50: Salas Supers, eno). Employee (abc de &g hi) fae] Can jcab) Cag-tadptae) tat}t3g ) 3 C$h}t24) Cémployee Cabcdedght) AND as ae maith). And be * Kumars’) & ¥ o> Rodvieve du nome L culdress 9 cou 1S OQraployees 2 attip Neo A, : + 2 f abe| Cat) ( &mployee tabtde Oat ut + " oS | £5) Rerreive the Name Loot! work on Reasearch cpt. fave fot SE ano’ departm

You might also like