You are on page 1of 26
ido?” x Team of pens Bake tacks Row malerial thal con be recorded, fy Tex mecages, Torte abe Delabase + collection of dato Mon agement sytherns «2 a sel of propor fo clove 41 brte there ole ie) Feleiete * what ts a Btahace ? A database ts ov aryantzeal collection af dota, thal oe teloled ww a rneaning ful € oll rantngful amy 4 slow ima com ool At cl, ne sea eee oan Cpettidt ale ret pee fer many purposes. + key Fealyves of o Bale Base: : the data te : input (clored) only once . organized + acuessible effectively anc efficiently NEED: OF DBMS. Yorge amount of ‘loved Dole + Retrival * From File systems to, DBMS + problems with: file processing sydern- -Treonststent date « Fnflexibi lity + dimitel alo. shoring : + Poor enforemenl of slondorde + Excessive plogram maintenance Reams Benifite: Minivnal dado redundancy + Considency of dato, + Tubeqradion of faba ao sharing of Late \ Edse of egglicidion Levelopment + Bale in dependence ~ Reduced program maintenance . Date 3. Mdlines I Banking system a Telecom 6 Manu factsrtng j Applicalions ef DBMS ' | 1 UW @nfine shopping § Educalionol cS the PRAMS i a safhame package which altows a userte define ede , ancl maintain in the datahase and provicles controlled | access do this database. > She inferface bys users and dala is provided by 2 dababace se ieee th | Ext Cracle Me S@L- Server , MS Access, My SQL, Postgre SQL | [ras BATA | x Balabase Mag Managment syder (Dame): ij Fla ores] DP Data Rebiewl | Satvare | N 5 Ie rdmtstration \> Application ! Tew a ae 5 — fon STATISTtes Base ‘Repost bees ? - s}-{pars nse) M oe —| Business “ogic Kata Secistly ce s Dens Ve Reems t Tn Bers relationchip bio two 1. Fn RDBMS reledtonship bho boo table oF file ave maintained fable oF file can be Specified at programmatica ly the time of -bble creation <. a. ppms does not support client- 2- ROEMs pports client ~ Sey Server architecture. atchitectuke ms 3 DEM does nob support dibibulel 3.D8MS supports cltrtibuted Tou. No secertty 4. Multiple devel of Sceunity - u a) og in at 0.8 devel ; b) Cominand ‘LeveL ef. Object Level. : DataBase Builling Blocks + + File [Table : A collection of reladed records. + Row [Record /Tuples: A record isa group of related -fiells. + Colums/ Fields : Field represent an altribule , 01a chamcteristic , era piece of information . .. * Advanboges of using DBMS :- + pale cuptication and dorage space wailing an be avoided. « Inconsislency cam be evoided- 1 ade independence \ » Efficiency of dale Ace es, Aig ste cafine contrelted atabace SQL Softuoare Applecaction Basecl on usiness xogic Sip bls bdo Specified at fen. liend ~ Server tibated Seaxtby - vel Le. avacteristic avoided. sdata Administration / abshaction. + bela cam be shared easily Unauthorized actest can be resditched + Recovery fiom failure + Integrity and Security. * Bisadvartages of DBM! + fhe overhead cod of ust Dens There axe some Value Problems if act Using “Te PalaBose: Sige of Pala: the smalt amount of dete. storing into spread: sheet is fine, Rewever it. might duans info adorge arnourtl af then Spreadsheet solution rill not wort, + Ease af Updating Oeta > Multiple people connet efile on Some time- . a » Acury : iohen ter doing dato enby in files then H might be possible “lo ineovect date. due Ye. v8 validation present [ike you can enter wrong spelting ,roreng ‘alates and. wrong ameunl.- Secusity: You cormol seutre the dato in the tent fies and. Spreadsheet, Anyone car, access the efile ark read? any dake present in the file, $0 stoting dade wall nok oorh with banking: fieelth care application, primacy is PF Tieull -to maintain . edil the Sve payroll Lepartrent where © Redundancy: the duplication of clato can be posible ustng teat. 2 , REE on spreadsheet chances of adding multiple cepies Of dato |S 3 Gnnot be kimiled here “this welll dead to accuracy icoues, Maintain and upeloting wnulttpe copies is net an easy task, Incomplete Dale: Some of the data ts nob considered not oepotant, So such date not entered in the file as no validation in place which Leade the dala inkegily is in question. aclosl : Components af Dams a) : eee Ge Users: Usere are people who ynanage the datobase & Perform different opevatiens on database + Ex: Application Programmes, ord users, DGA ete , CBababase ‘Admintsbabvon) have sight to access of database. + eens ey Err MYSQL, ORACLE, SQL SERVER . . : Hardwore - stores the database , tt consist of cliffererst Seconclary Slorge devices kitje. hercoae £4/o devices dite moniter , printer, . N Magnete topes, CDs ete. . p * Lala the data tm the datebare fnlegrated & shavect. Bole. is velated tp some organization, Generated is stored die neemeric, non-rumeric date , character. = Too types af datas 1, User Datait General dato Guithout process) - Ev Tables, fields record's, attributes. 2 Meta Data 2 Type of dato (Lata about datad LB: Infield which type af attribute we are date Pocedure + Acces! gngq frome dalsbase to DEMS. Peticlions € rues thal should be applied to the use af Batabare and DBMS % ys ae Vata Slodets is : : CAs) Dala models define Row the dogical slaudure of database ts modeled: t oe : Datla models clefine hous dato. is connecled £0 each oth nd b . a mt, they ore procecced ¢ sfored inside the system. ee «structure of dabobase means the data’ Lupes, selalionshipt ane consrains that should hold for the data > Ble models axe divided info 3 different qroups: | + object Basech dogical models + Record - based logical models + Physical models . Pala models _) o = — object Basect physical Data “Record Based Bodo. models Models Dale ae i ~ | uy Rilationat | ol Het work ional | form Endily Pelalionstip — object ovvenked Heivanchical Oe adel Sete models Boda. model Gate model, Weta model 7 > object Based dagical Models | This described im the folleuxng model. Yo users 4. Entity - Relationship model : 2. object - Based model 3: Bmantic model. a 4. Functional date model. m arg ‘e + Entity ~ Relationship Model + . | + printer | an enttly is a “ihing’ or ‘objed” inthe real world that ts : distinguishable sfrorn other objects: “se I o> His Soased on oe of baste Objects » called entities aiidthe | relationship amorg these objects - Gnsider the following &-® diagram: dhe mecmeric| — (Enlita Herne) Retetion tend ed abibude Reccbton fag rete “ene one : weate Enitty composite e * anete rriam aoe - MulbivaGuecl Attribute eaten Clements of an EK ctiagramn ai eo Devived { Britt < -AHvibube | (Abate) Ge > Aitvabade D Example: : este cuslonmes_ sheet) 1) Gastorer-c®3y . — wee <0 \ / Pah AG * ER Diagram Models + oe This pictorial » representation of clato. that cfescribes ow ala Ys Communicated and related to ‘each olner. + Rectangles vepreserts entities . sBiamonds represents relationshéps. among evdthies. | > Eltepse represents altribubes dines vepresents Lint of attribubes to entities to velationshy p | Advantages af ER Medel: . - the E-R model gives graphical and diagvammatial representation 1 ef various entities, thet Tinea and’ relationships fi enbelies So 1 Fe.babps on the clear understanding of the dete. “Bruch and 2 | roinimizing redundancy and other probleme. | + Conversion of ER Diagram +o any ether data modet Lilie nedeserie modet , hierarchizal model and the relatioral modet is very easy. Sisadyantoges:- “Te te just useful for latabase design and tot fo implementation - there is no industry standard notabior for developing ER ’ GTC cate model te expecially popular for bigh-Levet design. Ne representation of dato ynairipulatron « object OvenleS Sata Models» TE tg fret a Combination of object ovientect a velatiinat a data bare feateres . Lobe represent complex and wold probleme bere was ¢ a data modef that is mo closely represent the veal 7 te « objeeh oriented dala rmadet represents thereat world problerns easly. Tn 000M, both dale and their single stucture ffnown as offect “In opttyeal world proflems are. represented as objects, with different attribuder Ait these objects have. multiple reblionship b/vo them. ‘selalionsfip) are contained’ tno Components « object: An object is an abstraction ofa real world ently. object tes data & cata code inloa single. unt which provides encopsula ata abstraction by Biking the imple mentation delails, from the users: 2. Aitiibides: dHributes desevibes fhe property ofan objet’ cx: Astudent objert includes the attribute nayne , Rell number, Sernester, branch ete . 3. Mefheds: the Behaviour of the data ts vepresenbec by using methods. Method’ represents « veal -world ‘action such as Sinding a ‘elecled student name, changing «student narne, caleuloting peveentage of attenclanice i » class: TE te 2 collection of similar objects (attributes) and behaviour (methods) or objects is am. ins class student class name (ool: TInt wll nur; wotth sharedl sruchsre ane of close public: void seascht, voids update 0); L student > Recork fared vnodels are so named because the data is Hept inthe b form af revrds af several types , each record tas- fixed nlo-of attributes and each field is of fixed Kength. Lhe ‘Record Based Models are af stypes s |. Relational Medel ae Hierarchical Medel. 3. Network MeceC | «Relational, Wedel: _ the relational Lolabase was invented bYEF, col ai tery i 149 = er £ complen Dems, and £ rmmkes the i. rode thal Of date nat helps to] el. * functions Hep inthe 6 No-o ' cer in 14%9 . the velalional model represents oth dala and reCalionship s among data. in the
An architecture for a dateBase systera fs weful for explaining the shructure af a specific dalabare syste, 3 the. detabase avchitecture isa. three level atchitectire which vefleets ‘the under Schemas. and dncfances :- Database scherna: , the description of a database called database Schema. + the. dogtcal structure of the database Ceying database system storized ta or other torage.. + the database for . pten. sebave + Schema ts definecl cluatng the clatab. tani: frequently changed. ee ee oe ee nstonce : | + Dato Cthe actual content) in the database at o parti inlime ts called database clade. 6 ato porttculay moment LTE ts alco called the instances or cunrend sef of occurrences Thuee Schema Archilecture ieee End vsers Levelfview| External veel | view 1 Internal revel / Storage level Ga fl fa >the goal of the three scherna axchileclure, ts to seperate the user Qpplications andthe physical database + Exbernal level: Shis fevel is a past af elatabase that # relavant to each user. . + Gnceptual level: “thts level described what elato level is stored in dolabase and velation ship among that data. ca) alt entities, attributes 4 velationship. @) Gnstraing on the data. . () Scurity and integriby of, the lata. , ; Toternal weyel: Tt ts physical vepresentation af database. | Leffite level describes Fisie Hie date: 1s stored in dadobase. | “TE covers, the date chucture and ¢file organization DBMS canbe seen as efther Sing tier ov multi trey “dm entre architecture clivides the rohole system ints relatet tut ff independent Nn wrodites. . “g -TEER Abchitechure: “ . 2 : . - User interface - Presentation Service + Application Server client Computers i eee Goa \. iJ File sewer FQ: 4 Teer Architecteve 2- Tier Architecture : + Tp a diveet sewer architecture Diect Communication will be “there Ran faster ; client Grputers, aa Database Ter ; rs ___ Bala Pse . Sever _ Fig! 2: They Architeatare B Tier Archikechures : 4 | + TE seperates trers from each other bared’ on Gmplertty of the users and few they use the dato present in databace: | Tt & web based application ; + Heres Layers tellemt Kayer, busters /application dayer, catobate dayey | + Hale Tier dafabate restduee ating wHlh query proceising Kanguage | » Application They: for om user, cf presente am abstract view of application ! and also acts mediaby beluxen user and seta bnse *gtvenif vey | f tation “Ter: user operas iis f ee ee of Etobase beyond the data daryer. cient Ter ~— | . 2 OTS : ss : Businese Kegte i —* —— ‘ Ties BJ eu Servet Roptresti [- | RBetabase Sewvet “three Schema Archilecture:- Tylernal Cpfysical) Schema: + Kefines the physical view af data (as seen by a DBMS) «Describe the physteal storage of the database. «Reser oe Te Tipe Galo is sored inthe database ~ Corcern wrth sforage space allocation . recor description, dita compression and enayption techniques- . Tternal- evel :- ou + clack Employeet ne 4 chas) Emp-n0lS) oo ce chor Name fas Date + Lake joined, Boolean Pay-Tax, Tab OT Hours, choy Keslode (3) 2 b iv f the users Corcephual Shera oF + defines the dogical vrew off dato Cas seen by programs) : | Boscribes the shucure Of the whole dababase -for a cornmnuntly F tabase dayey users- : tides the details of physical storage structure. jRanguage | + describe enbities , date lypes, relationships , wer operations and ; of app by constraints: : cand ‘they 4 the data Dotabase ter 03-Jan-14 0g -Dee -00 0a - May~% 05 - Dee -43 Bimal T 05-Mar-96 |aayothies as | ta-ocl -se Frdeanal Scherna: + Serfines “the extemal view of Arta (as seen by an 4Ger) \ Lorthe users view af the database ~ Sescribe the part of the database thal a particular wer qroup és inlerested cIWicles Lhe other cel ails af the database Mapping: External /eonceplaal mapping: Aefine the conespondence b/ coneplual view + This specified! Rew a yrrliculay external scherpa ts derived frore corveplual schewa fy particu lax external view and Conceptual / Trlemnal ra: vrapptng: Define the conesponerce blur the convepfual piers anc clovecl dalabase + Hhis specifies Rew the conceptual schema is Yepresented atthe fnlernal level. Tf the strucluve of the stored database ts charged. the conepluat infernal rapping rnust also be changect accoutingly, External view 1 External view 2 (sno _[eName | cnlarne] [slalfne [iver [Bnle): External level staff-No[Frisrre | talarne | Dot | Baich-tto] conceptual chuck sTApE ¢ int slaff-sfo; int Branch -No; Internal (physicat) vel “date dote.of birth . y . Data Independence - —> Tf any changes in one (ayer cannol effect in othey eee : called as "Pole Independence." Kato Tadependence ts of a Types: 1 degizal Dako Fndeperdence. , 2. Physical Pate Independence. Yup is ew and dh for lovecl ted” af the . eco trea ly, nal vel nei layer = dagical Sale Incependen ce: 21 sles information about Row clata is rnanagecl inside. Capacity to change fhe conceptual schema vorthout having £5 chamge external Schemas or applicalion program. > Physical Sala Independence » + The ability fo modify the physical Scherna without changing the conceptual (or extemal) Schema . Env internal schernas Gitfe different Jel organizations struchirer indexing should be possible without effect Grlernal Schema) <—> “0 level/Apphication ra cogical dado i — independence Fs cca Scherr | <—» ological vel physical — T data Independence (a Scherna| <—> Internal fever J CI as mal Scheyna) [€abernal Schemas} cea ee : inckpendence chert - Sewer Architechure :- * Tnwlves a client and a server » chrevks exe Pls or work stations + Severs ove pouxrful computers, con rmanage files printes, e-rraits. = client inberacte sewer when additional functionaltty Loes n't exits in its Bwn machine. clierd — (ayser anleyace | Appeation Grver [Aarre Salahae Sover Aalahuce fables) ay client sener, and b] Multiple clients and 1 Sever database om (he Same an different corpuler = Sropicher letent client ‘dient ee ) Jj Lelient| 9 Matabese Database GJ Multiple servers and databases on cltffixent computer’, fotient! 4 Seavert Hfeewerk lefient] . w client 4 d \ cltent| Balabare Database Fig: client sewer Architecture UNIT- 2 The E/R Model , The Relation Moclel, Relational calculus Ralabase Design & The €-K Modet: “ Crdily ses Gxtoty Telalionship Telationship sels » Sesion Teeues | "Mapping Constraints : keys Sever + €-& Diagram = Eelended K features + design of an €-R Patahase Seherna se - Reduction of an €-R Scherna fo Tables Inhoduction: scthe €- date model employs fhree baste concepts : Entity sels relationship seés, ancl attributes. “the E-R model alse has an assoctatedt aliagrarnrnadic represeretio, Im 1996;€R model was developed by “Rter chen’: Ind Uses: Th can be ised for conceplual design af database applictna About ER model: | eee model alse caltecl E-v medel & ét is a high lever C «this model is used to define the fata elernents'& relationship ‘for a spectfieel syclern. - TE develops a high level or Conceptual design for the databace, Tt also develops avery siviple easy to design prev of an 7. ' + Tn ER modelling, the Letabase shucture is portrayed asa Atagrare called entily-relationship diagram. Companert of ER Diagram: Entity: : a entity may be any ofjech, clas, person ov place + In the ER diagram, an entity Gn fe represented . <8 vectangle (Employee | o> Peparlment Entity cof. Ty eatlily set ts a ced af erdélies of the seme ype Ua « Fhe seme qnopesties, ov abliibules EEN Sef of all persons, companies tices, fo hidays, a students (strqle valued : A Mributes Get ty — ablsitudes )—__ = i — To Key Attribute ) Matli- valued - —— —_ | CHE toutes (ea rived: “Albibudes) | : % Key Mtaibule : ; ial -> the. Aitribute ts used Lo represent Lhe main charac leviste ofan evikty oon Spreads a primay K = the Key attribute ts vepr text unclerbnecl Ginple Mibu es by an oval shape ustth the x OI ste Attribute 2 = a attribute that - oe, Of rnany they attri butes fsfrown os a» Compastte attribute. pee Gest a Gina Cael namey % — Siidfe Ailxibule - = attribute that folds & stngl= ie for an Bccurance far end (Pe: hey an fest mare aub-narme fall name ete. " * Muli -valued, attribute :- > Altribule where There miyft be more than one value for 2 given dccurance of an entity type C3 OD Gat aire) — [edt a ) % Derded AMritbude Ain atltbute that Gn bet derivect fiom other altvibude & finwn as derived altrdbude . TH can be presented bya dolled oval/ clashed Svat. \sladkn Gin ale) | ~— @ x Rebtionship - > A relalionship i usec to describe the velebion bf eit, Biarrorel shape is usec Lo-vepreent the reldionshrp- here ave atypes One és asbong selation and weak relebion. shong relationship represented bya Single chiamonds weak relalionship Tepresertied fy 2. double iamond. ent} ~~ Ute : {x0 oA T Dagee af reltionship :- — No -of entities parbicipatect tina parkicular welationel = blag + modef. By 2 & the degre. | set} Katee i : (nary Relationship sof Tare of Relationship Binary "Pelstion ship et Ternary “Rebstibn chip sek Ne arg Relalionshtp set- x Unary ‘eelalionship set :- _s rohen there! # only entity sed particrpating th 2 velation, he velalionchip ts called’ aa Onary velodvenship [Person} Relationship |x Binay Relationship Set - , _s when thee ave ‘Two enlilice sel parliapaing ena relation, Ue. relation chip t¢ called as biharq relationship [aide <> fen ¥ Tesnary Felationshrp :- > Apeltionship of clegiee free, &aalled as Ternay relationship ( Nuvty Rlhationshitp —s when there ane ‘W entllis set parlictpating in a relation then the velationchip fs aatled as nary velationship. — for a binary selationship cob R between entity sels AGB the mapping cardinaltly must be One of the Finveion] é 5- Many - {pone Kelationshiy>: when more than one instance of the entity On the left, and only one imlance af an endily on tha alge asec later tt “the relationship then i is -trewn ax rrany-to-one yelationshtp Ea dudint ernollt for only one couwe bul a course, can have reany stidint's. — : (shale <>! fe) 4 Many 9 Yy Relationship : > when more than one ined on anc af the entily on the kft, ancl rove é . : : ecnrerars ae of an enbily onthe aiglt assoctabes (Gaphyjeey" Kevin “ Rarlicypation Gnelrains: > there are @ types af parlicipation constraing _Tartiipation consbraine “Total parttetpation “Partial Raat pation, * hal Tarhicipstion:- + Fack evtity in the ents ity se wccus in at least’ one relationshey 95, thot relationchip sef. fach student evtity & associate cotth attest one prafestar easily = ee Sera a Partial pardicipalion clotat participation. ¥ Paelial Pavlicipation 1 ~ Each endity ts the enbily sel may net occur in abliacd one! yelationship in that velationchip cot + Every epaclment ic managed by at leas ore employee callal anager > nlot every employee manages deparlment. e PROFESSOR] — - A professor may manage a deparlnenct Cpartial participation) but a clepartrment must be managecl by © professor loll participator), plotbe Wea Endtlies [DemeTnenT) > A weak entily can be ‘dente uniquely only by eee Lowi another erltty: many relationship eet Cone exones, wiany week ote — weak erdity sel imust “fave LOlal paslietpotion in thfe Mderiniying relationship. set ; tramsac# & a Atscaimtnadbr ‘pilhin « group of cransactions in an % Real Githy. Wenlfying, Relctionshtp Sets. 1 We capich «weal enbily eat by double, reclangles + We underline the disenminatar of a wealf € ity set with « dashed One - . » pasgmercl-vivembey 5 Atseriminadars of the peyroent “entity Seb” primary Hey for payment - -Cean-niumber, pay rrert-number) x weak En’ : Ex> LI 400,000.20 94/4 s5p@ . L2 200,000" 20 M4/g 5000 Ls. -$50900 80. Ay came x Weatt ably ype and Tdemltfying lal tonship + An. enblly. type fos attribute whlch umquety idenlifre oi ede oii dvi wahteh umguely fies each + Bub there exists come entity type cfoi which fey atlribute can't be defined Shece are collect Weal’ Edie type. * ; . +A weak entity type ts vepresented by a Louble reclarg le. The partictpolion of ioeat{ ‘entity type t olcays Lofal. chong erkity Afpe Te calted! identifying Yelahiorshiip and te repre’ by double diamenct. (Gerlach ES Dap Nolefions uredtn ER “Diagrams % ions: ation: wed ty by “Re. Relations: Gocteay los sll eae “for presenting elabions: ; a thie aie cardinaltty ratvs (ofe Binary relationship) +ty1 11x) 1, OF MIN) sown by tag t : the relationship edges. 7 OTNNS sppeptete: members on te + NumBey of. shapps voor king in Branch. raledse — Nita — Max Nofation: “the alternate of notation by specifiy the pair of Onbege'r, tha used te specify the rwtninuim coved maximum, particrpation Yeacl, te rela Dship Petivee rt ee be helity and te ee x entity type im the Yorm af: (nfm -max),. + She minimum participation af 0 indicate partial bts . » ap aa manimuin partiarpabion af t ox more iefiades fae Eaten dahon ; total participador, AL feast 5 stage in allocated fo branch... ALON) a ey) Brave h ) discrimination. Superclaas/ subclass Felelionship! : ce - Tt ts the velationship behween super & sub clacs , + enctreledo ~ indicates thet there: ts super class /eub clase re Leh'onship. o + Ave drown ¢ above the fine towwarcle subclass indicalee inheritence rebdionship. Canyepl of Generalization, Seciltsetion Aagiegration in ER Modele- » Gecialigation: Rocese’ of maxtmiging differenies bis meimbers af an enbily by identifying thety ditbinguaching chareclee” + Generaligetion,» Tocess of mintmiging ferences bf enbbies by identifying thelr common, characteristics. : : General?salion tn DBMS: Generalization ¥5 (ike. botfom up approach Combining le gite high Crel entities. \ aubelasies ane combined to «form « Supercls. Ex: es [Breen] of (owen level erfiilies os “ [Fatty | (shedent ] Specialigation fn ABMS: : IH & @ top-down approach , tt appostle to generaléyahion. + She superclass i defined first, fhe cubelage and Hs relatecl’ attribute ave defined ned € relationship sel ane, then be Added Be Carne) — [impose Gabo) Aggregahion : ‘ . > Vggregation & ke process thet repesent a relationship bho ee ogecb € I domino pes rte at + TE abelracts ‘onehn jacks’ @.vieons ; zE se jf Mbbonsbip Glo objects’ @ vtaing the reltiontip Integrity Conshatnls Over Relation a Getabase inbegrity refers to, the validity @ Consistency of store ~ rt & usual tty expressed inlevive of tonsdratnts \ Syrtegrily Constraints ensure that changes Guplabe, deletion, eee made to the databace by authorized users o.not vetall in a less of celn consivlerey,

You might also like