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

DBMS

This document discusses the evolution and significance of Database Management Systems (DBMS) in managing data compared to traditional file systems. It outlines the structure, components, advantages, and various levels of abstraction of DBMS, emphasizing the importance of data organization, integrity, security, and user access. The document highlights how DBMS facilitates efficient data storage, retrieval, and manipulation, ultimately aiding effective decision-making in modern management.

Uploaded by

mbbharathnair
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

DBMS

This document discusses the evolution and significance of Database Management Systems (DBMS) in managing data compared to traditional file systems. It outlines the structure, components, advantages, and various levels of abstraction of DBMS, emphasizing the importance of data organization, integrity, security, and user access. The document highlights how DBMS facilitates efficient data storage, retrieval, and manipulation, ultimately aiding effective decision-making in modern management.

Uploaded by

mbbharathnair
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Concepts of DBMS

In early days, data was stored as text files. Later, varíious methods were
developed for structured data storage. This chapter will explore the concept
of database and its comparison with conventional files system. Database
Management System (DBMS) is a valuable tool for manipulating
computerized information. With the aid of this tool, the process of storing,
is greatly simplified. Here we learn the structure
retrieving and modifying data
and components of DBMS. Database abstraction, the types of users of DBMS
and the different data models are also discussed here.

11.1 Introduction
Information is a key word in modern management. As anyone with a

cluttered office knows, having a large quantity of information does not


guarantee ready access to any particular piece of infor mation. The basic
challenge is to provide users with timely and versatile access to data stored in
computer files. In a dynamic business environment, there are many
unanticipated needs for information. For effective decision-making, one
should have access to information that is up to date whenever needed.
Database Management Systems have the potential to meet this challenge. A
Database Management System is an effective data management tool that helps
with data organisation, data access and the quality of information available
fog decision-making. Database management has evolved from a
specialized
computer application to a central component of the modern computing
environment.

11.2 Databases

A database system is essentially a


computerized record keeping system.
A database is a collection of data
pertaining to a particular enterprise. The
310.
ComputerSeienceStd X 0000wW ww

primary goal of a DBMS is to provide an environment that is both convenient


and efficient to use in storing and retrieving database information.

Database systems are designed to manage large quantities of


information. The management of data involves the definition of structures
for storage of data and provision for manipulation of data. In addition,
database system must provide safety for information stored, despite system
crashes or unauthorized access. It should also provide for sharing of data
among several users without anomalous results.

Adatabase managenmentsystem (DBMS) consists of acollection


of anterrelated data and a set of programs to access those data,

11.3 Advantages of Databases Over Conventional Systems


In the 1950's when commercial use of computers was just beginning,
magnetic tape was the storage medium and data was stored sequentially in
files. A file management software was used to create, retrieve and manipulate
these files. Traditionally, a large organisation like a university would have
different files for different purposes, such as one file for Course Mark details,
another for storing Student details and a third for Tuition Billing. Each would

of files have several


be used independently to produce reports. These types
disadvantages.
In file management systems, the data tend to repeat in many files.
same
in botha
The name, address and telephone number of a student gets repeated
different
Course Mark and Tuition Billing files, When data is repeated in

files, they waste storage space.


When the same
Therepetition of data c a n c a u s e consi_tency problems.
in different files, s o m e
data fields (Name, Address, TelNo) must be changed
produced with
The result is that reports will be
erroneous
files may be missed.
information.
created by
different data files w e r e
With file management sy stems, it
each file was in a different for mat,
programmers in different formats. Since
that would access
single program
prevented the programmer from.writing
a

all data in multiple files.


311
Computer Science Sid XI

As computers became more and more impornant, the problems with


data storage also increased. Fortunately, the arrival of magnetic disk as the
popular storage medium instead of magnetic tapes led to new possibilities
for storing data.

1.3.1 Advantages of DBMS

1. Data Redundancy

Duplication of data is known as data redundancy

In file management systems, data may be repeated in many files


