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

Introduction To DBMS

1) Data is raw facts that can be stored and processed as information in a database, which is a collection of organized data. A database management system (DBMS) allows for defining, constructing, manipulating, and sharing data among multiple users. 2) A DBMS provides centralized data management, data independence from applications, and data integration across an entire system. This reduces data redundancy and inconsistencies while facilitating easy, secure access to data through standard query procedures. 3) Key advantages of a DBMS over file processing systems include eliminating data duplication, easily enforcing integrity constraints, supporting concurrent access without inconsistencies, and maintaining atomicity of updates.

Uploaded by

Dhaval Dholabhai
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

Introduction To DBMS

1) Data is raw facts that can be stored and processed as information in a database, which is a collection of organized data. A database management system (DBMS) allows for defining, constructing, manipulating, and sharing data among multiple users. 2) A DBMS provides centralized data management, data independence from applications, and data integration across an entire system. This reduces data redundancy and inconsistencies while facilitating easy, secure access to data through standard query procedures. 3) Key advantages of a DBMS over file processing systems include eliminating data duplication, easily enforcing integrity constraints, supporting concurrent access without inconsistencies, and maintaining atomicity of updates.

Uploaded by

Dhaval Dholabhai
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 44

Notes of Database Management System

UN I T-1
I N T R O DUC T I ON TO DA T A B A SE MANA GE M E N T S Y S TEM
D a t a - Data is meaningful known raw facts that can be processed and stored as information.
D a t aba s e - Database is a collection of interrelated and organized data.
D B MS - Database Management System (DBMS is a collection of interrelated data !usually called database"
and a set of programs to access# update and manage those data !which form part of management system.
$%
&t is a software package to facilitate creation and maintenance of computerized database. &t is general purpose
software that facilitates the following'
(. Defining: Specifying data types and structures# and constraints for data to be stored.
). Construting' Storing data in a storage medium.
*. Mani!u"ating: &n+ol+es ,uerying# updating and generating reports.
-. S#aring' .llowing multiple users and programs to access data simultaneously.
/g. $f DBMS - .ccess# dBase# 0ileMaker 1ro# and 0o2B.S/# $%.34/ etc.
$ IG U RE 1% 1 N a&at #e ' a g e -(
' r i ) a r* go a "s o f D B M S a re '
(. 5o pro+ide a way to store and retrie+e database information that is both con+enient and efficient.
). 5o manage large and small bodies of information. &t in+ol+es defining structures for storage of information and
pro+iding mechanism for manipulation of information.
*. &t should ensure safety of information stored# despite system crashes or attempts at unauthorized access.
-. &f data are to be shared among se+eral users# then system should a+oid possible anomalous results.
E g% O f D B MS a!! "i a t io n s
(. Banking 6 0or customer information# accounts# and loans# and banking transactions. !all transactions"
). .irlines 6 0or reser+ation and schedule information. !reser+ations# schedules"
*. 7ni+ersities 6 0or student information# course registrations# and grades. !registration# grades"
-. 3redit 3ard 5ransactions 6 0or purchases on credit card and generation of monthly statements.
8. 5elecommunication 6 0or keeping records of calls made# generating monthly bills# maintaining balances on
prepaid calling cards# and storing information about communication networks.
9. 0inance 6 0or storing information about holdings# sales# and purchases of financial instruments such as stocks
and bonds.
:. Sales 6 0or customer# product# and purchase information. !customers# products# purchases"
1age (
Notes of Database Management System
;. Manufacturing 6 0or management of supply chain and for tracking production of items in factories# in+entories of
items in warehouses<stores# and orders for items. !production# in+entory# orders# supply chain"
=. >uman %esources 6 0or information about employees# salaries# payroll ta2es and benefits# and generation of
paychecks. !employee records# salaries# ta2 deductions"
$ i" e s * s te ) s+ $i " e ! r o e s s i n g s *s t e ) s
. file system is basically storing information in data structures called ?files@ in the operating
system and manipulating this information +ia application programs that manipulate the files.
D is a,&a n t ag e s o f $ i "e ' r o e s s i ng S * st e )
(. Data Re,un,an* 6 Since different programmers create the files and application programs o+er a long
period# the +arious files are likely to ha+e different formats and the programs may be written in se+eral
programming languages. Moreo+er# the same information may be duplicated in se+eral files# this duplication
of data o+er se+eral files is known as data redundancy. /g. 5he address and telephone number of a particular
customer may appear in a file that consists of sa+ing- account records and in a file that consists of checking-
account records.5his reduanduncy leads to higher storage A e2cess cost also leads to inconsistency discussed
in the ne2t.
). Data Inonsisten* 6 5he +arious copies of same data may no longer agree i.e. +arious copies of the same
data may contain different information. /g. . changed customer address may be reflected in sa+ings-account
records but not elsewhere in the system.
*. Diffiu"t* in aessing ,ata 6 &n a con+entional file processing system it is difficult to access the data in a
specific manner and it is re,uire creating an application program to carry out each new task. /g. Suppose that
one of the bank officers needs to find out the names of all customers who li+e within a particular postal-code
area. Be ask the officer of data-processing department to generate such a list.Be ha+e ) choices'
- 4ist all custCnames A manually do the information re,uired
- .sk the data processing dept. to ha+e system programmer to write necessity application programe
Because the designers of the original system did not anticipate this re,uest# there is no application
program on hand to meet it.
-. Data Iso"ation 6 Because data are scattered in +arious files# and files may be in different formats# writing new
application programs to retrie+e the appropriate data is difficult.
8. Integrit* !rob"e)s 6 5he data stored in the database must satisfy certain types of consistency constraints.
/g. 5he balance of a bank account may ne+er fall below a prescribed amount (say# &3&3& )8DD<- . De+elopers
enforce these constraints in the system by adding appropriate code in the +arious application programs.
>owe+er# when new constraints are added# it is difficult to change the programs to enforce them. 5he problem
is compounded when constraints in+ol+e se+eral data items from different files.
1age )
Notes of Database Management System
9. Ato)iit* !rob"e)s 6 . computer system# like any other mechanical or electrical de+ice# is subEect to
failure. &n many applications# it is crucial that# if a failure occurs# the data be restored to the consistent state
that e2isted prior to the failure. /g. Before computer formatt#we re,uire to ha+e a backup first. &t is difficult
to ensure atomicity in a con+entional file processing system.
:. Conurrent-aess ano)a"ies 6 0or the sake of o+erall performance of the system and faster response# many
systems allow multiple users to update the data simultaneously. &n such an en+ironment# interaction of
concurrent updates may result in inconsistent data. /g. 3onsider bank account .# containing F8DD. &f two
customers withdraw funds (say F8D and F(DD respecti+ely from account . at about the same time# the result
of the concurrent e2ecutions may lea+e the account in an incorrect (or inconsistent state. Suppose that the
programs e2ecuting on behalf of each withdrawal read the old balance# reduce that +alue by the amount being
withdrawn# and write the result back. &f the two programs run concurrently# they may both read the +alue
F8DD# and write back F-8D and F-DD# respecti+ely. Depending on which one writes the +alue last# the account
may contain either F-8D or F-DD# rather than the correct +alue of F*8D.
5o guard against this possibility# the system must maintain some form of super+ision. But super+ision is
difficult to pro+ide because data may be accessed by many different application programs that ha+e not been
coordinated pre+iously.
;. Seurit* 'rob"e)s 6 Not e+ery user of the database system should be able to access all the data. /g. &n a
bank system# payroll personnel need to see only that part of the database that has information about the
+arious bank employees. 5hey do not need access to information about customer accounts. But# since
application programs are added to the system in an ad hoc manner# enforcing such security constraints is
difficult.
1age *
Notes of Database Management System
D i ffere n e be t - een D B M S a n, $ i "e-! r o e s si n g s* s te)
DBMS $i"e-!roessing S*ste)s
(. %edundancies and inconsistencies in data are reduced
due to single file formats and duplication of data is
eliminated.
(. %edundancies and inconsistencies in data e2ist due to
single file formats and duplication of data.
). Data is easily accessed due to standard ,uery
procedures.
). Data cannot be easily accessed due to special
application programs needed to access data.
*. &solation<retrie+al of re,uired data is possible due to
common file format# and there are pro+isions to easily
retrie+e data
*. Data isolation is difficult due to different file formats#
and also because new application programs ha+e to be
written.
-. &ntegrity constraints# whether new or old# can be
created or modified as per need.
-. &ntroduction of integrity constraints is tedious and
again new application programs ha+e to be written.
8. .tomicity of updates is possible. 8. .tomicity of updates may not be maintained.
9. Se+eral users can access data at the same time i.e
concurrently without problems
9. 3oncurrent accesses may cause problems such as .
inconsistencies.
:. Security features can be enabled in DBMS +ery easily. :. &t may be difficult to enforce security features.
A ,&an t ag e s o f a DB MS o &er fi "e - ! ro e ssi n g s * st e )
. DBMS has three main features'
(( 3entralized data management#
() Data independence and
(* Data integration <System integration
&n a DB system#the DBMS pro+ides the interface b<w the application programes A data.when changes are made to the
data representation# the metadata maintained by the DBMS is changed but the DBMS contiues to pro+ide data to
application programs in pre+iously used way. 5he DBMS handles the task of information of data wheree+er
necessary.5his independence b<w the programs A the data is called data independence.this made programe to
continue irrespecti+e of changes made in it. 5o pro+ide a high degree of data independence # a DBMS must include a
sophisticated metadata mgmt system.&n DBMS # all files are integrated into one system thus reducing redundancies A
making data mgmt more efficient.&n addition# DBMS pro+ides centralised control of the operational data.Some of
ad+antages of abo+e mention three features are'
Due to its centralized nature# the database system can o+ercome the disad+antages of the file-based system as
discussed below.
1age -
Notes of Database Management System
G Mini)a" Data Re,un,an* - Since the whole data resides in one central database# the +arious programs in the
application can access data in different data files. >ence data present in one file need not be duplicated in another.
5his reduces data redundancy. >owe+er# this does not mean all redundancy can be eliminated. 5here could be
business or technical reasons for ha+ing some amount of redundancy. .ny such redundancy should be carefully
controlled and the DBMS should be aware of it.
G Data Consisten* - %educed data redundancy leads to better data consistency.
G Data Integration - Since related data is stored in one single database# enforcing data integrity is much easier.
Moreo+er# the functions in the DBMS can be used to enforce the integrity rules with minimum programming in the
application programs.
G Data S#aring - %elated data can be shared across programs since the data is stored in a centralized manner. /+en
new applications can be de+eloped to operate against the same data.
G Enfore)ent of Stan,ar,s - /nforcing standards in the organization and structure of data files is re,uired and
also easy in a Database System# since it is one single set of programs which is always interacting with the data
files.
G A!!"iation De&e"o!)ent Ease - 5he application programmer need not build the functions for handling issues
like concurrent access# security# data integrity# etc. 5he programmer only needs to implement the application business
rules. 5his brings in application de+elopment ease. .dding additional functional modules is also easier than in file-
based systems.
G Better Contro"s - Better controls can be achie+ed due to the centralized nature of the system.
G Data In,e!en,ene - 5he architecture of the DBMS can be +iewed as a *-le+el system comprising the
following'
- 5he internal or the physical le+el where the data resides.
- 5he conceptual le+el which is the le+el of the DBMS functions
- 5he e2ternal le+el which is the le+el of the application programs or the end user.
Data &ndependence is isolating an upper le+el from the changes in the organization or structure of a lower le+el.
0or e2ample# if changes in the file organization of a data file do not demand for changes in the functions in the
DBMS or in the application programs# data independence is achie+ed. 5hus Data &ndependence can be defined as
immunity of applications to change in physical representation and access techni,ue. 5he pro+ision of data
independence is a maEor obEecti+e for database systems.
G Re,ue, Maintenane - Maintenance is less and easy# again# due to the centralized nature of the system.
D is a,&a n t ag e s o f a DB MS
5he following are disad+antages of DBMS
(. Setup of the database system re,uires more knowledge# money# skills# and time.
). 5he comple2ity of the database may result in poor performance.
1age 8
Notes of Database Management System
$ un t ions o f a D B MS
5he functions performed by a typical DBMS are the following'
G Data Definition - 5he DBMS pro+ides functions to define the structure of the data in the application. 5hese
include defining and modifying the record structure# the type and size of fields and the +arious constraints<conditions
to be satisfied by the data in each field.
G Data Mani!u"ation - $nce the data structure is defined# data needs to be inserted# modified or deleted. 5he
functions which perform these operations are also part of the DBMS. 5hese function can handle planned and
unplanned data manipulation needs. 1lanned ,ueries are those which form part of the application. 7nplanned ,ueries
are ad-hoc ,ueries which are performed on a need basis.
G Data Seurit* . Integrit* - 5he DBMS contains functions which handle the security and integrity of data in
the application. 5hese can be easily in+oked by the application and hence the application programmer need not code
these functions in his<her programs.
G Data Reo&er* . Conurren* - %eco+ery of data after a system failure and concurrent access of records by
multiple users are also handled by the DBMS.
G Data Ditionar* Maintenane - Maintaining the Data Dictionary which contains the data definition of the
application is also one of the functions of a DBMS.
G 'erfor)ane - $ptimizing the performance of the ,ueries is one of the important functions of a DBMS. >ence
the DBMS has a set of programs forming the Huery $ptimizer which e+aluates the different implementations of a
,uery and chooses the best among them.
5hus the DBMS pro+ides an en+ironment that is both con+enient and efficient to use when there is a large +olume of
data and many transactions to be processed.
D a ta a b s tr a t io n
&t can be summed up as follows.
(. Bhen the DBMS hides certain details of how data is stored and maintained# it pro+ides what is
called as the abstract +iew of data.
). 5his is to simplify user-interaction with the system.
*. 3omple2ity (of data and data structure is hidden from users through se+eral le+els of abstraction.
Data abstration is use, for fo""o-ing !ur!oses:
(. 5o pro+ide abstract +iew of data.
). 5o hide comple2ity from user.
*. 5o simplify user interaction with DBMS.
1age 9
Notes of Database Management System
/ e & e "s of , a ta a b s tr a t ion
5here are three le+els of data abstraction.
1% '#*sia" "e&e"' &t describes how a record (e.g.# customer is stored.
0eatures'
a 4owest le+el of abstraction.
b &t describes how data are actually stored.
c &t describes low-le+el comple2 data structures in detail.
d .t this le+el# efficient algorithms to access data are defined.
0% /ogia" "e&e"' &t describes what data stored in database# and the relationships among the data.
0eatures'
a &t is ne2t-higher le+el of abstraction. >ere whole Database is di+ided into small simple structures.
b 7sers at this le+el need not be aware of the physical-le+el comple2ity used to implement the simple
structures.
c >ere the aim is ease of use.
d Ienerally# database administrators (DB.s work at logical le+el of abstraction.
1% 2ie- "e&e"' .pplication programs hide details of data types. Jiews can also hide information (e.g.# salary for
security purposes.
0eatures'
a &t is the highest le+el of abstraction.
b &t describes only a part of the whole Database for particular group of users.
c 5his +iew hides all comple2ity.
d &t e2ists only to simplify user interaction with system.
e 5he system may pro+ide many +iews for the whole system.
1age :
Notes of Database Management System
I n s t a n es a n, S# e ) a s
&nstances and Schemas are similar to types and +ariables in programming languages.
(. S#e)a'
5he o+erall design of a database is called database schema. /.g.# the database consists of information about a set
of customers and accounts and the relationship between them. &t is analogous to +ariable along with its type
information in a program.
T*!es of S#e)as (partitioned according to le+els of abstraction'
a. '#*sia" s#e)a' &t is database design at the physical le+el. &t is hidden below logical schema# and can be
changed easily without affecting application programs.
b. /ogia" s#e)a' &t is database design at the logical le+el. 1rogrammers construct applications using
logical schema. &t is by far the most important schema# in terms of its effect on application programs.
c. Subs#e)a: &t is schema at +iew le+el.
). Instane'
&t is the actual content of the database at a particular point in time. &t is analogous to the +alue of a +ariable.
T#e AN S I+ S 'AR C A r# i te ture
. DBMS can be considered as a buffer between application programs# end users and a database designed to fulfill
features of data independence. &n (=:8 the .merican National Standards &nstitute Standards 1lanning and
%e,uirements 3ommittee (.NS&-S1.%3 proposed three-le+el architecture identified three le+els of abstraction.
5hese le+els are sometimes referred to as schemas or +iews.
(. 5he /2ternal or 7ser 4e+el' 5his le+el describes the user@s or application program@s +iew of the database.
Se+eral programs or users may share the same +iew.
). 5he 3onceptual 4e+el' 5his le+el describes the organization@s +iew of all the data in the database# the
relationships between the data and the constraints applicable to the database. 5his le+el describes a logical +iew of
the database i.e. a +iew locking implementation detail.
*. 5he &nternal or 1hysical 4e+el' 5his le+el describes the way in which data is stored and the way in which data
may be accessed. 5his le+el describes a physical +iew of the database.
/ach le+el is described in terms of schema 6 a map of the database. 5he three- le+el architecture is
used to implement data independence through two le+els of mapping' that between the e2ternal schema and the
conceptual schema and that between the conceptual schema and the physical schema.
1age ;
Notes of Database Management System
0oreg.# 3onsider a Bank System# &t uses
G 3ustomerCDetails 5able. G 3ustomerC5ransactions 5able.
.t the internal le+el# a 3ustomerCDetails or 3ustomerC5ransaction record can be described as a block of consecuti+e
storage locations (for e2ample# words of bytes. 5he language compiler hides this le+el of detail from programmers.
Similarly# the database system hides the lowest-le+el storage details (how data is stored and accessed from database
programmers. .t the conceptual le+el# the table definition (the attributes data type and width definition and the
interrelationship among the data is described. 0inally at the e2ternal le+el# se+eral +iews of the database are defined#
and database end users are also to see those +iews. &n addition to hiding details of the conceptual le+el of the database#
the +iews also pro+ide a security mechanism to pre+ent users from accessing parts of the database. 0or e.g.# tellers in
the bank will be able to see only that part of the database that has information on customer accountsK they cannot
access information concerning salaries of bank employees.
1age =
Notes of Database Management System
D a ta I n,e! e n,ene
Data independence is the ability to modify a schema definition in one le+el without affecting a schema definition in a
higher le+el is called data independence.
5here are two types of ?data independence@'
(. '#*sia" ,ata in,e!en,ene
a. &t is the ability to modify the physical scheme without causing application programs to be rewritten.
b. Modifications at this le+el are usually to impro+e performance.
). /ogia" ,ata in,e!en,ene
a. &t is the ability to modify the conceptual scheme without causing application programs to be rewritten
b. &t is usually done when logical structure of database is altered.
4ogical data independence is harder to achie+e as the application programs are usually hea+ily dependent on the
logical structure of the data. .n analogy is made to abstract data types in programming languages.
D a t a b a s e U s e r s
7sers are differentiated by the way they e2pect to interact with the system. 5hey fall into the following categories'
(. .pplication programmers' 5hey are computer professionals interacting with the system through DM4 calls
embedded in a program written in a host language (e.g. 3# 14<(# 1ascal.
a. 5hese programs are called application programs.
b. 5he DM4 precompiler con+erts DM4 calls (prefaced by a special character like F# L# etc. to normal
procedure calls in a host language.
c. 5he host language compiler then generates the obEect code.
d. Some special types of programming languages combine 1ascal-like control structures with control structures
for the manipulation of a database.
e. 5hese are sometimes called fourth-generation languages.
f. 5hey often include features to help generate forms and display data.
). Sophisticated users' 5hey interact with the system without writing programs.
a. 5hey form re,uests by writing ,ueries in a database ,uery language.
b. 5hese are submitted to a ,uery processor that breaks a DM4 statement down into instructions for the database
manager module.
*. Specialized users' 5hey are sophisticated users writing special database application programs. 5hese may be
3.D systems# knowledge-based and e2pert systems# comple2 data systems (audio<+ideo# etc.
-. Nai+e users' 5hey are unsophisticated users who interact with the system by using permanent application
programs (e.g. automated teller machine.
1age (D
Notes of Database Management System
D a t a b a s e A , ) i n is tr a t o r
5he database administrator is a person ha+ing central control o+er data and programs accessing that data. >e
coordinates all the acti+ities of the database systemK the database administrator has a good understanding of the
enterprise@s information resources and needs.
$ un t ions o f a D B A
Database administratorMs duties include'
(. Schema definition' the creation of the original database schema. 5his in+ol+es writing a set of definitions in a
DD4 (data storage and definition language# compiled by the DD4 compiler into a set of tables stored in the data
dictionary.
). Storage structure and access method definition' writing a set of definitions translated by the data storage and
definition language compiler.
*. Schema and physical organization modification' writing a set of definitions used by the DD4 compiler to
generate modifications to appropriate internal system tables (e.g. data dictionary. 5his is done rarely# but sometimes
the database schema or physical organization must be modified.
-. Iranting user authority to access the database' granting different types of authorization for data access to
+arious users
8. Specifying integrity constraints' generating integrity constraints. 5hese are consulted by the database manager
module whene+er updates occur.
9. %outine Maintenance' &t includes the following'
a. .cting as liaison with users.
b. Monitoring performance and responding to changes in re,uirements.
c. 1eriodically backing up the database.
D a t aba s e " ang u ages
Be ha+e Data Definition 4anguages (DD4 to specify database schemas and Data Manipulation 4anguage (DM4 to
e2press database updates and ,ueries. &n practice# these are not to separate languages but are part of a single database
language# like SH4.
(. Data Definition /anguages 3DD/4
&t is the language that is used to specify database schemas by a set of definitions contained in it.
). Data Mani!u"ation /anguage 3DM/4
&t is a language for accessing and manipulating the data organized by the appropriate data model.
DM4 is also known as ,uery language.
1age ((
Notes of Database Management System
5here are two types of DM4
a 'roe,ura" DM/s
b De"arati&e DM/s 3non-!roe,ura" DM/s4
(. 1rocedural DM4s - 5his language re,uires user to specify what data is re,uired and how to get those data.
). Declarati+e DM4s (non-procedural DM4s - 5his language re,uires user to specify what data is re,uired
without specifying how to get those data.
$ e a t u r es o f DD /
(. 7sed to specify a database schema as a set of definitions e2pressed in a DD4
). DD4 statements are compiled# resulting in a set of tables stored in a special file called a data dictionary or data
directory.
*. 5he data directory contains metadata (data about data.
-. 5he storage structure and access methods used by the database system are specified by a set of definitions in a
special type of DD4 called a data storage and definition language.
8. Basic idea of DD4' 5o hide implementation details of the database schemes from the users.
$ e a t u r es o f D M/
(. . DM4 is a language which enables users to access and manipulate data.
). 5he goal is to pro+ide efficient human interaction with the system.
*. 5here are two types of DM4s
a. 1rocedural' >ere user specifies what data is needed and how to get it.
b. Non-procedural' >ere user only specifies what data is needed.
- /asier for user
- May not generate code as efficient as that produced by procedural languages
D B M S S *s te) Str u ture a n, i t s C o ) ! o nents
Be can e2plain the o+erall structure of DBMS<System structure and its components by the diagram gi+en below'
(. Database systems are partitioned into modules for different functions. Some functions (e.g. file systems may be
pro+ided by the operating system.
). Broadly the functional components of a database system are'
a% 5 u e r* ' r o e ss o r ' &t is one of the functional components of DBMS. &t translates statements in a ,uery language
into low-le+el instructions the database manager understands. &t may also attempt to find an e,ui+alent but more
efficient form.
1age ()
Notes of Database Management System
&t contains following components'
a. DM4 compiler - &t con+erts DD4 statements to a set of tables containing metadata stored in a data dictionary.
&t also performs ,uery optimization.
b. DD4 interpreter 6 &t interprets DD4 statements and records definitions into data dictionary.
c. Huery e+aluation engine 6 &t e2ecutes low-le+el instructions generated by DM4 compiler. 5hey mainly deal
with sol+ing all problems related to ,ueries and ,uery processing. &t helps database system simplify and facilitate
access to data.
b% S t ora g e M a nger 3 D a t a ba s e M anage r 4
(. Storage manager is a program module that pro+ides the interface between the low-le+el data stored
in the database and the application programs and ,ueries submitted to the system.
). 5he storage manager is responsible to the following tasks'
(. interaction with the file manager
). efficient storing# retrie+ing and updating of data
*. 5he important components include'
a. 0ile manager' &t manages allocation of disk space and data structures used to represent information on disk.
b. Database manager' &t is the interface between low-le+el data and application programs and ,ueries.
c. 5ransaction manager' 5ransaction manager ensures that the database remains in a consistent (correct state
despite system failures (e.g.# power failures and operating system crashes and transaction failures.
d. DM4 precompiler' &t con+erts DM4 statements embedded in an application program to normal procedure
calls in a host language. 5he precompiler interacts with the ,uery processor.
e. DD4 compiler' &t con+erts DD4 statements to a set of tables containing metadata stored in a data dictionary.
f. .uthorization and integrity manger 6 &t conducts integrity checks and user authority to access data.
g. Buffer manger 6 &t is critical part of DB and stores temporary data.
&n addition# se+eral data structures are re,uired for physical system implementation'
a. Data files' 5hey store the database itself.
b. Data dictionary' &t stores information about the structure of the database. &t is used hea+ily. Ireat emphasis
should be placed on de+eloping a good design and efficient implementation of the dictionary. &n short# it stores
metadata.
c. &ndices' 5hey pro+ide fast access to data items holding particular +alues.
1age (*
Notes of Database Management System
D a ta M o ,e"
. data model is collection of tools for describing
(. data ). data relationships *. data semantics -. data constraints
T*!es of Data Mo,e"s
5here are basically two types of data models
(. %ecord based Data Models. ). $bEect based Data Models.
(. %ecord based Data Models 6 &n %ecord-based models# the database is organized in fi2ed-format records of se+eral
types. . fi2ed number of fields# or attributes# are defined in each record type# and each field is usually of a fi2ed
length.
5he three most popular record-based data models are
(. %elational Data Model ). Network Data Model *. >ierarchical Data Model
Mrs Mousmi .Eay 3haurasia 4ect.Deptt of &N0$%M.5&$N 5/3>N$4$IN 1age (-
Notes of Database Management System
1% R e "a tio n a" Da ta M o , e " 6
(. 5he relational model uses tables to represent the data and the relationships among those data.
). /ach table has multiple columns# and each column is identified by a uni,ue name.
*. &t is a low le+el model.
&n this database# each row in the table represents a different customer. %elationships link rows from two tables on the
basis of the key field# in this case 6 number.
A ,&an t ag e s o f R e " a ti o n a" D a t a Mo , e"
a% Strutura" In,e!en,ene 6 %elational database model has structural independence# i.e. changes made
in the database structure do not affect the DBMS@s capability to access data.
b% Si)!"iit* 6 5he relational model is the simplest model at the conceptual le+el. &t allows the designer
to concentrate on the logical +iew of the database# lea+ing the physical data storage details.
% Ease of ,esigning7 i)!"e)entation7 )aintenane7 an, usage 6 Due to the inherent features of data
independence and structural independence# and the relational model makes it easy to design#
implement# maintain and use the databases.
,% A,#o 8uer* a!abi"it* 6 $ne of the main reasons for the huge popularity of the relational database
model is the presence of powerful# fle2ible and easy-to-use ,uery capability. 5he ,uery language of the
relational database model 6 Structure Huery 4anguage or SH4 6 is a fourth generation language
(-I4. . -I4 concentrates on the ?what@ and not on the ?how@ of the problem. Selecti+e output can be
achie+ed by gi+ing a simple ,uery. 5he relational database translates the user ,ueries into the code
re,uired to e2tract the desired information.
1age (8
Notes of Database Management System
D is a,&a n t ag e s o f R e " a ti o n a" D a t a Mo, e "
a% 9ar,-are o&er#ea,s 6 5he %DBMS needs comparati+ely powerful hardware as it hides the implementation
comple2ities and the physical data storage details from the users.
b% Ease of ,esign an resu"t in ba, ,esign 6 .s the relational database is an easy-to-design and use system# it can
result in the de+elopment and implementation of poorly designed database management systems. .s the size of the
database increases# se+eral problems may creep in 6 system shutdown# performance degradation and data corruption.
0% N et - o r : Da ta M o , e " 6
(. &n the network model# data are represented by collections of records.
). %elationships among data are represented by links.
*. &n this model Iraph data structure is used.
-. . network model permits a record to ha+e more than one parent
A ,&an t ag e s o f N et - or: D a t a M o,e"
a% Si)!"iit* 6 5he network data model is also conceptually simple and easy to design.
b% Abi"it* to #an,"e )ore re"ations#i! t*!es 6 5he network model can handle the one-to-many and many-to-many
relationships.
% Ease of ,ata aess 6 &n the network database terminology# a relationship is a set. /ach set comprises of two types
of records 6 an owner record and a member record. &n a network model an application can access an owner record
and all the member records within a set.
,% Data Integrit* 6 &n a network model# no member can e2ist without an owner. . user must therefore first define
the owner record and then the member record. 5his ensures the data integrity.
e% Data In,e!en,ene 6 5he network model draws a clear line of demarcation between the programs and the
comple2 physical storage details. 5he application programs work independently of the data. .ny changes made in the
data characteristics do not affect the application program.
f% Database stan,ar,s 6 5he standards de+ised by the DB5I (Database 5ask Iroup of 3$D.SN4 3ommittee form
the basis of the network model. 5hese standards were further enhanced by .NS&<S1.%3 (.merican National
Standards &nstitute<Standards 1lanning and %e,uirements 3ommittee in the (=:Ds. .ll the network database
1age (9
Notes of Database Management System
management systems adhere to these standards. 5hese standards comprise of a DD4 and a DM4 that augments the
database administration and portability.
D is a,&a n t ag e s o f N e t- o r : D a t a Mo , e"
a% S*ste) o)!"e;it* 6 &n a network model# data are accessed one record at a time. 5his makes it essential for the
database designers# administrators# and programmers to be familiar with the internal data structures to gain access to
the data. 5herefore# a user-friendly database management system cannot be created using the network model.
b% /a: of strutura" in,e!en,ene 6 Making structural modifications to the database is +ery difficult in the network
database model as the data access method is na+igational. .ny changes made to the database structure re,uire the
application programs to be modified before they can access data. 5hough the network database model achie+es data
independence# it still fails to achie+e structural independence.
1% 9i er a r # i a" M o , e "
(. &n the hierarchical model# data are represented by collections of records.
). %elationships among data are represented by links.
*. &n this model 5ree data structure is used.
-. 5here are two concepts associated with the hierarchical model 6 segment types and parent-child relationships.
Segment type is similar to the record types in the network models. 5he information retrie+ed only by na+igating from
the root segment type to the nodes segment types. 5hus you can access a segment type only +ia its parent segment
type in the parent-child relationship. 5he operators pro+ided for manipulating such structures include operators for
tra+ersing hierarchic paths up and down the trees.
1age (:
Notes of Database Management System
A ,&an t ag e s o f # i e rar # i a" Mo , e"
1% Si)!"iit* 6 Since the database is based on the hierarchical structure# the relationship between the +arious layers is
logically simple. 5hus# the design of a hierarchical database is simple.
0% Data Seurit* 6 >ierarchical model was the first database that offered the data security that is pro+ided and
enforced by the DBMS.
1% Data Integrit* 6 Since the hierarchical model is based on the parent<child relationship# there is always a link
between the parent segment and the child segment under it. 5he child segments are always automatically referenced
to its parent# this model promotes data integrity.
<% Effiien* 6 5he hierarchical database model is a +ery efficient one when the database contains a large number of
one-to-many relationships and when the users re,uire large number of transactions# using data whose relationships are
fi2ed.
D is a,&a n t ag e s o f # i e rar # i a " Mo , e"
1% I)!"e)entation Co)!"e;it* 6 .lthough the hierarchical database model is conceptually simple and easy to
design# it is ,uite comple2 to implement. 5he database designers should ha+e +ery good knowledge of the physical
data storage characteristics.
0% Database )anage)ent !rob"e)s 6 &f you make any changes in the database structure of a hierarchical database#
then it is re,uired to make the necessary changes in all the application programs that access the database. 5hus#
maintaining the database and the applications can become +ery cumbersome.
1% /a: of strutura" in,e!en,ene 6 Structural independence e2ists when the changes made to the database
structure does not affect the DBMS@s ability to access data. >ierarchical database systems use physical storage paths
to na+igate to the different data segments. So the application programmer should ha+e a good knowledge of the
rele+ant access paths to access the data. So if the physical structure is changed the applications will also ha+e to be
altered. 5hus# in a hierarchical database the benefits of data independence are limited by structural dependence.
<% 'rogra))ing o)!"e;it* 6 Due to the structural dependence and the na+igational structure# the application
programmers and the end users must know precisely how the data is distributed physically in the database in order to
access data. 5his re,uires knowledge of comple2 pointer systems# which is difficult for users who ha+e little or no
programming knowledge.
1age (;
Notes of Database Management System
=% I)!"e)entation "i)itation 6 Many of the common relationships do not conform to the one-to-many format
re,uired by the hierarchical model. 5he many-to-many relationships# which are more common in real life# are +ery
difficult to implement in a hierarchical model.
S%No 9ierar#ia" Data Mo,e" Net-or: Data Mo,e" Re"ationa" Data Mo,e"
(. %elationship between records
is of parent child type.
%elationship between records is
e2pressed in the form of pointers
or links.
%elationship between record is
represented by a relation that contains a
key for each record in+ol+ed in the
relations.
). Many-to-many relationship
cannot be e2pressed in this
model.
Many-to-many relationship can
also be implemented.
Many-to-many relationship can be easily
implemented
*. &t is a simple# Straight forward
and natural method of
implementing record
relationships
%ecord relationship
implementation is ,uite comple2
due to the use of pointers.
%elationship implementation is +ery easy
though the use of a key or composite key
field(s.
-. 5his type of model is useful
only when there is some
hierarchical character in the
database.
Network model is useful for
representing such records
which ha+e many-to-many
relationships.
%elational model is useful for
representing most of the real world
obEects and relationships among them.
8. &n order to represent links
among records# pointers are
used. 5hus relationships
among records are physical.
&n Network model also the
relationship among records are
physical.
%elational model does not maintain
physical connection among records. Data
is organized logically in the form of
rows and columns and stored in table.
9. Searching for a record is +ery
difficult since one can retrie+e
a child only after going though
its parent record.
Searching a record is easy since
there are multiple access paths to
a data element.
. uni,ue# inde2ed key field is used to
search for a data element.
:. During updation or deletion
process# chance of data
inconsistency is in+ol+ed.
No problem of inconsistency
e2ists in network model because
a data element is physically
located at Eust one place.
Data integrity maintaining methods like
Normalization process# etc. are adopted
for consistency.
1age (=
Notes of Database Management System
O b >e t B as e , Da ta M o , e "s 6 &n $bEect-based models# the database is organized in real world obEects of se+eral
types. . number of fields# or attributes# are defined in each obEect type# and each field is usually of a +ariable length.
5he two most popular obEect-based data models are
a. $bEect oriented model b. / % Model
(. $bEect $riented Model -
(. 5he obEect-oriented model is based on a collection of obEects# like the /-% model.
). .n obEect contains +alues stored in instance +ariables within the obEect.
*. 7nlike the record-oriented models# these +alues are themsel+es obEects.
-. 5hus obEects contain obEects to an arbitrarily deep le+el of nesting.
8. .n obEect also contains bodies of code that operate on the obEect. 5hese bodies of code are called methods.
9. $bEects that contain the same types of +alues and the same methods are grouped into classes.
:. . class may be +iewed as a type definition for obEects.
;. .nalogy' the programming language concept of an abstract data type.
=. 5he only way in which one obEect can access the data of another obEect is by in+oking the method of that other
obEect. 5his is called sending a message to the obEect.
(D. &nternal parts of the obEect# the instance +ariables and method code# are not +isible e2ternally.
((. %esult is two le+els of data abstraction.
0or e2ample# consider an obEect representing a bank account.
a. 5he obEect contains instance +ariables number and balance.
b. 5he obEect contains a method pay-interest which adds interest to the balance.
c. 7nder most data models# changing the interest rate entails changing code in application programs.
d. &n the obEect-oriented model# this only entails a change within the pay-interest method.
(). 7nlike entities in the /-% model# each obEect has its own uni,ue identity# independent of the +alues it contains'
a. 5wo obEects containing the same +alues are distinct.
b. Distinction is maintained in physical le+el by assigning distinct obEect identifiers.
1age )D
Notes of Database Management System
A ,&an t ag e s o f O b > e t O r ien t e, D a t a M o,e"
a. 3apability to handle large number of different data types 6 5raditional database models like hierarchical# network
and relational database are limited in their capability to store the different types of data. 0or e.g.# one cannot store
pictures# +oices and +ideo in these databases. But the obEect-oriented database can store any type of data including
te2t# numbers# pictures# +oice and +ideo.
b. 3ombination of obEect-oriented programming and database technology 6 1erhaps the most significant
characteristic of obEect-oriented database technology is that it combines obEect-oriented programming with database
technology to pro+ide an integrated application de+elopment system.
c. $bEect-oriented features impro+e producti+ity 6 &nheritance allows one to de+elop solutions to comple2 problems
incrementally by defining new obEects in terms of pre+iously defined obEects. 1olymorphism and dynamic binding
allow one to define operations for one obEect and then to share the specification of the operation with other obEects.
5hese obEects can further e2tend this operation to pro+ide beha+iors that are uni,ue to those obEects. Dynamic
binding determines at runtime# which of these operations is actually e2ecuted# depending on the class of the obEect
re,uested to perform the operation. 1olymorphism and dynamic binding are powerful obEect-oriented features that
allow one to compose obEects to pro+ide solutions without ha+ing to write code that is specific to each obEect. .ll of
these capabilities come together to pro+ide significant producti+ity ad+antages to database application de+elopers.
d. Data access 6 $bEect-oriented database represent relationships e2plicitly# supporting both na+igational and
associati+e access to information. .s the comple2ity of interrelationships between information within the database
increases# the greater the ad+antages of representing relationships e2plicitly. .nother benefit of using e2plicit
relationships is the impro+ement in data access performance o+er relational +alue-based relationships.
D is a,&a n t ag e s o f O b > e t O r i en te, D a t a Mo, e "
a. Difficult to maintain 6 &n the real world# the data model is not static. &t changes as organizational information
needs change and as missing information is identified. 3onse,uently# the definition of obEects must be changed
periodically and e2isting databases migrated to conform to the new obEect definitions. $bEect-oriented databases are
semantically rich introducing a number of challenges when changing obEect definitions and migrating databases.
$bEect-oriented databases ha+e a greater challenge handling schema migration because it is not sufficient to simply
migrate the data representation to conform to the changes in class specifications. $ne must also update the beha+ioral
code associated with each obEect.
b. Not suited for all applications 6 $bEect-oriented database systems are not suited for all applications. &f it is used in
situations where it is not re,uired# then it will result in performance degradation and high processing re,uirements.
$$DBMS is popular in area such as e-commerce# engineering product data management# and special purpose
1age )(
Notes of Database Management System
databases in securities and medicine. 5he strength of the obEect model is in applications where there is an underlying
needed to manage comple2 relationships among data obEects.
E R M o ,e" 3En t i t * R e "a t io n a " M o , e " 4
(. 5he entity-relationship model is based on a perception of the world as consisting of a collection of basic obEects
(entities and relationships among these obEects.
). &t is an obEect-based logical model.
*. &t is a high-le+el data model.
-. .n entity is a distinguishable obEect that e2ists.
8. /ach entity has associated with it a set of attributes describing it. /.g. number and balance for an account entity.
9. . relationship is an association among se+eral entities.
/.g. . custCacct relationship associates a customer with each account he or she has.
:. 5he set of all entities or relationships of the same type is called the entity set or relationship set.
;. .nother essential element is the /-% diagram in which the mapping cardinalities e2press the number of entities
to which another entity can be associated +ia a relationship set.
=. 5he o+erall logical structure of a database can be e2pressed graphically by an /-% diagram'
a. %ectangles' represent entity sets.
b. /llipses' represent attributes.
c. Diamonds' represent relationships among entity sets.
d. 4ines' link attributes to entity sets and entity sets to relationships.
1age ))

You might also like