Download as pdf
Download as pdf
You are on page 1of 106
classmate Pogo ——___ Unit 1 ae | 3 _Lotreduction Ts Database Management | er Syster | By @ curious_ Programmer _# || Lotroduction- le In today's World as the information techno- | legy has changed rapidly, many computing applications deal With large amount of | information regularly. le As the end user applications Kas changed significantly in last Few decades, there js a chattenge to store the Large amount of information, retrive and manage this TDofomation in timely manner. le T his CON be achieving today by making use OF services of Database Management system COBMS). ‘Database Management Systen +. 2 de je OBNS Provides an interface +0 per forr Various Operations like database creaton, | storing data in it, updating data, creating a table in +he database and a tot more. " Tt provides protection and security +o the database. In +he case muttiple users , i+ also matntains data consist- Boss le LF the dato has +o be shared ameng number ef users there are highly chances that the data might not rematnQ consistent becamse +00 | many Users might +ry to access iF a+ same time and may try to change the votue, a Curiots—. pregrammey ¢The DBMS must ensure that the chances _tlassmate Jet ae History “oF Database Systern - | The fellowing are the historical perspective { OBMS system: |e en Early 1960s ,+he First genera purpose ED BHS wos designed by Charles Bachman fiat fenerad Electric, Which was Later), Bae eles 76. 5) eT iFG CEntegrateco Oata store), e This TOs formed groundworl< for introdu— ection of mMetwork Data Model, which was e In late 1960s ,IBM Developed the Fms (Thformattion Management system) Which was widely used. of Hiearchical Data mode. @ Curious —. programmer By the joint venture of of TBM and American Airlines + the SABREE Was fatnched reserve +he __elacenute Sees x Purpese of +he Oatabace System lle AQ database system provides a data deFin ation Language +o specify the database schema _anda_ data manipulation lanquage B12 express clatabase queries 4 updates. e¢ One of the matn reajons for using 0BMSs is to have central contro! oF both the data and the programs +hat access these data. le lo see why database manag emen}+ system is necessary ,tet us look ata typical | “file processing System” supported by conventional operating system. ek The application is a saving bank+ | @ Saving account F customer fecords are | kept in permanent system Files. Curious... Brggramm er jie eation programs are written +o Files to perform followin sates PN FS go 75. 7 oe +n System “programmers wrote these ‘appli caction aerata.e +o mee bank a the needs of the e File system has severad disadvantages and the Following problems are associated with file system: 4. Oota redundancy and inconsistency: e The major preblem With File processing syste is thot it mactntotns severak versions of same file i-€; duplication oF met a is Possible at muttiple places. le Also there are severa® copies of Files are stored, iF any one of the File js | changed sthe different versions of same | File moy not be updated which leads | to in consistency of data. @Curious-- programme user to ebtaty this __elnccoutec os Information, eSo in the above case, +here are +wo options . Either the application program- mer has +o Write a new application Program +o satisfy the usuag request | or could get this information oe aoe le TF a query changes , A NEW application Program should be Written +0 get the needed information, 3. Data isolations: ° One of +he major problems with the | File system is Hhet +he data fs scattered and stored in multiple | ; locations and in different formats. concurrently, ae e Suppose +00 users located at different Jecations wants +o book the tickets, there might be situation that both of the people Will be given the same seat because +he data is stored in multiple locations and both of them Will be given a seat From individual copy of the deta. herefore there should be some protec- tion mechanism +0 avoid this concurre— Gear tiedates, 5. Security prob lems> = able to access “the data which he is a Every user if this system should be 6. TaAtegrity Problems i e Data stored in +he database should’ be | alowed +o scitisFy certain constraint || checking. je For €9 before adding a new employee in +he Employee table, if we check the | age -F the employee and iF we apply constraint such that only these employee Whose oge is grater +han 12 years should be allowed +0 enter in the table Which means +ha+ before +he new data is inserted the age oF the employee Should be calculated. 4. Atomicity problems + «Every Application System is assumed +o fail at some point iq near Future, | | T t applications , iF the system — Fails ,the data should be rolled aaa +o the state before +he Failure) ace 7 i account but the customer geting any cash From the machine. not er disadvantage with File i 99 System is thot it becomes r diffealt +o ensure atomicity: | Advantages And Wisadventages of Database Systems - The O8mMsi referred ever +he convention proces sing sys tern due +o +h Following advantag | 4. Controlling Data Redundancy — @& the conventionad file processing system » every user group maintacns its own files For handeting its data Files.) this may Lead to: + 7 BDuplication of same data in different Files. L- blastage. of storage space , since duplica— ted data is stored. Z| enterin data agatnh and wWasted. Time in § cagaty Ee ous —. Programmer classmate “pate (2 feces ¢ eB) ae e+ Elimination oF Qcensistency: IL! je Let Us consider +he Following example oF student: Ripoke ope = Omagine that a particular student has opted for embedded system as one of the elective subject in sem-Vv for rTY¥BSce DFT sem v examination While Filling up the examination From. =-TF, ofter getting haltticlket that the rather than expecting Embedded System as the Choice of elective subjet in the hast ticket, iF some othe? subject is highlighted, i+ means that the data for that sudden has Net correctly inserted in the database, I On centralizing +he database +he duplication will be controliect and inconsistency Will be removed. manner becaus: our ekis Soetata ara systems are Hot capable +o - produtce same, . Centralizing the data in +h database also means that user can obtarn neo and combined information easily that wowd have been im possible +o obtatn otherwise. . Also use of DBMS should auowW us don’t know programming +o Ateract With the Het | data more easily, unlike File processing | system Ohere the programmer may need 40 Write new programs to meet every | new every new demand. Flexibility OF +he Systery is Amproved : le Gince changes are often necessary +o the [contents oF +he data stored in an | system, these changes are made more easily in a cCentratized database than in A conventionad syste. j_¢ Since data of +he organization “using database approach is centralized and L——— Would be used by a Number oF —— users ata +ime ,itis essential +0 enferce integrity - Constraints. For &xomple- “The Example of Hall Ticket Generation System that we have catready discussed ; since multiple Files are +o mainteined , so sometimes you May enter a value For subject moy Not exist. Suppose Elective Subjects can have values but we enter a value ’Mathematics -(' for it, i+ Moy lead +o datibase inconsistency. e@ Even if WE centralized the database may still contatn incorrect data Por example WY * — Sal oF ull time clerlke m be entered as 1500 rather +han Rs 4500 ae i ble rs 24M be avoided iOF rocec| Ures eration js yo teer, 7 classmate —_—| ——| 6. Standards can be enforced aT : Male) Stondovda are easier to enforce wet jn Galab — in atabase syste because all the tS ——$—— data in database js access +hrough | centralized DGMSs. Je Here We can remte +o the naming oF | data, Structure of data, Format of the data etc. e Standardizing stored data Formats is usu desirable For +he purpose of data interchange or migration | between systems. 'h. Security con be improved: conventional systems , applications developed in 29 adhoc manner, OFA¢ different system oF aN organization 3 sceas different components classmate Ce oO) authority +o know only the names of out they customer Oho have a 10a9 in Bonk but not the details of each —— = | oan +he customer may have. | @ Fer example ,a clerk Max “be given the le This can be accomplished by giving the rivileges to each employee. 8. Organization's requirement can be eosily identified > @ All organization have sections and depaytmn- ents and each of these units often consider +he Worl of their writ as the most important and therefore consiciler +heir need as the Most important. e@ Once & database has been setup with centralized control, it Will be necessary erper up of sy nent +hat an overatt dato. r AQ Organi2antion 5 busid, G@_conventional system, itis more likely that Qill be desined per Need of porticular applications emand. t vied ts often Not considered . Ssuilding o9 everat view of aq organization's data is usuct cost effective it +he long +erms. e (Centralizing a database provides the chemes such as recovery and = [may help the database Tt State that exi from +he Fatlure power fatiures, software errors including > hick +o. recovery from the inconsistent ~state +o +he fed prior +o +he occurrence oF +he Fallure » though methods are vers comple @Curious—. programmer |1. Database Complexity classmate isadvantages of Database systems = The Following are +he disadvantages of Database Systems “The design of the database system _ | is complex , difficult and is very time consuming task +o perform, 2.Qubstantial hardware and software stort -up costs. |-ro Huge amount oF investment is needed setup the required hardware and +he software needed to run +hose applications. % Denage +o database affects virtually ok applications pregrams TF one part of +he datrbase is corrupted or damaged because of +he hardware or softwere Faliure , since we don't have many versions oF +he file , att the application programs hich “Ore ore dependent of this database implicity affected. @Curious =. programmer = S —= ~ - 4. Extensive conversion cost in mooving From = a File~ based system +0 a database et system ZF you are corren+t worlsing ©9 Fire ba. system and need +o upgrade lt +o database system , then large amount SF cost jis incurred iq purcha- sing different +ools, adopting different ttechniques as per +he reduirem-ent. 5.Taitial traning reduired For OU progra rmmers and user. amount of humans efForts, is needed +o +rain e end users and application programmers in order +o get used database systerns. Lntroduction Te Relationa} Database Management Systems By: Curious—. programmer Toatroduction To Relationat Database Management System: A relationa& DBMS is speciot software ‘eccris Used +o snes the organization, | storage ,access , Securit ty and integrity oF lenis Specialized software allows application __ | system +o Focous of the interface ,data |e then there isa need +0 insert, modify, delete or display ata, the application system mply makes % “cat +o the RoBMsS validation and screen navigation. $, relational ne Mest comr eA relational 68 Fores information in 3 Geser of." tables", each of which has a [ariaue identifier or “primary ey” Rdbms are Widely used in real life appirs Such as: 1. Pirlines: Tteanq be used to keep the status of the Flights and schedules and For reservation and cancetlation of +ickets. 2 Banking: Tris useFu| tin storing the customer information , account detcalls , loan detatls and banking +ransactions. Wawversifiess: ietac) (ninse) RH ( ve . Ltis useful in storing +he stude formation, coarse feqistrations, grades ete. lotional Medel! ahaa pone eo! nigil jonal Modiel is M collections of relations lak ia. rr ach _classmate Th relationa’. rnedel , each row in the table — consists oF set oF related data values. a le In this model, each row in the table shares some reality Which corresponds +o the real world entity or relationship. . Every table and +he columns present in the +cble is given a unique +uble name [Pend column names which can be Used +o extract the relevant values From +he t+ables. Consider +he ITDOLSYIT table given below: firs Relaton =fable name: oe A+tributes G-NAME (string) Contactno (gn) Email(steing) 5253461512 le A row feof fecords in +he given table is called as tuple. In the above example, the | dividual records For stucteots starting “0ith 1000 +0 1005 Je In above example ;the individual columns are called aS attributes of the system The table itself is catledoas the relation. e The data +ype describing the +y PES. OF values +hat ©2329 appear in each column is eattecl a domatn. je Sn the above example, iF We define the | PetecH OF> Schern cit Would \lool<. like this jeire i | IDO Yr (S5-TDtinteger , S_Name : String, T ~ contact ino integer, email i string) — - |. - eet. . S@LIis a standard cer s ; _ Programming y language and rs Pulorit has Popularity has explored since past F — +e clecades. a e@ @hich SUP ports © Ot is portable languag E eight From omeumframe. isystem to Personal and ever) to hand held computers | devices. z @Téday most of company's Sofware products lie of S@i For its data management and t SQL is the nucleus of database proclucts From Microsoft and Oracle,+Wo of the Largest software companies in te World. eo The yjourneye OF S@L is aA tremendous right From +he beginning AS 2S EBM research projects S@L has become a powerful diurre rege che Rte. We on onk ta Emr ee eee Semana ihe’: ” ° le The figure below shows how “actually SQL T Works with detabases t =a ee eee ik SAL Request | ° airy re = bet Sc - he Data pBmMs | 7 n | Computer System The lWorking of S@L le ln the above system, the computer system has a datbase Which stores att +he needed | information. above database is For a company, fF store the information of manufac- [Camlin| Pose Date 0 le There are various roles which are played by | s@L.Some oF +hem are discused below. 1, S@L is an interactive query Language: : | S@L provicles a very user Friendly, easy to [use tool Ohich auoWs the user +o write the |+ypicfal sei commands in order +0 retrive the cata from the database. . S@L is a database programming sanguage. Be (ues) Jd T hrough +he use of database utititg programs, programmers Write Gel commands in their on application +o retrive the daatkK _Storecl io database SQi is a2 datobase administration language. Te allows +he administrators to define database structures and also contro) +he access to +he stored data. saris client/server Janguage. Tin Ghhe “serves architecture , the programs uses SQL +o communicate a network +o access the shared $$ pm eee communicate uit othey “systems ey Papi sending request for data access 7 Sais a database _gatewoy lanquaqe-— Sa is most of the time used asa gateway Which allows one brad oF Dams te communicate With the other brands. “eres Iith Relations OF ROBMS "This section Displaaee hew +o create, modi or delete relations Ohich mog exist in relational model. This can uncersteod by the Following SQL statements | 1. Creating Relations (Create Tabe{ Statement) odliPying Relations (aiter table statement) Create tabie | ‘Toouryrr Gat rp inteqer nok AU, S_name varchar c25) Nor null ,comrach n° fa nor FF nail, email varchar (30) | Hot nut) eldhen +he user is creating +he above [table +he user now became the owner [eof the newly created table, Which is give the name specified in the above | stectement. 2. Medifying a relation (Alter table statement) T | ds Alter the +oble is ready , at times user feeis the need to store additionag iInformaton about the entries in the table. eThe alter table allows the user +o change Jer modify the relation (schema) ef +he | a tabie Which is already created by a Create 4. Add a drop P_Primary key For +he table G. Ada _or drop +he Foreign key For x table. 6. Add or crop the uniqueness constraint For a table. _t. Add or drop Check constraints Fer a [eie. Some of the examples are cliccussed below 1. Alter Table Toorsytr a Add Subject char C'5) @ Om the above example, an existing table ef TDoLYsTT is modified Ditha new column is added as subject Which was = Det Baie re. eqorlier, 5. ntegrity constreunts over +he Relation. oo eo The term daka integrity refers +o the correct | ness and completeness of the data jn c datobase kihen +he contents of a databace ore medified With +he TNSERT, DELETE, or UPDATE statements , the jotegqrity oF +he stored dain can be lost in many oifferent Ways, e lo presevve the consistency and correctness — Loe j#s stored data, a relational OBMS typically limposes one or more data integri | constraints. hese constraints restrict the data valkies thot can be inserted into the database or created by a database Update. ie Validity checking! ee Every column iq a database has om . dlomain, ja set of data values that are leget For that J column. The OGMS can be asled +o prevent | other data values in “these | columns. 3. Entity lotegrity: ot | ~The primary Key of a table must contain @ unique Value in each row, which is different From the values in all other rows. wi hh us Duplicate values are illegal, because theg wouldmt attow the database +o distinguish one entity From another. The DBMS can be Forced +0 enferced this Unique values constraint. Sp lay es §. Other data relationships : — le “The real-world situation modelled by % clatabase often have additional constraints that qoverg +he leqal data values that may “ppear in +he database. LU jee The DBMS can be asked +o check modif- aieation +o the +ables +o mate sure that (their values are constrained in this Way. re 6. Business rules | | j e Updates to a database moy be constrained business cules governing the retal-word transactions that are represented by the | updates. For example, there might be a business such as the new employee should only if the aqe oF +he employee amines | a ae a ve Pdvantaqes ancl Disadvantaqes oF ROBMS i a» Advantages 1. Simple clata Structures: storing +he data in the table Format, omes easier for +the user to underst- the structure of database and use e RDBMS Provides data acess using % Natura) Structure and organization oF the data. a — e klhemn +he user are writiag a queries, data- base queries cam search any columns For any matching entries. jauows the multiple database users database simultaneas! SS 7 - —_—- | G, klet) cleFined privileges oa Aer tT - Authorization and “privilege contro] Features fin @ RDBMS allow +Re catabase administrator — + —— = _ +o restrict access +o cauthotrized users and [grant privileges +o individual Users based on the +ypes cf database tasks they need +o perform. 4. Network Access: RDBMSs provide access +o the Clatubase through @ server daemon, & Specializec| software = Program fhat listens For request OF anetwork, and allows database clients +o connect +o and use the cdatabase. ae eover ON TO OATABASE STRUCTURE INTRODUCTION ; SS a le Ln traditional system , each collection of _w application programs hat i+ own independent ces File . The duplication oF data over | master files could lead +o inconsistent data mee. rt early clays ,efforts Were discovered to use & common master file For a number of | application programs resulted in probtems of Lintegrity and security. @ First step towards a OBMS , packages [omieeitec Sf J @ The schema js +he structure of +he database and the cata is +he facts of the database. Levels OF AbstractionIn OBMS: ve Database management can be clefined in [the way in Which they use their data dicti- | enor @ Data dictionaries ave helpful for at) human Users ,especiatty the database administratoy as wellas invaluable te the application s and repord generators thot might (progran Seeees the dettbase: xterne2 View |e The three levels of ; perce olutabase architecture (1. External Level: 954]: way individual (concetAed with the user observe the data, | (2. Conceptual Level! Te ean be regarded Pee UNH, User view a Formal | description ef data of intrest 45 the ergonisoction 7 independent oF any storage considerations. 1 T | | Bmentennal: Level: It ia ax concerned with +he woy 19 Which +he clara is actually used. T keep info on My program can access Person rohit L end Usert frem RohiFS customer bas > ’ |_programner | ies view ees Leiofermation at > different levels of ae architecture MEE Boy pe Naive use r e The +he permanent “opp lication | eee phat | eatled +ransfer. C have Been writen previously. pac + Fs Example? oP ry gE Suppose the bani teller Wants +o “pransFey +he money after maturity of the fixed deposit amount of @ partictlar r | customer , Needs 4 invoke a program & : ! QZ | Application programmers? e@ They are +he computer professional Who interact With +he systern through Pm calls, Which are em bedded in a prograun | written In w host programming language. prea ost ese e catted the ome piles, converts the PML statement oTmok procedure eells in +he host uUrous—. Eo Meer : Be aa = — : . Se Sop isticated users: : de r le These Users interact With the database r i using database query language. P — _ eThey submit their query +o query processor x e then Data Manipulation Language COML) | functions are performed on +he datab- ase to retrieve +he data. e@ leols used by these users are OLAP € Online Analytical Processing ) ancl data ming =Fo ols. @ Carious-- programmer Specialized users e@ These users write speciatized) database plication +o retrive data. 4% Role of Database Haministrator. A persem having Who has “cent al contro} over clata and programy that access the dota js cated OBA. Follousing “are the functions of +he OBA: | (@ Schema defination: DBA creates databa- se schema by executing Data Definition | Language COodL) statements. e Storage structure and access method _ defination. eGranting of authorization for data access: | DBA can decide which parts cf data can be accessed by which Users, Before any user access the data, OBMS checks, which cight= are granted +o +he user by the OBA. ewithough a -Fransaction 1a an evenr Which eceurs of +he database “Generally transaction neads a value Frem the SctsSeserene tite epvalleatoyene "| decteus ose a A read operations does net change the image of these database 1 any way [The four Properties of Transactions: stvery Hansadtonmpaa-Ohatever purpose it is being used, has the Following Four properties : eee] the initial letters of these four properties we Sollectively | cot thery +he ACTD properties. 1. Atomicity:, This means +hat either alt of the ane ORS within the +ransaction will be feFlected inn +he database, or none of therm Will be reflected, - Eroonmyyte’ 2. Consistency? @curious=. programmer TF we execute a particular transaction in isolation or together With other transaction, Ci-e. Presumably | ine Multi programming environment), the transaction will yeud Mes | Tsclation ene toe TA case muttiple transaction are exewt- ing ey and trying +o ace resource at the same time ,+he system should create an SS asharable a ordering in their execution so +hout | +hey should ot create Tany enema in the value stored at the _shorabie resource, 4 Ourability? Te states that once ao transaction has bee Sey phS +he changes it has made should be permanent, Database Structure: ea database structure ,+he osms acts as an interface between the user and the database | “TRe user requests the OGBMS +o Perform Various operations such as insert, delete, update and retrieval on the database , TRe components of DBMS perform +hese requested operations on the dataubase and provide necessary deto +o the users. © Curious_. programme [The various components of DBMs are shown belous: End OBL = >] Co ed fi OML Compiler eimcoua |. Query Optimiser compiler % + compile: Data : ft OM Dictionary| | Structure of DBMS 1) DOL Compiler Data Description Language compiler pTecesses | schema definitions specified in the Dor. Tt Jincludes Metaclata inforrnation suchas the Mame of +he Files . data items, storage detalls of each file, Mapping information and constraints ete. @ Curious—. programmer 2) DML Compiler and duery optimise. The DML commands such as insert, update, delete ,retrive from the application into program are sent + © +he oMmL compiler (| fer compilation into object code For database eee ue tee eae +hen optimized lin ead Seis to execute a query by hen Ue y lsc Stineaseel then send +o “the data Manager, : 3) Data Manager: : the = ~ [UheDekeelMandaeg iar heltc etre soFHoore SO Poesia eae Tee aes Seinen owns as Database Contre] system, 4) Data Dict nary: Dota Dictionary isa repository OF description _ eF data in the database . Tt contains inForMation about *Data' names of tables ,Names of attributes OF each +cable, length Of attributes ,-and Number of rows In cach +able. [ @ Relationships. between database transactions and data items referenced by them which are useful in determining Which trans acton . @re affected when certain cata cle Finitions ace Changed e constraints on data le. range of values Pern itted. @ Curious — + programmer ~_S) pata Files: Tt contains the data portion of the database. Compiled BML: The Om com piley converts 4the high level queries into low level File access commands know as compiled OmML. ___.#) End Users: They are the users of the 7 system Who is going +o use the system for their day +o day activities. _@ Curious —. pr og rari er ae a, _[streduction Te Data Medels Ty e Lt ts a Ccleay model which specifies how the data items care arranged in given model}. e DBMS organize and structure data so that itcan be retriveqd and manipulated by oif-Ferent users and application preprams. e@ A data mecdel determined both the | personality of a OBMS and +he appiica- Hons fer Which i+ is porticularly “uoett suited. The data structures and access Fe chniaues provide by a particular coBMs are See data model. eo J Evolution ef Data Medels: e The First 90n -propri etory programming language U2asS COBOL and with Cosco. ¥F latey FORTRAN» programming became Vey N +he — Found action of erecting enter prise computer systems, 4 . o The | system d veloped Needed +o store is eT gata someuhere ond +he programmers designed More of tess prvptietory and Specioized solutions for this purpore. Te Dn 1964 +he First commercial database management system Was born; IDs - Fntegrated Data Store, developed) at General Electric, based Upon 29 early networle data model developed by Ck! Bachman (Bachman (965) © Dn Ba Edgar F. Codd published 29 fanien erreres & Fundamentally | different cpproach Ceodd '970) be article @ Curicus_. programmer “Types oF Oata Model: “There cre models: Four different +ypes of data a. Hierarchical database Network database 3. Relational clatabase - g - q g L a L . Object oriented database Hierarchical Database: Sales Representetive a Customer Customer contact #4 Contact #2 2317 | product Line 4 2319 | Procuct Line 2 root 2487 | Prockuct line 3 | @Curious-: programmer used With matnframe System oe Ot is one of eldest methods of organizing 7 @ Hierarchical Database is most commonly | L and _stering data and itis still by some organisations For makin +ravel reservations. @ A hierarchical database is organised i "pyramid Fashion , lice +he branches ofa +ree Se downwords. ~ Network Database; Be —_ Morleet Peserch : Socjal security Fnfo Nlame Human Address, Resourses Telephone Tob Human Resourses Function is owner to LU B records. Management Mearleet | aes Research $ management Group are ooner to only certeun ee embers. Curieus_@. PTOGTENM e+ | eae o Networls database are similar +o hierar LEshical database by alse having a hierarchical structure .Theve are a Few ley differences, however, oF looking like an upside -down work database looks more like | pecords. Ta network database , children are caued members and parents are called owners, Re lational clatabase ° Pre -velational medels depended upon being able +o determine explicity Phere and how individuog records were stored. . Farly relationog proponents argued +hat +he relational data model viewed informaton logicotty rather than physically », but +his | is not quite correct. h e The relational data model joeks ot informotion as 49 unordered collection oF relations: I ie e@ Fach relation is "tuples of the Sam structure. popwiated with unordered e unordered " Field" Curious-- gram en ‘ Object Oriented Database: 0 0 data Model is a logic organization oF +he real World objects (entities), constraints on obec m, and the relationships among e AQ DB language is Conereare syntax fox a data model, 0 2B “system implements a data model oriented data model consists OF the Following basic object » susie Wea Gee tata a oe Sn ok GO oriented concepts. — 2) Object and Object jdentiFier 1 Q) attributes and methods a ul 3) Class 4) class Hierarchy ano} a yy b —__Aavantages Ard Disadvantages oF Data Modelst . Simplicity: on the hietrchicay structure) the rein [Camlin|rce | Since the database is based ship between +he various layers is lo gically simple 2. Data Security: Hierarchiea] model was the first Clatatbase mode! thar offered the data security that is provided by 2 he DBMS. JP isadvant ages: 1. [Sesignemipeenestoeicempl LP . Database database structure 1 make ehange> Implementation com ple xity! ithough iris simple and easy mon fo iMaplement. TMeanagenent Problem: wm malice any changes im the then you need to in the entire application Fre database. | “TF yo! SS regres that acce OB etieee aieieetene - a Advantages - : 1. Conceptual Simplicity: 1 . _ UST tikee hierarchical model it — also simple sod _sasy to implement : Saath doe rll a — Sebi Ii ~ ae a ja. capa ity to hhande] ¢ 2] more relatship pes: aPety te hand pied _—the Networle model can 5 Randel one +o Ss ene t'2 and many + many AN Pel? ship | . 3, Fase Tomoctessidarmthelicarisccces= is easier +han -+he hierarchial model Disadvantages: 1. System Complexity: @ir the records hove +o maintatny using pointers +hus the clatabase structure becomes More complex. 28 Operation inom css: As discussed earlier in network large number of pointers ts model insertion poeietion and required so Updetting mors complex. dvantages t 1 conser! Simplicity: cle have seen that both +he hierarchiag as Medels” are conceptually (but relational “model is” simpler ©F +hese too. 2. Stractura) dependence: “Fn _ +he_ PRelationg| model, changes in the structure do not ofFect the dare eaccs=) Disadvantages: 1. HardWare overheades’ The celational database systems hide the implementation complexities and the Physical data storage detatls Frory Fhe user. For doing this, the relational database system need more powerful computers and clata storage hardware devices. Q. Ease FO design c9n lead +5 bad design. he relational database is casy to | design Gna lee ihe vacr needs not te knowrnercamplesities oF the Aare Storage. Curious =: programmer Business Rules: o Business: Rules helps empicyacs focous ; en and implement 4ne organizations Actions Within +he environment : e Some things +0 think about when creaking , business rules +o keep ther simple, easy - to understand 1 leeep +hem broad so +hat : everyone 289 have a similar interpretaton . To qbew : considered +rue business rules must bein, Writing and lkeptup +o Departments —-- (OF fers — = - --Ccourse course — ----- = generates — — —-class ProFessors——---— - teaches - ----class ¢ Another , important ‘Aspect “of business consist of how the rules are the | compony. “Database Design: he dotabase design process aia oF a number of steps licted below: 7 Step hi Requirements Collections $ Analysis: ——~, Prospective users are interviewed +o i | pndenaronamencrcocumenn clara requirements —\.This step results in a concise ser of User requirements , Ohich should be cletatled and complete. * Functional requirements can be documented using diagrams such as sequence diagrams ) data Flow diagrams ,s [Camnilin| Pose Det — —| ER Model: Qn $916, Entity felatonship model developed —T py Chen, a ER Mode! is high level Concep+ual mode! which used Conceptual design of database Where 25 relational model ore used +0 Logical esign oF database. e ER diagram: 0% database can be modeled as CH collection of entities Relationships among the entities © fn entity 15 aq real world object that cxist ond it is distinguishable From other entities Pron pleemhe rs p7 compsny pevent, Plent Pilleaine teenies in the data model have is KNOWN AS properties OF e mMames Cind addresses 4 ies [Carniin[ Fe © ER Diagram: - 7 i a f ——_4#___\___ Zz ———_ lores > Deportment e Pectangles represents entity sets e Diamonds represents relationship sets. e Lines link attributes te entity sets and entity sets +o relationship sets © Underline indicates primary key attribute. le Ellipses represents an attributes _e Double lines represents +otal participation of an entity in a retationship set © Double rectangle represent a Weak entity Sete Strong Entity +ype : ew An Entity type Ohich is independent on some other entity type icatled Strong Entity +ype ‘ v = [Strong Entity type is a . rectangle Symbol 1 aS. ok eee | a + | Casiemert a noD) se Ui a Re : | set 3 [| Customer ar | a = . a Custorger Entity kleak entity Type: Entity type Which ts cepencdent en a strong other entity +ype is catltecl Qs Kcleal entity | tyre: | @ kleak entity type is Cependent on seme I StS entity type +8 dnd cannot exist on its ew we Tt does not have @ unique iclentifier that has partial identifier ; @ cur US — programmer : _ | [Camtin[ ra kleals entity type is represented by double a | rectangle ‘ ‘ entity For primary lke AH rbutes. Properties of an entity or relationship _ type is Catled as attribute. Attribute domarns: | The set of allowable values hich is eee +o one OF MeETE attribute is Known as AtHribute Clommatns. There are types ef attributes has lbeenenalassifieda Such as simple and Composite +yPe, single valued and multi valued attributes stored aod derived attributes and Key attributes Ot ous programmer ‘ [Camiin| rave : ome tt Relationships: ; —— J a ati leslie el CO set oF Meaningful relationship amen severaq] entities, a ay kle used +0 indicate +he diarnond ~ ‘T\symbol For Relationships among +the | several entities , it could’ read Frem left +o right aol 4 Example: Branch has a staff hn Degree of relahonship: Ttis the number Of entities Participated _ in @ particular relational model. There are two type of deqree of felationshi . ~ Relationship set; - “The . \s collec tion oF Similar known as Relationship ser. [Coarntin[ rece Bae relationship E Constraints en relationship i _D) Mapping Constraints |carvdinalites $$ aa he ounber (or range) of possible entity type that is associated +o another entity type through @ particuloy entity. Cordinalities indicates that a specific 10 entity occurrence OF related entity, “Type of Mapping Constraints One - te—one (1:2) One —-to-many (1:*) Many - to- one (* : 4) Many- to -™any (etx) jcipation Constroxnts si EMadari'fclas : portici pation e two type? ofsconstracnts * Every Instance of +he Pirsteoeagty ee Toust share Wit on or ir: re Mnstances of the relationship Sa eC eenoreee ome here ar: «Total Porticipation . a al a eee entity Wee The total participation is by a dark line or double relationship and entity, represented Nine between the , ilies Grattid + aS, ak oe eae [Branch /}—=——allocateds— S+aFF S Every Branch office is allocated members of staf ; « Partial) Participation: “T here enist an instance of the First entity +ype that don't shave an instance eof the felationships type Sith +he othey Lentiy tyre =a © Curious-. progtamny en RD) STAFF RH member of staFF need Hot ota Branch office. Worls c "Representing Relations: Lo “3) cardinality Rat Ratio Notation: a this method, cc ardinali —~ Cok binary relationship): “1:4 ,4! ——— iN ; Shown by Placing appropriate cumbers on the relationship edges Number of Staffs WDorkingin Branch L At least 5s staffl i auecated 40. iatancHe . —_«@ kimitation oF Entity Relationship Model : fi Problems “ay arise When clesigning a conceptual deta medel catled connection +raps. e Offe9 Ane +o a Mimtsinter pretation of +he meaning of certatn relationships _@ Extended Entity Relationship Model: Since 1980 +here has been increase a in the Emergence of new database oa ed application Oirvys more demanding applicati on. CUrious -. programmer foc Basic concepts oF ER modelling are not | sukFiaen® qe preprese nt. the requtrement at eee 7 more complex operation, i "Extended FER Model is used +he concept of ebject oriented such as inheritance J IA some case, entity | “type has numerous ; 7 sub > = grouping of its entities because that —— are meaningful way F For repres entation ——“Gnd need to be explicitly defined _ -— | Becokse of their importance ¥ An entity type that includes distinct 7 Subclass that require to be represented a (Alene ce Cues Cmmomnaetee cs toe cree) A Subclass is a entity Fy ee oe ie dishneecolegeenel ia felsopa em eer oF the superclass StofP ts tne super class Where as maeaereryn sclosmpersonne) manager is the subclass. | [Camiin| rece Date 1 | — fType Doheritance : SS 4) re type ofan entity i= defined by the attributes it possesses, and +he rei%ship +y pes it potticipates nm. Because an entity iN QA subclass represents the same entity From +he super class, it should posses aut the values For VS attributes, as Well as the attributes as a member of +he super class. | Specialization 2 “The process of defining a set of super class of super class. @ Curious —- programm en ‘The specialization is a top down _ appease ef super class and subclasses “tha is -based on aracteristic. serior Sub classes The isHingucrshing ch Secretary | [Sates persome) | ° Notation For Specialization» 0 16 represent @ specializaton, the sub classes that define a specialization ape edttached* by tes +> Q circle that represents the specialization » and is \ 2 Reasons for Specialization : p e - : eo Ccertats attributes ma — but Not all Pe TEY te serie entities ofa Supe 1 i iy class, A subclass bs clefined in. order +e gro = the Sea ememen tone: meres. t Sri se ‘ _e The = second “reason Rae using Subclasses is) 5 that some releutionship ty pes Moy be | RavHeipated in only by entities that a s are Members of subclass. x ¢ Summar OF Specialization : : . Y Pei alization * a — Miiows For: __« Defining set of subclass of entity Ayre _« Create additional Specific attributes Per each sub class. 528 @ Curious--progs « Create additional specific relationship types bet +pes each sub elass and « othey entity types OF ‘other ~ Generalizationy - e Generalization 15 the veverse oF Specialization and this is Q bottom -U“UpP Sphroach 7 FH Generalization , there are several Classes With common Features and Eater egy iigit-O sl Culm CGresr cleus = GtaFF no (Rddress Stale Tees) Secretary | | Salesarea Attribute Tnheritance: ean entity ina Subclass may possess Bubelass Specific attributes, as Well as +hose associated With the Superciass. 7] @Curious —. Programmer [Sales personne! | classmate Date ) (7 page | CODDISERMaiermay ru / pees | Dee codd as inventor of the relational H bs | database model. This model say that Whether the Database management Follo® the relational model or not and Ohat extends Model is relational. system “phases hele rientioneds by) sOr EIF- codd thot according to these rule, there is 70 Aatabase Management system Fully implement atl the 12 rules What he has been specified. IH 1990, The cedd rules extended [2 +o 12 rules thats includes catlog, ddtaty pes, cuLthorization etc. Codd’s rule in detat!: 4) The information rule: ) au the information i the database should be represented in the term of relational or table. Tn formation should be stored as an values in a +ubles. I Data should be stored in form a table and no other means +o stored +he data. @Curious... programmer ¢ Guaranteed access rule i) The guerented "access Hil Gara must be acct essible . The Rule say that +here is Fundamental requirement of primary key _|| for each record +oble sand +here showd be no ambiguity by stating the table NAaAmMe and its primary key of +he record in the +able along With eolumoas Name each to be accessed rule ii) For accessing +he data From the +atbie 1we must provides Table name, _ Primary key GNd cther column names ind +he record +able +o be accessed e Systematic Treatment of Null vatues i) A null values means that we dont know What inferrnation must be provided or entered if to +his Field name. it liv) Nwt values must be handled Togicarly | and consistent Manner. cHve online catleg based 09 +he relatonal mede}. one eystery must support an oniine catlog based data dlictionary Which hold the information ©r description about the @ Curious = programmer ) page able |i) User Tables: The user table contains +he data about +he +able Which is created by any Users in the database systems. ii) System tables. The system table centarns the data about the structure of +he database and database object wv) The collection of the system +ables is known as +e system pat ings or data dictionary. |5) The comprehensive data sublangucge rule: T i) The system must Support at least one relational language that +hrough Which the data in the database must be accessed — ii) The language must support au the operation of the Fonioding ttems: Data cleFination View olefination Data Manupulation constraints Authorization Transaction boundaries C begin: commit F roiibactz) @ Curious —.programmenr atte ie 6) The view updating rule: classmate. i) av the vied must be theoretically Upd ttable can be Updated by the Systern ii) There is ambiguity 19 this rule, the Structured query language support a single updation ata time suppose if we try combine +wo or move tables a For O complex views and +ry +e Reclce ee e aie eOrsmmmci cnn hen eyIS Ets would Fatl +o update the records +o the fespective tables, theresy violating this rule. Eg FF Reli-no column is Net present in the viewo +hen itis not possible update +he view OF the s+uden+ +ab le. 7) Tighalevel , Update ,and delete: i) This rules states that in the relational model, the structured query tanguage must performed data manipulation such as inserting + Updating ano deleting record of sets of row in tHe +able. Our US. prog Tammer classmate Date 2 - ( "han Lavan se bem i) Consider an example ,;1£ yor Want +o || delete +he record cf +he invoices table which are oldey tan six years ;you have locate position each record and delete them individually you Shouldable 45 delete set of records | in the +able Using one single command. i) The same concept can be apply to inserting and updating the record. 3) Physical data independence: i li) Aoy change Made in the data is physically stored in the File system through array and link list Must not |eFFect application that access the data structure. This rule say Hat any change is made in the back end must not effect Front end application — DF the database File renamed or database location is change: then this Should not have effect of the application. @Curious -. programmer 9) Aegical data idendependence This rule state that change in the legical level must not change +o the application's structure. This thle state that i+ Should possible to change the database design or alter the database but the design +e Without tne user begin owoare of i+. lo) Thtegrity independence’. Data integrity constratnts should be considered as seperated From application program, the Structured query Language Which defines data integrity constraints must be stored jn the database in term cf data in table thatis, in the eatlog and oot in the applicaton. Referential integrity and entity integrity [is integral part of the relational database, 190 More specific term 1the Following +00 integrity should be apply to the relational database, @Curi ous. Programmer | _ classmate EF. Codd first proposed the relational database Model giso he is Known gs the | Fathey of Relational model. Relational medel Was attempt oF specify || the database structure iq term oF | matrix. ie the database Ghould contaty tables. The tables is in form of setoF Columns ONd Rows. The relational medel lis set OF 2 climensione2l table consists oF reOs and columns. In the relational database model consist oF set oF tables having the woigue name, . Logicad View of Data! J Entroduction : fogical structure of tables is consist OF 2- diemensional tables consist of nos oF horizontal rows and vertical columns ra column Table @ Curious —. programm er classmate Table is an abstract entity Which does net say how the data is stored in +he | physical memory of the computer system t eee Ls | Each table in +he database has its [own unique Name +rough Which we can ceFer the content of the table by the | unique name. 2) Characteristics of an table: Dia eo ble=sini tt hew@elctrtb es emia tet beyn the +Wo-diemensional structure Which consist number oF rows and columns. ii) Each row in the table is called as record or + le can represent as a single enti P x Which js occur within the entity set je. Customer record in the Customer table. ii) Each column name 19 the table is called as attribute and each row in the table is called as record. Each column name i9 4+he table is unique name i-e. Mo duplicode Mame in the same +able cannot be repeated. iv) Fach rows] column intersection represent a single data item. @curi OUS-- POY Yammer classmate. v) @ll the vatue in the represent Jin the same data Format vi) Each columns has the specific range oF values, Qnd also refer as the domacn attribute. vi) The order of rows and columns is | Not limited to +he OBNMS, \3) Exanpple: There is customer Table contatn att information about +e customer Ccustomer_id Customer Name cust Age cust_ Address cust. Mobile No. | [eust [cust [cust [cust | Cust id Name Age | Address | | S¥9294e123 | Ramesh 3° Bandra | 9324629573 | Mahim | 82 9243556 | | j Eero 24 i khar 72929177 6| e Yatin 25 Dadar | 97397967427 FTushar | 26 Mat ou |e] jr p g is F 9373 47623) +4} Attribute: leFach column in the above table represent the data item in the datwbase “© Curious

You might also like