This redundancy leads to higher storage and access cost. Database systems
do not maintain separate copies of th same data. The single biggest

advantage of database is that all the data is kept at one place. All the

data refer the centrally maintained


applications or users that require to

database.
should
Incidentally, this does suggest that all redundancy can or
not

be eliminated. Sometimes there can be technical or business r e a s o n s for


the data. Howe ver, such
maintaining several distinct copies of same any

redundancy should be carefully controlled.

2. Inconsistency can be avoided.

Data redundancy may lead inconsistency, that is, the


to data various

student address
copies of the same data may not agree. For example, a changed
and Course Mark files. Clearly, a
may not be reflected in Tuition Billing
database that is ín an inconsistent state is capable of supplying incorrect
or

inconsistent data to users.

If redundancy is removed, is, if each piece of data is stored only


that
once, then such an inconsistency cannot occur. If redundancy is controlled,
then DBMS can guarantee that database is never inconsistent,) This is done
either of the repeated data is
by ensuring that any change made to two

automatically applied to the other one also.


Computer Non0 d XI

Data can be shared.

Sharing of data means that the «data Mored in the datalbase can be shared
among several users or programs and each may use it lor dilferent purposes

Sharing means not only that the existing application program can
share the data in the database, but also that be
new
prograns can
developedd
to
operate on the same data.

4. Standards can be enforced.


The centralized control of the database ensures
that all applicable
st andards are observed
in the representation of data. The standards
may be
those laid out by the
organisation company for using the database. For
or

example, that a field 'Name' should


have 40 characters, is a standard that can
be set by a company while
creating a database. COr there may be certain industry
standards that should be followed.
Naming conventions for columns such as,
RollNo, iMark for integer colums and sName,
characters are examples.
sDepartment for string of
Similarly, therc can be national and international
standards. For example, ANSI standards, ISO
etc. standards,
Maintaing
data standards is advisable as it is useful when there is a
data transfer between
systems.
5. Security restrictions can be applied.
The information inside a database is of great value to any company
organisation. Therelore it must be kept secure and
or

private.
Data security resers o the protection of data against accidental
inenional disclosure or unauthorized destructión
or

unauthorized persons.)
or modification by
(The various
prograins and users may hare data in connmon. But
access
to
specilic inforation can be limied to selected
user)Through the use of
passwords, the iniomation in a database is made available
have a legitimate only to those who
righi
1o access il.

. b. Inlegrity can be maintained.


Data integrily cnsures that
the data in the database
Inconsistency betw een telephone numbers of the is
correct, )

same student stored in two


313
onjputer SeienceStd Xi1
vwvnrmrwienwovw
different locations is an example of lack of integrity. Of course, this problem
arises if redundancy exists in stored data.
The data may contain incorrect information, even if there is no
redundancy. The Date of Birth can be 30/30/2001, the Marks obtained in a
subject can be more than the maximum marks, etc. To avoid these errors
Database Management System defines integrity checks such as range checks
or value checks. A range check ensures that a data must be within a certain
range.Value check matches for values that must be present already,)
Most of the advantages listed above are fairly obvious. For effective
use of database in an organisation, it should be preferably consistent, sharable,
standardized, integrated and secure.

4 Structure of DBMS
Databases consist of a collection of data that is used by application
and retrieval of
programs of given enterprise. For effective storage
a

records and files.


infor mation, data is organized as fields,

1. Fields
A field is the smallest unit of stored data. Each
fields consists of data of
Student database can be RollNo,
a specific type. For example, the fields of
Name consists of
Name, DateofBirth, etc. Here Rollno is integer type,
characters and DateofBirth is a date.

2 Record
collection of related fields. For example, the group of
A record is a

student such as
fieldsrepresenting personal information about a particular
record.
his RollNo, Name, DateofBirth, etc. constitute a

3. File
A file is a collection of all type of record. A Personal
occurrences of one

Infarmntion file consists of the details of all the students.


Computer Suieneo Std XI
*****"*******

