You are on page 1of 30
INTRODUCTION TO DATABASE SYSTEMS 41 DATA \ The word “Data” is plural of “Datum? which means 4 single picét of information, statistic, or code:.A collection of raw facts and figures relaled to. an object {s.called Data. The object may be a’ person, an nization, an event or any other thing that significant'in a system, Data may be in-the-form of text, numbers, images, sounds, and videos. “Data is ‘collected: for different purposes. Ht, cur be processed to produce meaningfal information like reports, charts,-and webpages etc: : In an organization data is as tmportaiit ‘giblood’in-actuiman. body. It gives view of current aitd past activities of history-related to the vise and Fall ofan organization. It helps an-organization inmaking decisions:for future. activities. Example: etn Ae Ac list of class students; showing students roll ‘umbers, names and marks is an example of students” data, This type-of data‘may ‘be. collected: to, prepare the result of an examination of students: The unprocessdd.datai of Students may look like the following: i Saleem "62 68 64 2 Babar 50 75 70 % Amanat 90 80 70 4 salma” 75 80 60 : and there is:no proper labeling of data yalues..These facts isfy the definition of data but these facts’ (ie. data) are useles! ix this form: Tlius in.arder fo completely uiiderstand séme' data, it, must be processed according to: the requirements in A system. Data processing is being. discussed inmext topics of this chapter. i 1 | The'abave data does not votivey proper meanings because it has no main beading pol iol a p Database Mana; ructured ured Data &UAst a called, structured af numbers, characters, and, date s dlatg for f ae rhia data of chass students includes facts such mate ad telephone numbers: This Mata 15 iy vagy Sots ie an oxumple of structured data. — sevent may be in the form of photographic images g, ee is called-uasirwetioed data or multimedia deta, Jiécied:and.slored on a media such as dis f photos: will:be the: unstructured data, 14d, Struct ‘The data in the Suppose data of elas st ag students rotl numb jumerie and characters ai abject 08 in This type-of data i Guppose the photos of all-cluss students ar 20 inthe form o; js type of data of class students. we and unstructured, data are often collected about an object or a These days steuctured 1 are of ¥ | ve pee purposes. For example, a ‘college collects the nanos: addresses, i 7 slept winbére, and photos of all sludents-foF creating database of college students, ‘ele a ; The faces of maps; sounds ared vi Data can be qualitative'dr quantitative: | ‘ ©. Qualitative data:. I,is- descriptive information:;It describes something;-it-can be observed but cannot be measuted. Foi example, Mr. Sagib bas white color, This cat is very soft, This:painting shows some masterful brush-strokes, ete. * ‘Quantitative data: It is:duthéri¢al information (numbers). Quantitative’ data can further be: divided into:discrete. data aiid continuots-data. Discrete data is coutited. It can only:take certain Values like, whole, numbers, For, example,-Mr. Saqib has 4 brothers and :2-sistets. Gontiriuous data.is measured. It can take any value, within araiige: For egampie:: + i 4.4.2 Qualitative & Quantitative Data: ro i | « ® Today tomperattite has increaséd-up to: 34.5 8C, *: 7 The car isirunning’ with’ speed betWeen 80 t6 100 kilotneters per tiour: # On heating this object, its, wolume:ineréases-uip to. 5% , ete, 14.3 Typesof Data® : ‘Data caa be'divided into following-main lypes! 1} + i Da ; i ; Numieric Data, 2) Alphabetto-Data, } . Alphanumeric Data, 4). Image Data ‘ ‘ . 9). Atidio: Data hi 6. Video-Data 4) | Numerié Dats oe te | - . fi Numeric. Data ‘consig igi sts-of : i | deci Ela ora i af ee £ e a sane » Signs: and’ decimal’ point, 1s Chaptor'#t: 2>- Introduction te Database Syciemy ‘Thecmumérie data is.alsofuthe® classi ied agi Integer deta, [ntegerdala consists of positive vi negative wholé vahies jneliding G-Examples of integer data are: (302, +62, and -26. : Z : Realidata Red] Wate consisis of-vaiues that have décimal point, Examples of veal data-are: 15.4, 006,.4,07, -6.27 and 4.0 2). Alphabetic: Data Alphabatie’ data consisisiof all. the alphabet ‘letters from: AtoZ, « to-t and: blank spaces. Examples of alphabetic datvare: dqia, ‘Aslan; Pakistan, Asia ete. 3): - Alphanumerie‘Data a : wath: Alphanumeric dara consists of aiphabats. (boi: capital aid:small Letters), numeric digits; (O-to. 9), ‘aid’ spedtal “characters ‘or ‘Symbols! suchas #, 'S,. etc, Examples of ‘alphanumeric datg'are: 24-March 1940: 28-May LOOK, FLL ete “4) image. Data Image ‘data consists of charts, ‘graptis, pistuies andl freeh isalso represented by. bir pattems. The imag ind'diewings.. Image data: lata ib teansriited a¢-cortiguous bits: 5) °. Audid Data 7 oe Auxlio: data consists of recordiigs-of conversations; enusie; speethes or‘any-other type of sound. It fs continuous" and ‘not ‘disciet® -Thé-audio- day i inthe form of continuous’ voice signals. Jt is converted into. digital: forny’ before ‘entcring it into’ the computer. an pe i : eae 8) Video. Data’ 7 goa Video: data Consists of-video ‘récordings.of events; This type: of data. consists of full-motion images'that credte actions and’ imovebiéits. It ‘cans-be: produced by a video Catmiera, arnttiation application, or a.mévig-maker-sofwate, ete: 1.2 INFORMATION 5 An_organization collecis and stores dita-from Bott intemal-and ‘external sources, Usually, the collected daia is.not in proper format atid:does ‘not give proper, meanings, Various dperations are: performed on. collected data {O.get the requited: tesults ‘that give Proper and-useful meanings Known a8 information, ii means that processed data is.caiied tuformarion. The processed data (or informaljen) is used. foi-décisi on inating, analytical (Purposes, and fault. diagnesis ete. abase Managem. ‘i = 58 input fot Processi,, | io oe figure shows. the tee rr ilo g leel niques. vis procgssinB: Dal and derision ones — J inroRNATION | | piguie £1 Dae Progessit 7 ized using differen anc ‘summarize i ar aes cords.of students on th, fe, the suet is” dal ier net ‘nee grades and-ages-etc. 1 graphic form. Ee distels onregions; ta: cali’ be prices prosentt arks, ‘disciplines, a-stidents? dat tools. It cam also be basis ‘of their naies, 1 The: abave- -fentione : shown below: ge ae a - _ Result Sheet of Class Students : ee Rollo | Name _|-Endlish Chiemistry- computer ‘Tata werk Grate] PT eacem bn fe OO eves ee |. 8: - Le 2 - : Babar. 50 7b 70 495 | sed. and the Tesuilt can be a E 3 fAmanat. | 90 BO PE TB eh 2 240. Ay 4 [Salma Peek | Bo EP BOL tet A | _— z ~ “this ‘processed data. naw. gives. ‘a cleat and proper understanding of-student ¢ “2 names, obtained marks in different — “subjects, total niarks obtained, ‘and grade of © each student. To: caloulate: the total amatks oe of a student,.marks: obtained ‘in’ different subjects afc’ used as. data, The, caleulated “toll” matks” is the information, The Brotesed data can further “be” processééi; Tor eiaiiple, to find oiit the. grado: of the students, caleulated “total mariks"’is used as deja aid “Grade” willbe the information, \ Information. Decision is Copii da anc Knouie'gge informed 83% eS . Knowledge One "of: ihe main objective: of” dala ae oun pfvoessing is decisioit - : tei lig, as showy in tated Objective of Bara Process 1 io Database Systems Chapter 1.3. DATA PROCESSING , formation is called’ data The process: of converting’ data into’ meaningfl information i processing. Different operations are performed on-data to gonvertit inte information. The jmportant operations that-car’ be performed.on dala are a8 follows: 3. Editing, verification and conversion ofdatd inte aceeplable formats. 4 Updating.of data, as technologies changewith the.passage of time. % Classification of data. se Restructuring, reorganiization'and an alysis/modeling of data, etc. Following figure’ shows the data processing in an infermation system; DATA Canversion lOcgmni IStucturira Editing Verification. Gpdating| INFORMATION [Ma deting Analysis. © hfenm ation ‘System "Figtize 1.3: Data Processing h infovniation System...” i " Dafa canbe prodessed. iv géveral, Ways: Defending ‘upod. the procedures and equipments used,, there’ aré- three ways -of. processing datar These" are:” manual data processing, mechanical data. processing, and slectronie data processing. 4.3.14 Manual Data Processing i In.manuat data processing, data i8 processed: manually without using any, iachine 1 OF fool, Similaely, data is‘transfetred manually from one plice to another, This method of | data processing is-very slow’and errors may oceur iui the output: : In Pakistani, data js stitl processed manially. in many’ ‘sniall busihess firms as ‘well | as goyerninent offices Srinstitutions. , , : : Example: . _” ‘Aclerk in.a college peiformé following tasks at-the end oftmonth on His register with the help of pen or pencil. d ° u pa Z Pr ree eae TEESE eo terme were PETE RES ahage Managemen, jg-thabihave paid fees. pero sen” aid Fee8, hit have not P: feesfPoin students ipoted-asteesF0" f a v grawnr bythe stafrat (hab mont Total mum ae Total-umaber-ot Tata] amount coll tofsils 4 Total anjount fe iii Fiplag.f 4ibianualsData Processing: 4.32 Mechanical Data Processing “tn, meéchaiiical. data: processifig, dat devieos like. typewiiters, -calolatot; or other’ mec processing’ ig fasterand! more aecurate than:manual data provessing: tai is: processed using. different. ‘mechanical hanical devices This ‘method of data woot k : Example: e “ : in the above exaniple, a élerk in. {He-collége.pérforms all the tasks by hand: It-is very’ difficult and time-consuming:'methOd: Tf ‘He -petfoitns “all! above tasks ‘by’. the calculator; the process will.bécome easy.andwill-be completed in'vety. short time. 13! Mectianiéal Daig Processing i: . 3.3 Electronic Data. Processirig Electronic: ¢; “Pa data process Typically, in electra eo seine veers t : . cl ‘ally, in electrons: di 8 to the use’ of ; * data “processing, -ail auitomated-methods. to : t process data. Operatié i Ons on. dalaaré performed using Chapter #1 2 Yntroduet to Database Sysiems computer and software. Duta atid’set of instriictions are giveri‘lo the’ computer. as input and te, computer attomatically procégses the data according to the given: set of - jastructions, The coriiputer is also known-as, eleemani¢ date processing machine. This method of processing data is very fist-anid acturite, For example, in: a computerized education environment results of students are prepared through computer applications, if banks,.aecounts of customers,are processed’ and. haintaiied through computer software ete: 4 4, Example: .____ Hfa college have more’ than-1000 students and-a:clerk wants t0-¢arch the records of specific students.of a class such ar. : > Students that have-ges imor¢' than | Sand legs than 22 > Students.that have passed allisubjects as ® / Regult of all:students of'a ciass inn’a partiulae subject ote: It is.very difficult to-perform the above tasks bir using manual. data processing or mechanical data processing: These. tasks, cah -be: performed .wery easily: and quickly by usitig computer applications.- . eS "16° Blectroni¢ Data Prowessing 1.4. MANUAL FILE-BASED.SYSTEM 5 / is. ii rds~ ping: rganization, In this This is the oldest'systent used: for reedids Keeping in an organization, sydiem, 2 sel of books (or files} is prepared: Bach book. or file holds a particular set of inforination jn the organization: Each: department ‘of'the organization hag @ separate file (or set of Files) for every significant:task of the department: The informition is-shared among: different departments through files. Typically, there’ are many such: files that are labeled.and placed-in: one or. more cabinets. For-security, the cabinets are Yocked or-may be located’ in secure areas Of the building, - : Let us considé: : é maintaining, records. of: student§ and’ courses. of vdifferent faculties: ‘éto. Suppése’ this mariual file-based systern-contains the following files:- + an, example -of & collége’s-iianval, file-based: system for. sastaesiener ine oe pM Sexies #y Database. Managemen, ‘de ofeach student . ord files It 1s used’l0 store, records ofe * Students rece rdaiof students. jw used 10 store fec records:of st se Students fee file 1 iv used to 8 amas dents: * “tw cn S : a Lis used to store result-of examinations ©} a S$ resul 7H is tse i igi * ea ‘ jae file: 11 is used to store data-of courses: taken by studeni Students cours q e-based syste! a ized approach is adopted, where hk sual file-based systéins, normally decéniralized approa dh oy nian s h tent processes and contrale:its-own dala. eal masual. file-based system a U wwii data. A:typ: mat each denen ent p ouniversity managed by different departments of auniversily isshowa in-figure 1.7, Students Record ‘ MATHEMATICS a DEPARTMENT [o> 7” Siidenis Fee Students Resul Course File | > Students Record, Studérits Fee: : Studerits- Result “Course Bile ” COMPUTER. DEPARTMENT Figure: 1:7: Meniial Bite-Bavéd System, of University thd Disadvantages of Manual File anf Series we Database Managemen, admission office is used.by xe file created and maintained in rae's GFTICG. : to regis s-filetis also forwarded %0 ‘ : 7 office contains information about wgtudent.dat” file are used by dent schedules and class tists, # “Student.dat” “Adniission” program tele on ‘ ealed in registr “ dat” data. file crea cs we NComseste different subjects, ‘This file and Schedule” program-to.generate individual, stu “Sel ra calculating pay ang ired for : 4k Tho “paydat™ dita file his information| required, For Coe TO if P file is-ised by i roil sheets: The.“paysdat ae Pi yged to create payroll of the empl5yees- 4.5.1 Disadvantages of. File Processing. System ‘ iceoia ‘ , : nua! ze) *T”atthonar «fe piccessing system nas many-advantages over the salons seeping system, but it iis also:same liinitations, The-badic. disadvantag af file processing-system are as follows: : 1 Data. Redundancy: Retiuddarigy means multiple eopies.of the'same data. In'a file processing, system, each, application progrant bas. its own set of data files. The saine.data may exist in’more than one -files. The duplication, of data creatés many problems, such as: () : - To-updlate specific-data/redord::The same;data must'be. updated in.all the files: otherwise different: files ‘thay--have different: information about a specific record. : : Gi). A-valuable storage apaoe'is wasted due to, duplication 6f records, Por’ example,."in’ the.’ university “ényizonment, ‘admission. office “ereates the “studehtdat” data file. This:file contains the iriformation of students ‘such as roll ruinbers, “nates, and addresses ete,, Similarly, thié.registtar’s-office creates fle “résult.dat”, which contains. information-of students. such as:r6ll numbers, names, addresses, obtained marks of subjects,-and results of all: the examinations etc: Inthis case, both ofthe files ‘contain roll numbers, nanies,-and addresses:of the students: The same-data-of studéiits ig stored in ‘iultiple files. This is knows as daca'redivridancy, nese nO 2, Data Inconsistency Dats inconsistency means th , e ‘at different files:may:contain different i i “particular object Or person, Actually redunda ar trees data’is stored at multiple locations, ti » the'inconsisteney m Sincé, the data files are: maintained: the d y other-depariments‘also. There TRY -contain: the: old» address, whi nee ineonsistency Chapter #1 = ion e se pte #1 65 “intioductin to Bataase'Syetomg Mm 3. Data Isolation In computer file-processing sysiet fala ia i . u system, data is stored {or Wgolaled) in various files. Tt Behos very difficult to-nccess the desired:informatiop from: data files, For example, if He s : resses. of students are stored in the data file “yiudent.dit” dnd examination, marke ae lents are stored in: the-data file “vesubt.dat” apd now we need «lata from both. fites, With compiiter file processing, it, ts u-dilfioult job, The programmer must serite’a new, » » program to extract she required-data from both data files. Data Atomicity . ‘ . -An‘operatign. ow dain may consist of. different step’. collection: of all the’ steps required 19 complete an-opefation on data is:called ‘transaction. Aiomicity means that cither.oue trarisaction-should take:place'as:a-whole or ‘it stiduld’ ol take place at all. This ig called-data atomicity. Suppose. your want \to-transfer- amount of Rs,15000/- from account X to accourit,Y. Thisprovess consists of two_steps: Set Step-J: Beduet doit, of R61 5008/-from ace Step-2: Adi amouind of fes:] S000! 00 uccount: Suppose ihe! systent fails {e.8;-dué to power-fallure) ‘after ferfoimming Step-1. It éans that the amount of RS:15000/, Has been deducted. fom accoulit X but has.not been added to aecount Y, Thus the data.aeoinicity problem: has been‘éreated, This problem usually Géctirs in transaiction-based file processing system like banking system,» ¢ 5. Program.Data Dependency: : : 2 in file processing, system, the ‘dala stored. in: a'data, file, depends upon the application program through: which the data file was.created., The-structuté of data fileis ~ defined in’ the-application progam, Itis diffieult.to change. the steacturé of data file. Tfwe want to. change the structure ‘6f-dala file, (or format-of file), ‘then: we chaye-to modify the’ application program also. This: problem of file-processing. system, is-knewn-as progranr datg dependency problem. » oes 6... | Difficult Progeam Maintenance. - ; data ‘fle. depetids por rhe -application piogram: aia field, its data type etc.) If ait organization bd. an ganization, has t0. pay alot: In file-processing - system, . Therefore:‘any modification: in 4 data file’ (suchas size of di requires thé redesigning of the applivaiion program also: application program: déveloped by software: company, then or of money for the maintenance of the program. pM Series 4 Database Manag, Lirited Data Sharing aoe goon Hae i lication program esp ti fle ress see a to: Seees data from @ data file created 5, ¥ Becomes diffieult-for ax application program to. a oes very iar ; other. application program. Thus the file processing syst : \ to sharé data among:miiitiple. users; 8. Security Problem . x soa ‘ 3 illeg The file processing systent does not provide proper ee Aevel oe of data files, In-most-situations, it is required to. provide dit s eects if -aceess'data for different groups of users. For example, ina Sales System, Mes ofusers may work as.shewn in the following. figure; Busiiiess Office 3 . Ke Sales Team’. | é : cs 2 ey Sales-Rers‘on ey ne fs. “Custimer P Figure 1.9: Groupsiof Data Users: ina Sales System: Here, {Rc customers’ shoul be allowed to only Persons should be:allowed: sate ee ee “lew atid purchase! produeis, Sale * The Sales Officer should have the facility 10 shod orden fou Belly to view protees ¥ . ¢lete.the oi, e-file: processing ‘aystém does not. provid eaaleedalealso! 3 + Sptions) = Pe ler Provide stich types of advanced: secuit 1.6 DATABASE a inition: of database, the vora « : stored in such a-way’that-it-can ‘easily the tee ne Wword “organized” thang thar dant related. data” means that a dat ~ Accessed and updated, gin; 3 suchas: labase contains data or information ap eet the BS : ' : ation about a, particular a 1 %” Database of employ lata of a : ployees that contains a ta of employee. : : SO _ without any duplication ef data. ib bate ie ae a Eee iol c shaptée #1-E2_ Intréduction to Databnse Systems 33 sly zon definition of database, the wordy ‘efficient and compact are also used, The werd ° ie mems ie penned data canbe soared very easily and quickly. ‘milarly, the word.‘¢omipact” meuins thut stored dala takes Up. 2s little space as possible Examples-of Databases’ * Almost all the organizations:and goveiriment depart world-use databases to tnaintaiit. their, records. Some. examp: + have been developed around the world or it:Paldistan are.as follows: Where we draw'amount from our-banic account through ATM catd, we are accessing & database of castomers:of a particular bank: Our bank account ie agesésed ‘ané checked. through Auto: Teller’ Machine (ATM). After withdrawal of some amount fronrihe bank account, the bank record in the database is updated through 4 softwate-application jmmiediately- “4. flight, the, servigiig: travel: agent may B¢cess 1s; before giving information fo us. iments in every county of the les, of large databases that Lh 2 When! we enquire’ abo several databasés:contatning flight detai there-wnay_ be: x computerized. database library! There will be & computerized. 3.5" When we: visita local Jibrary, a /find* a “book with. © containing detailécof the bookie : iiidex’ (i.ee.dutomated: gataloy)s, which’ ‘allows us," z ' reference ’to. its.title, of its autlior’s‘name:ete- cs 4, + Ina collégé'or university: there maybe a database ecntaining information about the present and previous students. 4 Q im Pakistan, NADRA. maintains y-ditabade having'information of all the: “ejtizens of Pakistan: Therecord of-any: citizen of. Pakistai-¢an be accessed yery ‘easily arid quickly. througit Jeomputerized national, identity card. nuinber (i.e; ENIC#): a a ne ‘6. The ‘populay ‘websites. of the’ world “Hotmail:com”, “gma yahoo.com" contain “0 i: databases. avitig: fee: e-mail users all over the: world, Bae The meteorological ;organizati iiformation~ about currents: a) meteorological: dépatiment, is databases. pe created and inairitaitied: manually Gr g ig an example of a daiabase ‘tliat is aiid maintained :by a set of p78! accounts of databases -having logical’. data; The the meteorological ‘ ion/department: contain: ind: previous meteord! totally: dependent, on it, may: be computerized: created and maintained A database. may gars. This The library card ‘catalo; manually. A computerized’ database is treated set of programs ig ealled:database management system. ‘icon and, | vf pM Series. Database. Manageny, 6:1 Database Table, ses ivalecea : “A database contains varions objects that are used for tere Bs tables, i ic object of datubase ig “lable”. "A database may cons! rigiand’cows, “Te a ig sored tn table of database. A thle ig shade, up -of wsalufans and Fo Tiel” repreccnt ty seestde acca ig divided: inne colin called fete. 1 fe Bak con diterent data values of-a. partioulac record.-A table. having fi oe Big + helow. Bach record contains fialds; Rollo, ‘Name, City’an ‘ Roll_No Name 1 City = |) Marks + | Shanbaz® 7} lehore 768. 2°. | Rashic:.° Multatr ..._ 680. 3. | Shei Saleém || Bahawalpiir |. 707 2 Metadata A database Rolls aelaied data as well a8 debcripiiohvaf that data. For this reason g Gatabise. is algo’ defined: as, a! selPidescribing collection of. integrated «records. ‘The description: of daia:is. known’ As thé'-preradain at-systent: caialog or data dictionary, Metadata means data about data«For example, whei a:table of a database is designed.the data‘type, size; focinat andcoth r descriptions of fields ‘are. specified. This is the metada: of the. table. Thus metadata database’ It. describes the logical Therefore, metadata’ consists of. data iter names/fieid names cs ©. dita type of each-daty itera - >, length ot widiti of date itis : : ® : minimum and maxi muity allowable values 6 here appropriate) a brie€ descriptionof each dank item. ete; . Example: a vot He £ [ Bata tem Name FDaté Type] Bata Size [nial Pua exceed Rollvg E Numitiar 2 EO Sname | Albhanurhétic ; name Class: Alphanumerls < 2 Cais enrotieg.in Sity +) Alphariumeric F = = rea . pe Student ity “| agate [ Date ~ eae Tas ae 5 Admission date oF Bdate, Date: : i . ne a al : ee | (Chapter #1 ©. Introduction to Database Systeing ie 1s The figure 1,10:a re sl gure 1. 10-and figure 1.11 show the metadata and data of “Students” table, Bolaryne | | Bresery aca é rsenptian ‘: Number Unique fall a:renberaf student [2 ‘full nama of student {marks of stude-t Benen fissin dahuee oe Lie * Figieré 1.01 Data of Studenis table Metadata” helps database: designers andl users: to understand: the .data in the | database, Metadata is ‘saved ih a data dictionary. fie, ‘This file 1s consulted before actual (data is tead or modified in-the database, DDL, (Data Definition Language) is used to ‘define the metadata, It defines data dictionary of. tables-in the database. 6:3: Types.of Databases The: databasés may be of different database ‘architectures: 5 (1): Centralized Databases ef ‘ . : Ls “Qyo ‘Distributed Databases 2 . a QB). Object-Oriented ‘Databases ‘types but there. are two generic types of ie ties tr Database Mariagemoy,; PM Set 05.1 Centralized Databose> aeand maintained it a singh “4 gentualized database is a database that-is loca ty gerver. ILENE ACCESS ang i mu 7 location. This Jocation is inost often 2 mainframe comp er ese the centealized. databas processing takes, place, at the ea site, The users remotely:Viaierminals connected to. the site Central Site Figure 1.12: Centralized Database The exaniples of centrailized databases are.as follows: (i. ©. Petsondt’computer.databases, | ‘ {ii} Clicnt/Servér databases (ili)... ..Central conipiter databases (i). Personal Computer Databases A personal cOmpuiter database is rormallly:created itd maintained by asingle use r ter, mputer. databases are. comimorily used in Sinal] ‘businesses:or organizatigns, The personal Somputer databases are used for'sinplt accounting, inventory. management, .and customer’ billig. “systems eto: “These att relatively simple te cevelop ‘nd, use. The.main problem With the neieral tert database is thatthe data canniot easily be shared among different ser One (i) . Central Computer Databases Cential computer databases are general: edi / datal y uséd inthe-otganiaati enessitt security or proper authentication of usets.is needed: One of: the tangas here a vt selected to host the database: Other users: in’ the network) Relyeuee = a& network without any proper authentication. through- peer to peer aetworler Socess this’ databts centrat- computer database systetn is shown in figure 1-13 “BOF computers. TH © Figue 1.13: Central Computer Datibase System (ily - Client (Server Databases The client/server databases ate: ised jn small to’ medium. sized organizations: “or businesses-to share data aniong taultiple users”: of the organization, . The .-cltent/sétver architecture is. shown" in ‘figure. 1.14. The client/server architecture. ig designed “forthe... distribution of work-6n a.comipiitér network in, which. many -elients- may share ‘the data (or. services) ‘on. a'single' server. A. server {which , includes - software’ : called DBMS. . and” a computer). provides backend. ‘faretions requested “by clienis.. The’ backsend:-fenctions inay be database manageient, communication. managements, printing etc, A: client Gihich generally “includes: a microcomputer". and: software applications ifstalled on it) provides front-end’ functions, which sends Tequests. to server and retrieves results from the server, Database Server Network ticat. <> Chent <> Figiire 1 l4s-Clienu/Server Architecture The: main objective of client/server architecture i§:to-allow multiplé users in the network to access or share’the. data of databases, Usually, the’ database processing functions-are-perfornied on the database server, The ‘client/server systems. are oftén used for workgroup. computiitg, It is mote'secure than central computer:databases as-server computer allows access to the database fo only authenticated users, on. client, cothputers, Advan Following are some p v > Database Management PM tages of contralized Dalabasas pdvaninges atabascs® J and data redundancy is togrity #8 maximize ; {hy many users gimullancous ye p updated aince all the ofcentralized t in conmized database, date 1 minirnized. Data can be neoesacd database 15 casict l ingle localion. (9 pidintaic and Keo A cena 3 data are stored 1 a8 packup. of dala. aintng of data in accural ¢ and consistent state. It also Iris easier lo create It helps in lhe maint nees data reliabilily. ; i database ts enhar wes swong and centralized securily ie, data in centralize h gi ‘always seoure. , . iejs easier for use to end-users due'to its simplicity of being a single database design. . Irprovides data portability and‘Delter database. administration. It is more cost effective (i.e, cheaper) than other types. of database systems as maintenance costs are.always minimum. Keeping data at ‘single location-is easier to change, mimediatelyy received by every end-user. re-organize, and analy2e. Updates to any given set. of data are f Disadvantages of Gentralized Databases Following are some disadvantages of ‘eentralized databases: * Batilenecks can be treated as'a result of high network traffic. So data Eg availability is not as efficient as fa-distributed database, Most i: re, hi . Moat Oe aunt are, highly dependent on network P work connection (i.e, inte i a problem to access the databiage fs created, { inergonection) In case. of any hardware failure, availabili ithi eee te jure, data availability within thet entire network If there. is any problenr inthe ce: i He Pp he central sile, then the complete-ditabase system fa set of data Is accidently lost| ly lost, It becomes diffi ieve i am YS icult to rétrieve it bac! Deadlocks can ocour while attempting to update ‘shar ‘ siready in Use. Apdate shared tables that :are A’ centralized “database neei i ae, + st a i tid atin, rained and experienced staff for. “its or ine Chapter #1 E introduction te Databaue Syntonia 1.6.3.2 Distributed Databases: __, Some big and multisnational orgunizations/depertments. have sub-offices in different cities and countries. In such esses, distributed databases are used instead of centralized databases, In a distributed database, the data is.stored in storage devices that are located at different physical locations, ‘they are not attached to a common CPU-but the database is contiotled by « ecnital DEMS, The users acaess data in a distributed database through WAN, ___ System administrator can clistribute collections of data (c.g. in a database) across multiple physical locations, A distributed: database can reside in network servers on the Internet, on corporate Intranets or Extranets, or on ather company networks. The figure-1.15 shows distribuied database system, (Cite [sitez {pee ‘Computer Network Sited Site-3. Dad Figire J. 25 Distributed Database System ‘Two processes, féplication and:duplicalion-are used to keep a distributed database up to date: The brief description about these processes is as follows: > Replication: ‘This ‘pfocess identifies’ changes “in the distributed database. Once the changes: have been identified, this replication process applies those changes to make’ sure’ that all the distributed databases look the same, The replication process can-bé: complex and time-consuming depending on the size-and number of the distributed databases, ‘This process can also require a lot of time-and computing.resources, Duplication: This-procéss identifies one database as a master database and duplicates that database: at. different. locations. This ~ process is not complicated as the ‘replication process but it makes sure that all the distributed databases-have the same data’ In the duplication.pracess, user may, change only the master database, This.cnsures that local data -will not b overwritten. Categories of Distributed Databases The distributed databases are further divided into two categories: (i). ‘Homogeneous databases (ii) Heterogeneous databases: pi wey ties ty Database Mitiageny, PM Set ¢ technology is the sain tabasos . ous Matabe igat thie databas : (i) Homagene tase pens Una oe GABE tno: comaible, 5 ‘The bentogentwons date data al various loot Soniware for the datata’ he ria sites) ance The Oereanae, hardy’ 8 og use the 8217 aiy cadict’ odo i comporalvely eA is syst | for homogeneous daial ond same or compatible, isfied 5 shlocation must be p dat engl loca focatign must be same, or compatible,. ed ai-eaéh location must be. sane @ onch of ie lecarions (or sas OF Pe homogencous system, a stem, The homogencoris Rntlowing conditivns nvust be sul at Thovoperating sysietn Use it gach The data struotures used.at ¢ i + The database applicaiion (or DBMS) us compatible, (i) Heterogeneous Databases: : . The héterogencous. database: systems ‘are opposite to: homogeneous database systems, In a-heterogeneous system, different nodes Local ‘dsita man agement: . Th , toon database fry, 36 : dn way ht &. Therefore at. ate . located in, the. departments can caitr! t tae wan ioe : Sina, fen ae ie. data about thenias the: i “he ee oe : é 7 8d ate the ones. fumiliat * ‘ S I Chapter €1 © Introd performanee. Sites Joad on the data! in clisteibuted database to be haloneed amon stern worles is putallel, alloying ity and availability: When a centralized aystern Fail unavailable to all users. A distribited database function at some reduced level when a eompoi sites, goes down or communication fink fails. stem fails | continue whun atte Gf trate: > Modatarity: DilYerent sit be inodified oF removed, and new site be added in the distributed database (or systems). slum without affecting ether Sit Protection of If data, the data of other sites remains lost in any site duc to any event such as a fire, fe. > Independence: The hardware, operating system, DBMS. applications a! locally independence. : y Economies: It cosis. much less to create and maintain a system of smaller computers with the equivalent power-of a single largé computer. Disadvantages of Distributed-Databases Following are some disadvantages of distributed databases: * Complexity: Extra work must be done by the DBAs to ensure that the distributed-nature of the system is transparent. Extra work must also be done io maintain multiple dissimilar systems,. Similarly; exira database design work must.also be done to: account ‘for the disconnected nature of the database. * | Higher cost of installation and maiiiténance: Keeping the data up to date ES in distributed database system requires additional work, Similarly, additional hardware, and software are required, Therefore, it increases the cost of instalation and maintenance disttibuted database system, Security: Remoté databasé fragments ave not centralized, so the remote sites must be secured, The infrastructure must also be.secured.(e.x,, by encrypting the network links between remoie sites). ' Difficult to mainiain integrity: It is difficult to enforce data integrity when data is updated at different sites simultaneously. Lack of standards: There are no‘fodls or methoddlogies yet to help users to convert a:centralized DBMS into a distributed DBMS. Database design more: complex: The design of a distributed database is more coniplex; because it has'to consider fragmentation of data, allocation of fragments to, specific-sites-and data replication,» % Trproved peiformance: Distibured query provessings ean Improve | L t i i i 1 L ' i Object-Ortented-Databases tee Odject oriented unlabases are-also culled Object Database Manag Vite c integers, Strings oy s objects ruther than.date suek as in : iS), Obj aibises.siore objects raiher tl ‘ eS runien Ops d in object oriented tangunges such as Si c a rs. Objects n i ig ollowing: Vion Buick aa Ruby oto. Objects basically consist of the fe B # Attribites:-Awibules are data: which defines the bementer tes ea om Sbjeg, This data may-be simple stich.as integers, sizings, and rea, ita, be a.reference.io.a complex object. - ° | ¥ % Mlethnds: Method define the behavior of an o "formally called procedures or furctions. , bject and are. what ey Following figure shows the object-oriented database: Object 1: Maintenance Report . Object 1 instahce Date 0112-04 | Activity: Code : 2a —- ; Route No. “hae [465 Dally Production vo PRB Equipment Hours | “|. fgg. Labortious fs ~Peg oe eee i _ Qbisct:2: Maintetiance Activity L Activity Coda .[ Botivity Name Production Unit Average Daily Production Rate. Figure 1.46: O8; fect Oriented Datibase Model ~ Thetetore, abjects. contain, Ball ‘axon : eetore, ak i wable code and data: There are. othet: ieee ot ‘Objects sucti as whether methisds or data cati-be accessed from outside! het amp, 2 80" consider this here. ty Keep the definition i : 2 n " it imple and + what an -objéct database is. Another term ig classes, Classes : fear ni Prograntming to define ihe data ‘and tmeihods the object will contain: Tie class is like t data aad methods containga 5 the ore elf contin data of Metliods but defines the be used? in object darsg he Oblect: The class ig used tt create the object, Classes may be use ‘ one atabasés 5 te-create parts of the object that niay-not a ti fly be Stored in the ates: Methods may: Hat-be'stored in-the database ang ey be s feate Chane et eertnlal it Chapler #7 Waloidyetton te Database Systonss = Comparison of Object Datobase with Rolatonal Databases , Relational databases store, lati tit tubley UiAt Ire two dimensional, The tubles have rows and cols, AU table coltinms depend on w-prlnary key (a Unique value-in the column) to identily the column. Onee the specifte column ia tentified, data from one or more rows associated with that eolunn may be obtained of, changed, . To put objects into rclational dawhnsas, they must be described in terms of simple atring, integer, or réak ntinber data, For Instance in the ease-of an airplane, the wing may be placed ln oye table with tows “and cohwnns describing its dimensions and characteristics, The. propeller i onollicy table, dires.in another, and so on. Uses-of Object-Orlented Databases, __ Object databases shoitld be used which Jhiere is complex data andor complex data relationships, This includes-a many lo-niany ‘abject ralationship. Object databases should not be used when there would 62 Fey join fables aiid -thete are large vohumes of simple * transactional data. The applications. of object databases aré.as follows: ¢ CAS Applications such, as) CASE-computer’ aided: software engineering, CAD-computer, aided design, and CAM-coniputer aided manufacture. “9 Multimedia Applications. ah am 2! Object projects that charige-over time, % Commerce. . Advantages of Object-Oriented Databases Following “ais! some advantages, of ‘object-oriented database’ systems over relational database systems: : é . > Objects don't require assembly and, disasseribly saving coding time and execution time to.assemble or disassamble-objects: i i | ; ! i > Easier navigation” = : . Better concurreney:control, Achiétaretiy of objects may be locked, “Date model is-baged on thie real wotld. . “Works well for distributed architectures. : Less code required -when applications are object oriented: vvowiv v Disadvantages of Object-Oriented Databases i Following -are’ some digodvantages of object-oriented database systems ! > compared to relational database systems. am, oe gy Bi tabave ManaBEMngg ‘Le PM $i eit onahipe Ae simple. Lower-e Meiency whet dota ty slmple.and reli Relational tables are slp! Late binding miay s1ow acces More user tools exist fot DMS, Standards for ROTMS ure more slables ” Mg tg more corey uel ehange 1 speed, tessdikely to by required, ~ * * te * © 17 DATABASE MANAGEMENT SYSTEM (DBMS) Jf n0vbss databave 4 ain, and access ase ig are used lo.czonle, ruainte sJ-purpase software, This Support for RDB A collection of programs {ttt called davabase managentent systedt (DBMS). DBMS isa aut nent types of DEMS, software is olteri called dafabase software, There are many i pocaee persona! computers ta huge sys Pun ranging from small systems that. fuaon fF val Back ‘on mainframes. We can also develop @ special purpose DBMS software (in Visi ic, n+ ete.) to czeale and maintain specific databases. » Different companies. have developed their own database maria, Emportant examples of database management'systemsare. as follows; > Microsoft Access: It is a. popular dalabase manajement system. It is developed'tiy Miorosoft,Corporatisn.« ; » -Orecle: It is 4 relational, database, tasggement system: kt is developed by Oracle Corporation." . .- as f P Microsoft SQL Server: His a " pelational database management system developed by Microsoft Corporation, ® MySQL: It is the most popular Open, Source sot database management aystem, It is developed, distributed, and supported. by Oracle ‘Corporation. > FileMaker Prox [isa orass° plalform: relational database application. It is developed by FileMaker Ihe: > DB2: It is a “family of iel ational salabaso management system (RDBMS) products develope by iBM, wement systems, Parts of DBMS . : * °, ADBMS consists of the tollowing-thtee parts or. elements: Dd Physical Databas dee ev Hl consists: of a file or set of files that contains. the i) Database Engine: Te js the part of SBMS 5 that makes it: (slore and retrieve dala) and modify the data atdatabaee possible to access. , + Hi) + Database Schema: It is the specif data storedin'lhe database ee eaten ofthe logiéal structure of the Functions of DBMS There are many tunelions of mon aes Renendpumpese DAMS software but the main @—Pefiniug the Structure ot patabnses Dalwhie involves Seep bles elds vt tr dat types, entitraintetar date to b seed | Ruetions sul iriggers ete) andthe ecthenshine among eth s fi) aren ta st se: This hwvolves storing data int dat Fs ai Maclptasing the Database: Database manipulation involves retneval a ee ) Update. dita, delete data, insert new data, and to generaiz, 4.7.1 Components of a DBMS Environment ; A, database management system (DBMS) environment, consists of max + components. Each component plays’a very important role in the DBMS environim .) major components are: hardware, software, data, procedures, and users or people. 1. Hardware: The hardware is the actual computer systeni on which the DBMS software ard |. application programs juri; It consists of .a set of physical clectronic devices such 2s computers, storage devices, -1/O' channels, electromechanical devices that make intert between computers, ‘and so on. It: is impossible: to implement the DBMS without the { hardwaré. devices, In.a network, a-powerful computer with yery high data processing | speed and storage device with large storage capacity is requited asa database server. 2..- Software The main component ‘of a DBMS environnicnt is the software. It is a set of programs: used. to handle the databases and fo contol’ and manage the overall computerized database system. These programs normally includes x DBMS sofiware; which is the most Jmportant sofware component in the overall system.. % Operating system including network softivare being used in the network, to share the data. of database among multiple users. i 4 Application programs developed: in programmung languages sich is CH, Visual. Basic, web applications, and web services that ave used to access, database. in’ DBMS: environment, Each . program contains statements’ ‘that different operel d ‘del to i ating 8 request tie DBM ig, inserting, updeline ine, services. Most of y. may, meiude may be conventions: ed:by using ASP, Ne, application prOB Ps are online, develo? , moder application pr ISP rechnotogics ete. devel report writers, and so on, lication nt tools, ¥ Others ineludé app! Jopimen BMS environment. In Dyy d and retrieved to ang tional) data and g, * 3 Data Data is the inost important, component 2 databases are defined, cotistructed and then, data fromthe databases. The database contains both. mietadata (dita about data or description’ gout data). fithe DI is stored, update the actual (or operat 4. Procedures ‘ : Procedures refer to’the instructions and:ules'that help-to design the database an} ; to use the DBMS. The users who. operate ‘ahd manage:the. DBMS. require documenta: —_ procedures to use or run the DBMS. Thiésé may includes: % Procedure tc install the:new DBMS. at Security features to lig on:to-the DBMS... ® * Touusé'the DBMS er'application program, 8 : 7 “ % Té make backup copies of the databiasés, ae bee (we | ¥ “Tp handle hardware and software failures. ae 4 To change the stnicture of the databases: = 4 am : ex , TO generate the reports’ of data reiriéved from the databasés.cte. fri 5. Users : ? Users aré the peo (i on ple. Who use and m: : Operations on the dat: i ‘anlage the databa; 3 may be involved in oe the database'system, Figure | Tsk They perform differs ay’ different roles in deat seement system: There are wees auteerent users ital diay ‘oles in database system, nere-are three kinds of people wiht 8 (i), Application Progtammers : Be (if): “Database Administrators (ii) End-Users toa b toe ' | Apgpiloation | ‘pplaron ee Programme i | ($09 po yg | Wash pcre Wh "pea DATABASE MANAGEMENT SYSTEM [Si = @ ' ' / —__ see Es Le | Databaset 1 Figure 1.17: Different Users.in @ Database System Environment () -Application Programmers The people who write application-programs ‘in different programming languages {such-as Visual Basic, Java,:or G+) to interact ‘with. databases are called application | pragramniers, The exid-users use tlie application programs written by the application programmers,- The software used in libraries, shopping ‘stores, and medical, stores are examples of-application database programs. ‘The application programmer designs 4 user friendly interface of the program. $¢ that, the end-users can use the application program easily and.correctly. {i} Database Administrator i A. person who. is tesponsible for. managing the overall database management system. is. called.‘ datobase administrator oF simply DBA; A database administrator performs the following major responsibilities: : . Tnstalling and managing the: DBMS. : Creating databases and related objects like tables and indexes. Authorizing access to the database. Céordinating-and monitoring DBMS. ‘Acquiring software and hardware’ resources as needed. st Secutity and integrity control, x OM sonal syglern. Maintenines of 1M operation oe oat iF 8 enuin Da lore corany wllaer, | 10 pare Fe ate proviouK Hl cont Of Hows to enone re aes i cue oF Fe online xe Recovery of dan the other users: ji) End-Users / suppinito octbere dif, (i gro the people who inigract with DE MS ere ty ce end-ases ate the people AO INTE ny, deleting data ote dotabar sue as oevings PET erface, IDB provided by Di i DBMS. Such interf integral part oF teract with online databases oporations ot gets access the DBMS trough ap) or SQL interface. The intorface is pro fare also suppotted by means of online app! online workstatiotis or terminals. : . ified into following two categories:- End-users can further be clas vided as an integ lications to in (a) Casual End-Users © ‘ users, They are the trained persons who k They are, also called “sophisticate . the structure of daiabase and facilities offered: by the DBMS. They normally use stax 7 [ a i query languages such as SQL to perform the required] operations on'the database. they access tte databases by wiiting SQL. queries. Some-sophisticated end-users = even.write application programs for (heir own.usé.’ ! | {b) Waive Users | They do not know the structure of database or'any query language. Similarly, 2 do not have any technical knowled ; any n bout the, DBMS. 1 | > ot ave an al Ienowledge al DBMS. They acce 3 ligagt aplicnon ins (or IDE); They access the data by soleatin es sere s ener simple commands, For example, ina univers sister's of veuser, while ihevegiatriy’s data prosessing cheinon anys ae s perator may be a cast ‘ 18 AD : VANTAGES 8, DISADVANTAGES. OF DATABAS! E © APPROACH The database ap 1 approzeh provides x processing syslem,but it elso bas wore eens Sette : S some distélvantapes, ‘The ake te conventional # | ’ The advantages and disadvan? ‘of database approach are as follow: 1.8.1 Advantages of Database. ‘Anpra, h ac Following are some important advantages, of th Of the database E approach: any ide 1g a TE | ‘4, Controlling Data Redundangy __ 2m non-datnbase systents (traditional computer (ile processing, systems), each i plication program has its own dau files, Therefore, dnplléated copies of the same daia are created at many places. Slorage of same. dita at more than one place is called data [+ redurdancy. Dambase appronch recuwes dnia redundancy: ‘The data in 3 database appears r only once and’ is not-duplicated. By.controlling the dala redundancy, we can save storage space and increase retrieval and update speed, oe ; 2. Data Consistency | Date consisteney is the process of keeping information uniform, By controlting —-} | the data redundancy, the data consislency is obtained, If'a dala-item appears only at one | place, it is easy to maintain. For example, if a student's address is stored only at one | 1. place, it ‘can easily’ be updated’ or changed. The new changed address of student fs | i | immediately availabléat-all. places: Thus data inconsistency. does not arise. 3. Data Sharing ; ; A database approach allows’ sharing of data among any number of users. Sharing means that. several users cair access the ‘same’ data‘stored in.a database simultaneously. \ | The remote use#s. can also'share ‘the same-data. Similarly, the data of same database car: | be shared between.different application péogranis,’ -~ 4 Data Integration In filesprocessing systéni, data is sioréd:in Separate and independent data files. (t js diffivult to ‘store-and access. data to-and from different.data files, In-2 database, data is stored in tables. A single database may contaii multiple tables. The relationships can be created between tables. This makes easy to retrieve andupdate data of database. 5. Data Integrity. . Data integrity réfers.to the correctiess and’consistency-of data, 1f data items are stored in more than‘one- files; then all files. niuist be updated in case of any change. Tn a database; only one:copy of data. is stored, therefore, data ‘always remains consistent, Integrity: is usually “expressed in :terms ot certain constraints. These are the ; consistency rules that check the data before storing into database. These rules can be applied to database so that only correct data canbe stored into database, 6. Data Security Data. security ‘is: the protectjon, of. database from ynatithorized users, Only the authorized persons should be allowed lo access the-important database..Some of the users may be allowed io access-only-a part of database j.e., the-data that is related. to them ot elated to: their ‘department, Mostly,:the DBA or head ofa department can access alk: the data itisthe database, Some-users may be permitted.only te retrieve data, whereas others. wi series Database Matiogemess P x s‘controlled yy. ase access # ae to accégs the database, bids THe USCE ENIETS. his/hey dat may be allowed to tetieye as vell as to update data, The 4 the, DBA; ' He/She creates accounts: of ioe an gives Typically, users. are’ given usernames protec! ea by. as ' usemanie.and password (6 access, the dala ome me ee incite “worwyahoo:com ¢ For cxample; if-you have an account of e assword'to access;you: ° popiliracie er hee ia give your correel username ee an Auto. Teller Machin ‘nail account: Sirnilirly, when ‘you insert your ATM eat on the card anid then ache (ATM) in a-bank,-the machine reads your.1D number: Paid Users, can, ACCESS thei, you to enter. your pin code. (or password). Thus, only aut accounts, 7. Data Atomicity 2 ‘. ‘on of all An operation on, daa may consist of different steps. The ae ° ee Tequired to complete anoperation on data is calléd. srarisaction. Ato cither a transaction: must take: place as a-whole or it should'not take pliice 3 aes you want to'ansfer amount of Rs.15000/ from account X adéout i pi 3 consists.of two steps: 7 Step-4: Dedhict amount of Rs: 15000/- from.accouitt X. Step-2: Add amount of Rs-1 5000! ta account YX. - : : . _ Supposé that the system fails:afier Performing Step-]-It means'that-the amount of Rs. 15000/- has’ bee deducted. from-account X- but has hot been ‘added’ to aecotint Y, Thig 1 ealled the daca ecomicity problem: This problett usually occurs in afile processing system. ia a. database system, one transaction. takes place as a-wholé-or it-does. hot'take place at-all. The partially ‘completed. tisks-are-always rolled ‘back. ‘Thus -onily.. consistent ‘data cxists-Wwithin the database. i . ee 8 Control. over Goncurréency . Z Ja seme sitvations tWo.or move uigersinay acoass the same file: simultaneously. 1 ~ is:possible that-theyy will interfere with cach other. For example; if both User .Atiempt to Perform update operation onthe same: reeard, thea oné nay overvitite the. valties tecorded _by. te eee ‘This thay resuit in Joss of important information: Most ‘database ‘systems cone ie rear through different techniques, 0 that Update: are always recorded. 9. Backup and Recovery Proceduras’ - : div a. filecbased. system: users create bacigin “jo” B 22 valuable data from data'loss due to failures ottae cen Bua to protect the’ |. This may’ require taking: backup of the: dita daily. It yal bee TH OF. Sperating. system. volume.of data is large, On te other hand inmost gf the’ database go tsuming task if “backup: arid recovery’ Sub-systems that automatically create the systems Provide the restore data if required, For example, if'a computer system fails sth ackup ‘of data. and a) update operation, .the recovery sub-system ig "sponsible for matte Cor-end).of database is restored to the state it was in before the PrOgram started Boch a that the

You might also like