Database ehemna
Pakaboe Lnatan t
a skeleto shuet coe
ih at epnesents Re legtcal Databasc sho skol cpealinal
da abue
Vic he enlne Files database data a
t delnes heu Rhe data
IE
IS nised heuw Hhe C Ven tme
Changs wt time
eltus aneng m Field

a s Seiate d
ersnet cten tnin data).
101 Raju 65 75 Record

Fig. 11.1 Fields, Records and Files in a Database


115 Components of DBMS
a. Databases

The main
component of DBMS is the database itself. Database is an
organized collection of infor mation. The database consists of structuures to
hold this information.
b. Data Definition Language (DDL) ued to dne dala skucluu
A database schema is
specified by a set of definitions
expressed in a Ca paticula
eu s special language called data definition language. The result of compilation of
s c h m a dalabase, D S t a t e m e n t s 1s a set of tables that is stored in a special file called Data
way ogaes
data t a
Dictionary.
Compul eq:ai=
A data dictionary is a file that contains
data, that is, data about
a REATE, data. This file is consulted before actual data
meta

ALTER e are read or modified by the


database system.|
c.
C. Data Manipulation Language (DML)
Data Manipulation Language is language that enables users to access
a

or
manipulate data as organized by the appropriate data model. DML provides
the techniques for procesing database such
a as retrieval, sorting, display
and deletion of data
records.)

315
omputereloneeSd KI
Data Manipulation Language provides interfaces with programming
languages. lt allows users and application be
physical data storage.
programs to
independent of
d. Users
Users interact with the DBMS
indirecthy via application programs or
directly via simple query languages. The user's interactions with the DBMs
include the definition of logical
relationships in the database and manipulation
of data.

Users
Applcat.on Phaghanm
Debabase Adminicat
n d Ustrs DML Compiler DDL Interpreter
Database
Management
System

Data Files Disk Storage

Fig. 11.2 Simplified picture of Database structure

11.6 Database Abstraction


For the database system to be usable, it must retrieve data efficiently.
The database system should also provide only that much information that is
required. This means thatlehe system does not disclose all the details of the
data, rather it hides certain details of how the data is stored and maintained.
It should also be noted that, since many database system users are not
computer trained, developers hide the complexity from users through several
levels of abstraction. This simplifies the user interaction with the system.|

Consider a banking enterprise that can have several record types like
Customer that stores customer details like AccountNo, Name, Address, etc.;
Account that contains AccountNo, alance, etc. and Employee that store
Name, Dateoforning, Salary, etc. of the employees in the bank. We will discuss
the different levels of abstraction based on this example.

316
dala abshaclion .
H.ding ukvant details rom
/Hiding
Computor
Suienco Std XI

Abstraction
11.6.1 Levels of Database

a.
.
Physical Level
level describes
T1 desenbee This is the lowest level of abstraction.The physical
low-level
aclual stored in the storage
medium. Complex
how the data is actually
Sloyed tm etatabese
is
data s t r u c t u r e s are described in detail at this level.
data
actual storage
records will be stored in
At the physical level, the
he
memory as bytes.
The database hides these
locations in primary
or secondary
details from the programmers

Data Item | Starting Position Length in


Name in Record Bytes
AccountNo 1 4
Name 30
House 35 20
Locality 55 20
City 75 15

Fig. 11.3 Storage format for Customer record

dkibet
tcha
b. Logical Level
The logical level is the next higher level of abstraction. It describes,
sletud what data are stored in the database and what relationships exist among those
data Here the entire database is described in terms of simple structures. The

databasa.
aata
logical level of abstraction is'used by databasé administrators, who must decide
what information is to be kept in the database. The description at this level is
independent of the actual data storage details.
The records are defined at the logical level. That is, the type of data
(Name as character, AccountNo as integer, etc.) and their relationships are
specified here. Programmers work at this level using a programming language.

AccountNo Integer
Name Character (30)
House Character (20)
Locality Character (20)
City Character (15)
Fig. 11.4 Structure of Customer record
317
wwww. wwww
Commputer Scionce Std XII

Account Nol Name House Locality City


1001 Biu Dwaraka NellikodHe Calicut
1002 Sajith Kripa Kaloor Cochin
1003 Harish Vaishakh Pattom Trivandrum
1004 Manu Abhiram Palayam Calicut

Fig. 11.5 Data stored in Customer.

c. View Level

View level is the highest level of database


t h e abstraction and is the closest
USe inlsauon to the users. It is concerned with the in which the individual users view
keithdatabase
e s

c i b
way
the data. It describes only
E o s
part of the entire database. Most of the users of
a

the database are not concerned with all


the information that is contained in
the database. Instead they need
only a part of the database that is relevant to
64srm
6yshtm them. This simplifies their interaction with the
system.
Finally, at the view
level, computer users see a set of programs that
hides all the details of the database. The tellers at the
bank can see only that
part of the database that has information on customer accounts. They cannot
access information about the salaries of
employees.
The ability to modify a scheme detinition at
one level without
affecting the scheme definition at the next higher level is
called data
ndependence
11.8 Users of Database
The different types of users are differentiated by the way they are
expected to interact with the database system.

Database Administrator
The Database Administrator (DBA) is a person who has a central control
over the data and programs that access data in a DBMS. He is in charge of
creating, maintaining and modifying all the three levels of the DBMS. He
controls the allocation of system resources, access to users and ensures
consistency of the database.

b. Application Programmer
Application programmers are computer professionals who interact with
the DBMS through application programs. Application
programs are programs
written in any host language (for example Visual Basic, C, C++, Pascal) and
interact with the DBMS through DML calls. An application programmer
defines the conceptual view for the database using the internal structure
defined by the database administrator.

C. Naive Users
Naive users are unsophisticated users who interact with the system by
invoking one of the application programs written previously. He is not
concerned with or even aware of the details of the DBMS. Typically he does
only querying and updation. Naïve users deal only with the highest level of
abstraction.

320 o
he loqical drrigu gbucha
A database edl dfivnes alt3ecl
hru) dala mtll he chone d,
a
datahate imd definee
on. ated a DPMS
Computer Suience Std XI
n e

doki

moel: X11.9 Data Modcls


Theu
Theae pheexdrd
a l a dala t tach
o h n

and implementation of any DBMS a r e based upon a data


Design
model. A data model provides a collection of conceptual tools for describing
nneted
n dhrtu he a
ln

t s l o n e . di n i d ehe
data, data relationships, data semantics and consistency problems. Database
systems are generally based on one of the three models - hierarchical, network

or relational.
a. Hierarchical Model - o Yganises data into a thez lke s t u d u , w h a

The hierarchical model assigns records to different levels of a hierarchy. Stngle neot
A lower level record is called a child and a higher level one is called a parent. fo ewch all
The parent record at the top of the database is called the root record Any he oheY data

record other than the Is nked


root must be connected with a superior record (parent).
Thus to insert a record, the user must select a parent record first. When a 1he harcorChy
record is deleted, all the descendents of the record also deleted.
are sheonh o m
Consider a department store database that keeps track of the sales he Teo t data
details such as the address of the
customer,payment details (cash, cheque, expands Like
credit card) and item details. A customer
who purchases particular item a hee, addiusa

makes payment by cash, card or cheque and his address is noted down. The
ehalá ne da o
database model for department store is given below.
ha parnt nedc3-
(Date, Time) A ctueld nede caun
Date
have only onc
(Name, Address)
Customer
(Type of payment, Amount)
Payment
(Item code, Name, Price)
Item

Fig. 11.8 Database model of Depar tment store

There are several disadvantages for this data model.


There is lot of scope for
a
duplication of data in this model. For example
if a customer Ram buys items on four days, then his address is recorded four
times.
321
** Computer Science Std XII *****

****

change in the address of the


customer Ram, then
Also, if there is a

of Ram has to be updated separately.


every instance
this data should be concerned with the
Any program using
complexities of data storage.

10/01/2004 11/01/2004 12/01/2004

Gina L Ram] Hari Ram |Ram


Cash ChequeCheque Cash Card Cash CardCard

101] 105 102] 101] 104 102 103 101 105


model
Fig. 11.9 Department Store data in hierarchical

b.
b. Network Model
The network model is similar to the hierarchical model, but each child
record. This model eliminates the
record can
have more than one parent
encountered in the previous case. The network model was
redundancy
Systems Data Languages
proposed by CODASYL-DBTG (Conference
on

Database Task Group) in 1971. Network database


is more flexible than
established between
hierarchical, because different relationships may be
the department store
different branches of data. The data representation of
database discussed above, in network model is given below.

10/01/2004 11/01/2004 12/01/2004


Hari
Gita Lata Ram
Ra
Cheque Cash Card

101 102 103 104 105

11.10 Department store database in network model


Fig.
Although this model reduces the duplication problem of hierarchical
model, it introduces certain other problems. The network model has a high

degree of complexity. Hence errors are difficult to trace.

.322 Wwww
Computer Boieme Std XI

also not flexible enough to


The hamework of the network model is

make hanges casily once data is entered


concerned with complex details
The problem of data retrieval program

t data storape also remains.

Relational Model
the concept introduced by E F Codd
The relational model is based on
H a l n

databases.
in his seminal paper on the application of relational (set) theory to

tables. Here data is


A relational database is composed of one or more

Aelatons
elatcn:h
SrnatemhioM database, tables are called relations, rows
h a t a i w e db y
of
stored in different tables made up rows and columns. In a relational

are called tuples and the columns


are called attributes.
database is
The relational model representation of department store

ld
given below.

Customer (Customer, Address)

Payment (Date, Time, Customer, Method, ItemCode)


Item (ItemCode, Name, Price)
11.11 Relational model for Department store database
Fig.
In the above example, the data in the database is stored in three tables
or relations namely, Customer, Payment and Item. The columns of each table
are written in the brackets provided.

The advantage of this model is that it offers flexibility. Data can be


easily updated in the database. Any data that is to be changed need to be
updated only once. Modifications to the structure can be done without
affecting the entire frame work. We learn more about relational databases in
the next topic. Customer
Customer Address
Gita Add1
Lata Add2
Ram Add3
Hari Add4
Raj Add5

323
Computer Science Std XII3 wwww****

Payment
Date Time Customer Method ItemCode
10/01/2004 10 am Gita Cash 101

10/01/2004 10 am Gita Cash 105

10/01/2004 11 am Lata Cheque 102

10/01/2004 1 pm Ram Cheque 101

11/01/2004 10 am Hari Cash 104

11/01/2004 12 pm Ram Card 102

12/01/2004 11 am Lata Cash 103

12/01/2004 12 am Raj Card 101

12/01/2004 3 pm Ram Card 105

11.12 Data in Department store database in relational model


Fig.
11.10 RDBMS
The relational model or Relational Database Management System
(RDBMS) represents the database as a collection
of relations, each of which
is assigned a unique name. Each relation resembles a table or to some extent,
a file. A school database that consists of relations or tables that store the

personal details of students, called STUDENT, district details of students


called DIS7TRICT and marks of students called MARK is shown below.

Item
ItemCode Name Price
101 AA 25

102 BB 25
103 CC 15

104 DD 20
105 EE 25
AdmNo RollNo Year Name Batch Father Mother | DistCode
Smitha D-01
11001 2001 Biju SCIENCE Ram
SCIENCE Thomas Mary D-01
11002 2 2001 Saju
Latha D-03
11003 1 2001 Renju COMMERCE Raju
COMMERCE| Mohan Reena D-02
11004 2001 Sajiv
2002 Aravind COMMERCE|SomanSecna D-04
D-02
2002 Binu COMMERCE Rajeev Bindu
1007 2 2002 Anand SCIENCE Mohan Sheela D-01
STUDENT relation

Total Rank
AdmNoSublSub2Sub3
11001 75 70 60 205 4

11002 70 80 50 200 5

11003 80 85 70 235 1

11004 90 55 80 225 2

11005 60 70 90 220 3

11006 50 75 60 185185 7

11007 70 65 60 195 6

MARK relatio

DistCode District
D-01 Kozhikode
D-02 Ernakulam
D-03 Kottayam
D-04 Trivandrum
DISTRICT relation

Fig. 11.13 SCHOL database

in the table represents a collection of related


In a relation each row

data values. These values can be interpreted as factsdescribing a real world


column of a table helps t o interpret the
entity or relationship. The name

of the table. The column names AdmNo, RollNo,


values stored in each row

STUDENT relation a r e used to describe a


in a row of
Year, Name, etc.
column are of the same data type.
particular student. All values in a

325
ComputerScience Std Xf
11.11 Terminologies in RDBMS
11.11.1 Relation

Arelational database consists of a collection of tables or relations.


Relation is a mathematical term for a
table. Each row in a table represents a
relationship among a set of values. Since a table is a collection of such
relationships it is called as a relation. Figure 11.13 represents a STUDENT
relation.
11.11.2 Domain
(avgt atteptoilu volues t2
tolant e)
A domain is a
pool
of values from which actual values
appearing in
a
given column are drawn. In the above example, the subl column of
MARK
relation can have any value in the
range 0 to 100. This range of values from
which a particular value
represents the marks for Sub1 of a student is called
domain. The domain of each column
may differ. The Year column in
STUDENT relation can have any valid
year as its domain.
111.11.3 Tuple /nci)
The rows of a relation
consists of
are
generally referred
tuples. A row
to as
complete
a set of values used to
represent particular entity. In
a
the example, (Fig. 11.13) each row in the STUDENT
the personal details of relation, represents
a
particular student and each row in the relation
MARK, represents the marks of a student with a
particular RegNo.
11.11.4 Attributes(cclunr
The columns of
relation are called attributes.
a

Name, Father, Mother are attributes of RegNo, RollNo, Year,


the STUDENT
Sub1, Sub2, Sub3, Total, Rank are the relation and RegNo,
values of each attribute are attributes of the MARK relation.
taken from the The
domain. range of possible values called

11.11.5 Cardinality
The number of nc.crcu)
rows or
relation. The relation tuples in a relation is called
STUDENT has cardinality of the
of the STUDENT seven
tuples and hence the
relation is 7.
Similarly, the cardinality
relation is 4. cardinality of the DISTRICcT
326
Computer Sujenco Std XI

11.11.6 Degree (
The number of attributes in a relation determines the degree of a
relation. The relation STUDENT has 8 columns and attributes and therefore
the degree of the STUDENT relation is 8. Similarly the degree of the
DISTRICT relation is 2.

Relation is a mathematical term for a table. A domain is a pool of


values from which actual values appearing in a given column
are drawn.
The rows of a relation are generally referred to as tuples.
The columns
of a relation are called attributes The number of rows or tuples in a
relation is called cardinakty of the relation The number of attributes in
a relation determines the degre of a relation

11.12 Views
It is not desirable that all the users see the entire data in the database.
Security considerations may require that certain data be hidden from the users.

1vie w is a virtualtable that does not really cxist but is nstead


derived from a set of one or more underlyng base tables
The relation from which the data is taken for the view is called bse table.
These are the tables that actually contain data. A view is a kind of table whose
contents are taken from other tables depending upon a query condition.
Consider a person who needs to know a students's RollNo, Name and
Bach in the table STUDENT. This person should see a relation containing only
these columns. It is possible to name a view. Let us name this view as NAMELIST.

RollNo Name Batch


Biju SCIENCE
2 Saju SCIENCE
RenjuCOMMERCE
2 Sajiv COMMERCE
Aravind COMMERCE
2 Binu COMMERCE

2 Anand SCIENCE

Fig. I1.14 NAMELIST view


327

You might also like