SlideShare a Scribd company logo
0
DatabaseManagementSystem
(For IIYear B.com.,IVSemester)
StudentName:
Class :
DepartmentofComputerScience&Applications
SRISAIKRISHNADEGREECOLLEGE,KURNOOL
(AffiliatedtoRayalaseemaUniversity,Kurnool,AP)
2
DATABASE MANAGEMENT SYSTEMS
UNIT-I
Overview of Database ManagementSystem:Introduction, Data and Information, Database, Database
Management System, Objectives of DBMS, Evolution of Database Management System,
Classification of Database Management System.
UNIT-II
File-Based System: File Based System. Drawbacks of File-Based System, DBMS Approach,
Advantage of DBMS, Data Models, Components of Database System, Database Architecture,
DBMS Vendors and their products.
UNIT-III
Entity-Relationship Model: Introduction, The Building Blocks of an Entity-Relationship,
Classification of Entity Set, Attribute Classification, Relationship Degree, Relationship
Classification, Generalization and Specialization, Aggregation and Composition,
CODD’s Rules, Relational Data Model, Concept of Relational Integrity.
UNIT-IV
Structured Query Language: Introduction, History of SQL Standards, Commands in SQL, Data
types in SQL, Data Definition Language (DDL),Selection Operation Projection Operation, Aggregate
Functions, Data Manipulation Language, Table Modification, Table Truncation, Imposition of
Constraints, Set Operations.
UNIT-V
PL/SQL: Introduction, Structure of PL/SQL,PL/SQL Language Elements, Data Types, Control
Structure, Steps to Create a PL/SQL Program, Iterative Control Cursors, Steps to Create a Cursor,
Procedure, Functions, Packages, Exceptions Handling, Database Triggers, Types of triggers.
3
Introduction:
UNIT-1
In science, business, education, economy, law, culture, all areas of human development
“work”with the data. Databasesplay acrucial role within science research: the body
ofscientificandtechnicaldata and information in the public domain is massive and factual data are
fundamental to theprogressof science.
Stock exchange data are absolutely necessary to any analyst. In everyday activity of a
teacher,aneducator,an academicor alawyerhas the data.
Therearedatabases collectingallsortsofdifferentdata:
 TheEvaluatedNuclearStructureData
 HumanGenomeDatabase.
 Prisoners‟DNAdata.
 TelephoneNumbers,
 LegalMaterialsandmanyothers.
DataandInformation:
Data are raw facts that constitute building block of information. Data are the heart of
theDBMS. It is to be noted that allthe data will not be a useful information. Useful information
isobtainedfrom processeddata.
Inotherwords,datahastobeinterpretedinordertoobtaininformation.Dataarearepresentation of
facts, concepts, or instructions in a formalized manner suitable for communication,interpretation,or
processingbyhumans orautomaticmeans.
Data are the most stable part of an organization‟s information system. Acompany needs tosave
information about employees, departments, and salaries. These pieces of information are
calleddata.Permanent storageofdataarereferred toaspersistent data.
Generally, we perform operations on data or data items to supply some information about
anentity.Forexample librarykeepsalistof members, books,due dates, and fines.
Database:
A database is a well-organized collection of data that are related in a meaningful way,
whichcanbeaccessed in different logical orders.
Database systems are systems in which the interpretation and storage of information are
ofprimaryimportance.
The database should contain all the data needed by the organization as a result, a huge
volumeof data, the need for long-term storage of the data, and access of the data by a large number of
usersgenerallycharacterizedatabase systems.
The simplified view of database system is shown in Fig. 1.1. From this figure, it is clear
thatseveraluserscanaccess thedata in an organization.
Here the integrity of the data should be maintained.A database is integrated when same
information is not recorded in two places.
4
5
6
DatabaseManagementSystem:
database management system(DBMS)consists of collection of inter related data and a set of
programs to access that data.It is software that is helpful in maintaining and utilizing a database.
A DBMS Consists of:
 A collection of inter related and persistent data.This part of DBMS is referred to as database(DB).
 A set of application programs used to access,update,and manage data.This part constitutes data
management system (MS).
 A DBMS is general-purpose softwarei.e.,not application specific.The same
DBMS(e.g.,Oracle,Sybase,etc.)can be used in railway reservation system,library management,
university,etc.
 A DBMS takes care of storing and accessing data, leaving only application specific tasks to
application programs.
DBMS is a complex system that allows a user to do many things to data as shown in Fig. 1.2.
From this figure, it is evident that DBMS allows user to input data, share the data, edit the data,
manipulate the data, and display the data in the database. Because a DBMS allows more than one user
to share the data; the complexity extends to its design and implementation.
ObjectivesofDBMS:
The main objectives of data base management system are data availability, data integrity, data
security,and data independence.
DataAvailability
Data availability refers to the fact that the data are made available to wide variety of users in a
meaningful format at reasonable cost so that the users can easily access the data.
DataIntegrity
Data integrity refers to the correctness of the data in the database. In other words, the data
available in the database is a reliable data.
DataSecurity
Data security refers to the fact that only authorized users can access the data. Data
securitycan be enforced by passwords. If two separate users are accessing a particular data at the
same time,the DBMS must not allow them to make conflicting changes.
DataIndependence
DBMS allows the user to store, update, and retrieve data in an efficient manner. DBMS
provides an “abstract view”of how the data is stored in the data base.In order to store the information
efficiently, complex data structures are used to represent the data. The system hides certain details
of how the data are stored and maintained.
MassStorage
DBMS can store a lot of data in it.So for all the big firms,DBMS is really ideal technology to
use.It can store thousands of records in it and one can fetch all that data when ever it is needed.
7
7
RemovesDuplicity
If you have lots of data then data duplicity will occur for sure at any instance. DBMS
guarantee it that there will be no data duplicity among all the records. While storing new
records,DBMS makes sure that same data was not inserted before.
MultipleUsersAccess
No one handles the whole database alone. There are lots of users who are able to access
database. So this situation may happen that two or more users are accessing database. They can
change what ever they want, at that time DBMS makes it sure that they can work concurrently.
EvolutionofDatabaseManagementSystems:
File-based system was the predecessor to the database management system. Apollo moon-
landing process was started in the year 1960. At that time, there was no system available to handle and
manage large amount of information. As a result, North American Aviation which is now popularly
known as Rockwell International developed software known as Generalized Update Access
Method(GUAM).In the mid-1960s, IBM joined North American Aviation to develop GUA Minto
Information Management System(IMS).IMS was based on Hierarchical data model.
In the mid-1960s, General Electric released Integrated Data Store (IDS). IDS were based on
network data model. Charles Bachmann was mainly responsible for the development of IDS. The
network database was developed to fulfill the need to represent more complex data relationships than
could be modeled with hierarchical structures.
The network and hierarchical data models have some draw backs (minimal data
independence,complex data access). To overcome these drawbacks, in 1970, Codd of IBM published a
paper titled“A Relational Model of Data for Large Shared Data Banks”. With this impact System R
project was developed during the late1970 by IBM SanJose Research Laboratory in California.
System R project was the development of Structured Query Language (SQL) which is the
standard language for relational database management system.
In 1980s IBM released two commercial relational database management systems known as
DB2andSQL/DS and Oracle Corporation released Oracle.
In recent years,two approaches to DBMS are more popular,theyare:
1. Object-Oriented DBMS(OODBMS)
2. ObjectRelational DBMS(ORDBMS).
The chronological order of the development of DBMS is as follows:
– Flat files–1960s–1980s
– Hierarchical –1970s–1990s
–Network–1970s–1990s
– Relational–1980s–present
– Object-oriented–1990s–present
– Object-relational–1990s–present
– Datawarehousing–1980s–present
– Web-enabled–1990s–present
Early 1960s. Charles Bachman at GE created the first general purpose DBMS Integrated Data Store.
Itcreated the basis for the network model which was standardized by CODASYL (Conference on
DataSystemLanguage).
Late 1960s. IBM developed theInformation Management System (IMS). IMS used
analternatemodel,called the Hierarchical Data Model.
1970. Edgar Codd, from IBM created the Relational Data Model. In 1981 Codd received the
TuringAwardforhis contributions todatabasetheory. Codd Passed awayin April2003.
1976.PeterChenpresentedEntity-Relationshipmodel, whichiswidelyusedindatabasedesign.
1980.SQLdevelopedbyIBM,becamethestandardquerylanguagefordatabases.SQLwasstandardizedbyISO
.
1980sand1990s.IBM,Oracle,InformixandothersdevelopedpowerfulDBMS.
8
9
10
The distributed database can be further classified as
 heterogeneous database and
 homogenous database
In homogenous data basewe use Same database management System software for multiple sites
data exchange between these various sides can be handle easily.those database systems which execute on
the same operating system and use the same application process and carry the same hardware devices.
In heterogeneous database different sites might use different dbms software.Those database
systems which execute on different operating systems under different application procedures, and carries
different hardware devices.
Based on purpose: Depending upon the purpose the database management system can be classified into
 General purpose
 Specific purpose
The general purpose data base contains wide variety of data used in multi discipline like newspapers
magazines etc the database falls under the category of online transaction processing (oltp).Theoltp
systemis specifically used fordata operators or data entry and retrieval it's supports large number of
transactions without excessive Delay. The OLTP technology is used in various sectors such as banking
Airlines supermarkets and manufacturing etc
7
12
UNIT-II
File-BasedSystem:
Prior to DBMS, file system provided by Operating System (OS) was used to store
information.In a file-based system, we have collection of application programs that perform services
for the endusers.Each programdefines and manages its owndata.
Consider University database, the University database contains details about student,
faculty,listsof courses offered,and duration ofcourse,etc.
In File-based processing for each database there is separate application programwhich
isshowninFig. 1.4.
One group of users may be interested in knowing the courses offered by the university.
Onegroup of users may be interested in knowing the faculty information. The information is stored
inseparatefiles and separate applicationsprogramsarewritten.
DrawbacksofFile-BasedSystem
Thelimitations offile-basedapproachare:
1. Duplicationofdata,
2. Datadependence,
3. Incompatiblefileformats,
4. Separationandisolationofdata.
5. Sharingofdatais poor
6. Lackofsecurity
DuplicationofData
Duplication of data means same data being stored more than once. This can also be termed
asdataredundancy.Dataredundancyisaprobleminfilebasedapproachduetothedecentralizedapproach.The
main drawbacks of duplication ofdata are:
– Duplication of data leads to wastage of storage space. If the storage space is wasted it
willhaveadirect impact on cost. The cost will increase.
– Duplication of data can lead to loss of data integrity; the data are no longer
consistent.Assume that the employee detail is stored both in the department and in the main office.
Now theemployeechangeshiscontactaddress.Thechangedaddressisstoredinthedepartmentaloneandnotin
the main office. If some important information has to be sent to his contact address from the
mainofficethen thatinformationwillbelost. Thisisduetothelack ofdecentralizedapproach.
Data Dependence
Data dependence means the application program depends on the data. If some modifications
have to be made in the data, then the application program has to be rewritten.If the applicationprogram
is independent of the storage structure of the data, then it is termed as data independence.Data
independence is generally preferred as it is more flexible. But in file-based system there isprogram-
data dependence.
13
Incompatible File Formats
As file-based system lacks program data independence, the structure of the file depends on the
application programming language. For example, the structure of the file generated by
FORTRANprogrammaybedifferentfromthestructureofafilegeneratedby“C”program.Theincompatibilit
yofsuch files makes themdifficult to process jointly.
SeparationandIsolationofData
In file-based approach,data are isolated in separate files. Hence it is difficult to access data.The
application programmer must synchronize the processing of two files to ensure that the correct data are
extracted.This difficulty is more if data has to be retrieved from more than twofiles.
Sharingof data ispoor:
Incase of File Management System data sharing is not possible because there is not mechanism
that provide us to connect two files to each other.
LackofSecurity:
In case of FMS there is no proper security to the data. That is whenever a file is accessed by a
program or a user he will have complement control or access to it where he can do any operation of
deleting or modifying the file that he is not supposed to do. We cannot restrict users from accessing
partial file or only selected columns in the file etc.
AdvantagesoftheDBMS:
The DBMS acts as an interface between the users and the actual database where the data is
stored. The DBMS receives the request from the user and then it is implemented internally hiding the
complexities involved in access the database and processing the user requests.
There are many other advantages of DBMS that are listed.
 Improved Data Sharing:TheDBMSprovidesaccesstothesamedatatomultipleusersatatime. That is
data can be shared between the applications at time which enables users to respondfor the requests
on same data at a time. DBMS has lots of mechanisms like locking, serializabilitywhichenables
theusers to maintaindata integrity though thedatais shared.
 Better Data Integration: In any organization the database will be in a centralized server and
itwill be accessed by thepeople of different departments at a time. That is the data is
integratedsuch that the complete view of data is available at any point of time to the users. That is
it will beeasy for the managers to understand how the data is being affected whenever it is
changed in theorganization.
 Minimized Data Inconsistency: Data inconsistency is a problem that arises due to the
occurrenceof same data in different tables and when data in one table is updated and data in other
table is not updated.This problem of inconsistency is minimized in DBMS as there is a concept of
relationships which reduces the repetition of unless it is compulsory.
 Improved Data Access: In case of DBMS is database access or data retrieval isvery easy because
of adhoc queries which are written in simple way. The SQL language supported byDBMS is a 4th
generation language where the user is supposed to specify only what he wants and the other part
will be (where the data isand how to get it) taken careby the DBMS, due to this it will be very
easy for the users to write the queries and retrieve what ever they want.
 Improved Decision Making: As the data in DBMS centralized the managers will have access
toall the data that is required that can be converted to information instantly so that it can be used
indecision making. That is they need not waste their time in finding the data they want to use
indecisionmaking.
 Increased End-User Productivity: As the data required is available to all the users very
easilyand quickly, improves the working quality and hence the user productivity increase which in
turnproduces lot of advantages to the organization. That is the users will be able to complete the
tasksveryeasilyand inlessamounttimeandhenceprofit to theorganization.
 Enforcement of Standards: DBMS is a system where there will be centralized control of the
database. It will be under the control of DBA (Database Administrator) who will be the whole and
sole in-charge of the database and implements all kinds of standards and rules.
14
15
Complex design :
Database design is complex, difficult and time consuming.
Damaged part : If one part of database is corrupted or damaged, then entire
database may get affected.
Compatibility: DBMS software may not be compatible with other software systems or platforms,
making it difficult to integrate with other applications.
DBMS Architecture
o The DBMS design depends upon its architecture. The basic client/server architecture is used to deal
with a large number of PCs, web servers, database servers and other components that are connected with
networks.
o The client/server architecture consists of many PCs and a workstation which are connected via the
network.
o DBMS architecture depends upon how users are connected to the database to get their request done.
Types of DBMS Architecture
Database architecture can be seen as a single tier or multi-tier. But logically, database architecture is of
three types like: 1-tier architecture ,2-tier architecture and 3-tier architecture.
1-Tier Architecture
o In this architecture, the database is directly available to the user. It means the user can directly sit on
the DBMS and uses it.
o Any changes done here will directly be done on the database itself. It doesn't provide a handy tool for
end users.
o The 1-Tier architecture is used for development of the local application, where programmers can
directly communicate with the database for the quick response.
2-Tier Architecture
o The 2-Tier architecture is same as basic client-server. In the two-tier architecture, applications on the
client end can directly communicate with the database at the server side. For this interaction, API's
like: ODBC, JDBC are used.
o The user interfaces and application programs are run on the client-side.
o The server side is responsible to provide the functionalities like: query processing and transaction
management.
o To communicate with the DBMS, client-side application establishes a connection with the server
side.
16
3-Tier Architecture
o The 3-Tier architecture contains another layer between the client and server. In this architecture, client
can't directly communicate with the server.
o The application on the client-end interacts with an application server which further communicates with
the database system.
o End user has no idea about the existence of the database beyond the application server. The database also
has no idea about any other user beyond the application.
o The 3-Tier architecture is used in case of large web application.
17
C
18
19
20
21
22
23
24
25
26
27
28
29
30
31
SituationsWhereDBMSMightNotBeNecessary:
Maincosts ofusingaDBMS:
- Highinitialinvestmentinhardware,software,training andpossibleneedforadditionalhardware.
- Overhead for providing generality, security, recovery, integrity, and concurrency
control.Generalitythat aDBMSprovides fordefining andprocessingdata.
WhenaDBMSmaybeunnecessary:
Ifthedatabaseandapplicationsaresimple,welldefined,andnotexpected tochange.
If there are stringent real-time requirements that may not be met because of DBMS
overhead.Ifaccess to data bymultiple users is not required.
DBMS VendorsandTheirProducts:
Therearemanydifferentvendorsthatcurrentlyproducerelationaldatabasemanagementsystems
(RDBMS).These products vary significantly in their capabilities and costs.Some
productsareproprietary (purchased) whileothersareopensource(meansfreeofcost).
TheleadingvendorsofRDBMS arelistedbelow:
****RDBMS Vendors**** ****RDBMSProduct****
ComputerAssociates INGRES
IBM DB2
Marketshare:
 OracleDatabase–70%
 MicrosoftSQLServer–68%
 MySQL(OracleCorporation)– 50%
 IBMDB2–39%
 IBM Informix–18%
 SAPSybaseAdaptiveServerEnterprise–15%
 SAPSybaseIQ–14%
 Teradata–11
INFORMIXSoftware INFORMIX
OracleCorporation Oracle
MicrosoftCorporation MSAccess
MicrosoftCorporation SQLServer
MySQLAB MySQL
NCRTeradata
PostgreSQLDvlpGrp PostgreSQL
Sybase Sybase11
database management system notes for b com students

More Related Content

Similar to database management system notes for b com students (20)

DOCX
Database
Nuqra Rabbani
 
PPTX
DATA BASE MANAGEMENT SYSTEM BY SAIKIRAN PANJALA
Saikiran Panjala
 
PPTX
Database Systems Lec 1.pptx
NishaTariq1
 
PPTX
Database Computer presentation file .pptx
Misqalezara
 
PPTX
Dbms Useful PPT
Krishna Bashyal
 
PPT
Lecture 1 =Unit 1 Part 1.ppt
DeeptimaanKrishnaJad
 
PDF
Data base management system
Suneel Dogra
 
PPTX
Basic of Database Management System(DBMS)
anjanasharma77573
 
PPT
data base manage ment
kaleemullah125
 
PPTX
Presentation AICT Improved version[1].pptx
mohammadhussain96201
 
PPTX
Dbms and sqlpptx
thesupermanreturns
 
PDF
1. Database Engineering Author Subasish Mohapatra.pdf
talentachiradza
 
PPTX
Database Basics Theory
sunmitraeducation
 
PDF
BCS403_dyeuhfgidgujoiduhyopyirhyiuertfuiPPT.pdf
NaveenGRaju
 
PPTX
MIS-3rd Unit.pptx
ssuser5e8d69
 
PPTX
MIS-3rd Unit.pptx
Sumit Kumar
 
PPT
DBMS ACCESS programming and learning .ppt
MANISH169648
 
PPTX
MADHU.pptx
SaiKanna14
 
PPTX
Unit 1_1680588168525885258552585525855.pptx
dgfs55437
 
Database
Nuqra Rabbani
 
DATA BASE MANAGEMENT SYSTEM BY SAIKIRAN PANJALA
Saikiran Panjala
 
Database Systems Lec 1.pptx
NishaTariq1
 
Database Computer presentation file .pptx
Misqalezara
 
Dbms Useful PPT
Krishna Bashyal
 
Lecture 1 =Unit 1 Part 1.ppt
DeeptimaanKrishnaJad
 
Data base management system
Suneel Dogra
 
Basic of Database Management System(DBMS)
anjanasharma77573
 
data base manage ment
kaleemullah125
 
Presentation AICT Improved version[1].pptx
mohammadhussain96201
 
Dbms and sqlpptx
thesupermanreturns
 
1. Database Engineering Author Subasish Mohapatra.pdf
talentachiradza
 
Database Basics Theory
sunmitraeducation
 
BCS403_dyeuhfgidgujoiduhyopyirhyiuertfuiPPT.pdf
NaveenGRaju
 
MIS-3rd Unit.pptx
ssuser5e8d69
 
MIS-3rd Unit.pptx
Sumit Kumar
 
DBMS ACCESS programming and learning .ppt
MANISH169648
 
MADHU.pptx
SaiKanna14
 
Unit 1_1680588168525885258552585525855.pptx
dgfs55437
 

Recently uploaded (20)

PDF
THE PSYCHOANALYTIC OF THE BLACK CAT BY EDGAR ALLAN POE (1).pdf
nabilahk908
 
PPTX
JSON, XML and Data Science introduction.pptx
Ramakrishna Reddy Bijjam
 
PPT
M&A5 Q1 1 differentiate evolving early Philippine conventional and contempora...
ErlizaRosete
 
DOCX
MUSIC AND ARTS 5 DLL MATATAG LESSON EXEMPLAR QUARTER 1_Q1_W1.docx
DianaValiente5
 
PDF
Wikinomics How Mass Collaboration Changes Everything Don Tapscott
wcsqyzf5909
 
PPTX
How to Configure Refusal of Applicants in Odoo 18 Recruitment
Celine George
 
PDF
Nanotechnology and Functional Foods Effective Delivery of Bioactive Ingredien...
rmswlwcxai8321
 
PDF
CAD25 Gbadago and Fafa Presentation Revised-Aston Business School, UK.pdf
Kweku Zurek
 
PPTX
Martyrs of Ireland - who kept the faith of St. Patrick.pptx
Martin M Flynn
 
PPTX
Elo the HeroTHIS IS A STORY ABOUT A BOY WHO SAVED A LITTLE GOAT .pptx
JoyIPanos
 
PDF
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
KaryanaTantri21
 
PPTX
Comparing Translational and Rotational Motion.pptx
AngeliqueTolentinoDe
 
PPTX
A Case of Identity A Sociological Approach Fix.pptx
Ismail868386
 
PDF
Rapid Mathematics Assessment Score sheet for all Grade levels
DessaCletSantos
 
PDF
Public Health For The 21st Century 1st Edition Judy Orme Jane Powell
trjnesjnqg7801
 
PDF
Free eBook ~100 Common English Proverbs (ebook) pdf.pdf
OH TEIK BIN
 
PPTX
How to Create & Manage Stages in Odoo 18 Helpdesk
Celine George
 
PPTX
2025 Completing the Pre-SET Plan Form.pptx
mansk2
 
PDF
Lesson 1 : Science and the Art of Geography Ecosystem
marvinnbustamante1
 
PDF
Gladiolous Cultivation practices by AKL.pdf
kushallamichhame
 
THE PSYCHOANALYTIC OF THE BLACK CAT BY EDGAR ALLAN POE (1).pdf
nabilahk908
 
JSON, XML and Data Science introduction.pptx
Ramakrishna Reddy Bijjam
 
M&A5 Q1 1 differentiate evolving early Philippine conventional and contempora...
ErlizaRosete
 
MUSIC AND ARTS 5 DLL MATATAG LESSON EXEMPLAR QUARTER 1_Q1_W1.docx
DianaValiente5
 
Wikinomics How Mass Collaboration Changes Everything Don Tapscott
wcsqyzf5909
 
How to Configure Refusal of Applicants in Odoo 18 Recruitment
Celine George
 
Nanotechnology and Functional Foods Effective Delivery of Bioactive Ingredien...
rmswlwcxai8321
 
CAD25 Gbadago and Fafa Presentation Revised-Aston Business School, UK.pdf
Kweku Zurek
 
Martyrs of Ireland - who kept the faith of St. Patrick.pptx
Martin M Flynn
 
Elo the HeroTHIS IS A STORY ABOUT A BOY WHO SAVED A LITTLE GOAT .pptx
JoyIPanos
 
Romanticism in Love and Sacrifice An Analysis of Oscar Wilde’s The Nightingal...
KaryanaTantri21
 
Comparing Translational and Rotational Motion.pptx
AngeliqueTolentinoDe
 
A Case of Identity A Sociological Approach Fix.pptx
Ismail868386
 
Rapid Mathematics Assessment Score sheet for all Grade levels
DessaCletSantos
 
Public Health For The 21st Century 1st Edition Judy Orme Jane Powell
trjnesjnqg7801
 
Free eBook ~100 Common English Proverbs (ebook) pdf.pdf
OH TEIK BIN
 
How to Create & Manage Stages in Odoo 18 Helpdesk
Celine George
 
2025 Completing the Pre-SET Plan Form.pptx
mansk2
 
Lesson 1 : Science and the Art of Geography Ecosystem
marvinnbustamante1
 
Gladiolous Cultivation practices by AKL.pdf
kushallamichhame
 
Ad

database management system notes for b com students

  • 1. 0 DatabaseManagementSystem (For IIYear B.com.,IVSemester) StudentName: Class : DepartmentofComputerScience&Applications SRISAIKRISHNADEGREECOLLEGE,KURNOOL (AffiliatedtoRayalaseemaUniversity,Kurnool,AP)
  • 2. 2 DATABASE MANAGEMENT SYSTEMS UNIT-I Overview of Database ManagementSystem:Introduction, Data and Information, Database, Database Management System, Objectives of DBMS, Evolution of Database Management System, Classification of Database Management System. UNIT-II File-Based System: File Based System. Drawbacks of File-Based System, DBMS Approach, Advantage of DBMS, Data Models, Components of Database System, Database Architecture, DBMS Vendors and their products. UNIT-III Entity-Relationship Model: Introduction, The Building Blocks of an Entity-Relationship, Classification of Entity Set, Attribute Classification, Relationship Degree, Relationship Classification, Generalization and Specialization, Aggregation and Composition, CODD’s Rules, Relational Data Model, Concept of Relational Integrity. UNIT-IV Structured Query Language: Introduction, History of SQL Standards, Commands in SQL, Data types in SQL, Data Definition Language (DDL),Selection Operation Projection Operation, Aggregate Functions, Data Manipulation Language, Table Modification, Table Truncation, Imposition of Constraints, Set Operations. UNIT-V PL/SQL: Introduction, Structure of PL/SQL,PL/SQL Language Elements, Data Types, Control Structure, Steps to Create a PL/SQL Program, Iterative Control Cursors, Steps to Create a Cursor, Procedure, Functions, Packages, Exceptions Handling, Database Triggers, Types of triggers.
  • 3. 3 Introduction: UNIT-1 In science, business, education, economy, law, culture, all areas of human development “work”with the data. Databasesplay acrucial role within science research: the body ofscientificandtechnicaldata and information in the public domain is massive and factual data are fundamental to theprogressof science. Stock exchange data are absolutely necessary to any analyst. In everyday activity of a teacher,aneducator,an academicor alawyerhas the data. Therearedatabases collectingallsortsofdifferentdata:  TheEvaluatedNuclearStructureData  HumanGenomeDatabase.  Prisoners‟DNAdata.  TelephoneNumbers,  LegalMaterialsandmanyothers. DataandInformation: Data are raw facts that constitute building block of information. Data are the heart of theDBMS. It is to be noted that allthe data will not be a useful information. Useful information isobtainedfrom processeddata. Inotherwords,datahastobeinterpretedinordertoobtaininformation.Dataarearepresentation of facts, concepts, or instructions in a formalized manner suitable for communication,interpretation,or processingbyhumans orautomaticmeans. Data are the most stable part of an organization‟s information system. Acompany needs tosave information about employees, departments, and salaries. These pieces of information are calleddata.Permanent storageofdataarereferred toaspersistent data. Generally, we perform operations on data or data items to supply some information about anentity.Forexample librarykeepsalistof members, books,due dates, and fines. Database: A database is a well-organized collection of data that are related in a meaningful way, whichcanbeaccessed in different logical orders. Database systems are systems in which the interpretation and storage of information are ofprimaryimportance. The database should contain all the data needed by the organization as a result, a huge volumeof data, the need for long-term storage of the data, and access of the data by a large number of usersgenerallycharacterizedatabase systems. The simplified view of database system is shown in Fig. 1.1. From this figure, it is clear thatseveraluserscanaccess thedata in an organization. Here the integrity of the data should be maintained.A database is integrated when same information is not recorded in two places.
  • 4. 4
  • 5. 5
  • 6. 6 DatabaseManagementSystem: database management system(DBMS)consists of collection of inter related data and a set of programs to access that data.It is software that is helpful in maintaining and utilizing a database. A DBMS Consists of:  A collection of inter related and persistent data.This part of DBMS is referred to as database(DB).  A set of application programs used to access,update,and manage data.This part constitutes data management system (MS).  A DBMS is general-purpose softwarei.e.,not application specific.The same DBMS(e.g.,Oracle,Sybase,etc.)can be used in railway reservation system,library management, university,etc.  A DBMS takes care of storing and accessing data, leaving only application specific tasks to application programs. DBMS is a complex system that allows a user to do many things to data as shown in Fig. 1.2. From this figure, it is evident that DBMS allows user to input data, share the data, edit the data, manipulate the data, and display the data in the database. Because a DBMS allows more than one user to share the data; the complexity extends to its design and implementation. ObjectivesofDBMS: The main objectives of data base management system are data availability, data integrity, data security,and data independence. DataAvailability Data availability refers to the fact that the data are made available to wide variety of users in a meaningful format at reasonable cost so that the users can easily access the data. DataIntegrity Data integrity refers to the correctness of the data in the database. In other words, the data available in the database is a reliable data. DataSecurity Data security refers to the fact that only authorized users can access the data. Data securitycan be enforced by passwords. If two separate users are accessing a particular data at the same time,the DBMS must not allow them to make conflicting changes. DataIndependence DBMS allows the user to store, update, and retrieve data in an efficient manner. DBMS provides an “abstract view”of how the data is stored in the data base.In order to store the information efficiently, complex data structures are used to represent the data. The system hides certain details of how the data are stored and maintained. MassStorage DBMS can store a lot of data in it.So for all the big firms,DBMS is really ideal technology to use.It can store thousands of records in it and one can fetch all that data when ever it is needed.
  • 7. 7 7 RemovesDuplicity If you have lots of data then data duplicity will occur for sure at any instance. DBMS guarantee it that there will be no data duplicity among all the records. While storing new records,DBMS makes sure that same data was not inserted before. MultipleUsersAccess No one handles the whole database alone. There are lots of users who are able to access database. So this situation may happen that two or more users are accessing database. They can change what ever they want, at that time DBMS makes it sure that they can work concurrently. EvolutionofDatabaseManagementSystems: File-based system was the predecessor to the database management system. Apollo moon- landing process was started in the year 1960. At that time, there was no system available to handle and manage large amount of information. As a result, North American Aviation which is now popularly known as Rockwell International developed software known as Generalized Update Access Method(GUAM).In the mid-1960s, IBM joined North American Aviation to develop GUA Minto Information Management System(IMS).IMS was based on Hierarchical data model. In the mid-1960s, General Electric released Integrated Data Store (IDS). IDS were based on network data model. Charles Bachmann was mainly responsible for the development of IDS. The network database was developed to fulfill the need to represent more complex data relationships than could be modeled with hierarchical structures. The network and hierarchical data models have some draw backs (minimal data independence,complex data access). To overcome these drawbacks, in 1970, Codd of IBM published a paper titled“A Relational Model of Data for Large Shared Data Banks”. With this impact System R project was developed during the late1970 by IBM SanJose Research Laboratory in California. System R project was the development of Structured Query Language (SQL) which is the standard language for relational database management system. In 1980s IBM released two commercial relational database management systems known as DB2andSQL/DS and Oracle Corporation released Oracle. In recent years,two approaches to DBMS are more popular,theyare: 1. Object-Oriented DBMS(OODBMS) 2. ObjectRelational DBMS(ORDBMS). The chronological order of the development of DBMS is as follows: – Flat files–1960s–1980s – Hierarchical –1970s–1990s –Network–1970s–1990s – Relational–1980s–present – Object-oriented–1990s–present – Object-relational–1990s–present – Datawarehousing–1980s–present – Web-enabled–1990s–present Early 1960s. Charles Bachman at GE created the first general purpose DBMS Integrated Data Store. Itcreated the basis for the network model which was standardized by CODASYL (Conference on DataSystemLanguage). Late 1960s. IBM developed theInformation Management System (IMS). IMS used analternatemodel,called the Hierarchical Data Model. 1970. Edgar Codd, from IBM created the Relational Data Model. In 1981 Codd received the TuringAwardforhis contributions todatabasetheory. Codd Passed awayin April2003. 1976.PeterChenpresentedEntity-Relationshipmodel, whichiswidelyusedindatabasedesign. 1980.SQLdevelopedbyIBM,becamethestandardquerylanguagefordatabases.SQLwasstandardizedbyISO . 1980sand1990s.IBM,Oracle,InformixandothersdevelopedpowerfulDBMS.
  • 8. 8
  • 9. 9
  • 10. 10 The distributed database can be further classified as  heterogeneous database and  homogenous database In homogenous data basewe use Same database management System software for multiple sites data exchange between these various sides can be handle easily.those database systems which execute on the same operating system and use the same application process and carry the same hardware devices. In heterogeneous database different sites might use different dbms software.Those database systems which execute on different operating systems under different application procedures, and carries different hardware devices. Based on purpose: Depending upon the purpose the database management system can be classified into  General purpose  Specific purpose The general purpose data base contains wide variety of data used in multi discipline like newspapers magazines etc the database falls under the category of online transaction processing (oltp).Theoltp systemis specifically used fordata operators or data entry and retrieval it's supports large number of transactions without excessive Delay. The OLTP technology is used in various sectors such as banking Airlines supermarkets and manufacturing etc 7
  • 11. 12 UNIT-II File-BasedSystem: Prior to DBMS, file system provided by Operating System (OS) was used to store information.In a file-based system, we have collection of application programs that perform services for the endusers.Each programdefines and manages its owndata. Consider University database, the University database contains details about student, faculty,listsof courses offered,and duration ofcourse,etc. In File-based processing for each database there is separate application programwhich isshowninFig. 1.4. One group of users may be interested in knowing the courses offered by the university. Onegroup of users may be interested in knowing the faculty information. The information is stored inseparatefiles and separate applicationsprogramsarewritten. DrawbacksofFile-BasedSystem Thelimitations offile-basedapproachare: 1. Duplicationofdata, 2. Datadependence, 3. Incompatiblefileformats, 4. Separationandisolationofdata. 5. Sharingofdatais poor 6. Lackofsecurity DuplicationofData Duplication of data means same data being stored more than once. This can also be termed asdataredundancy.Dataredundancyisaprobleminfilebasedapproachduetothedecentralizedapproach.The main drawbacks of duplication ofdata are: – Duplication of data leads to wastage of storage space. If the storage space is wasted it willhaveadirect impact on cost. The cost will increase. – Duplication of data can lead to loss of data integrity; the data are no longer consistent.Assume that the employee detail is stored both in the department and in the main office. Now theemployeechangeshiscontactaddress.Thechangedaddressisstoredinthedepartmentaloneandnotin the main office. If some important information has to be sent to his contact address from the mainofficethen thatinformationwillbelost. Thisisduetothelack ofdecentralizedapproach. Data Dependence Data dependence means the application program depends on the data. If some modifications have to be made in the data, then the application program has to be rewritten.If the applicationprogram is independent of the storage structure of the data, then it is termed as data independence.Data independence is generally preferred as it is more flexible. But in file-based system there isprogram- data dependence.
  • 12. 13 Incompatible File Formats As file-based system lacks program data independence, the structure of the file depends on the application programming language. For example, the structure of the file generated by FORTRANprogrammaybedifferentfromthestructureofafilegeneratedby“C”program.Theincompatibilit yofsuch files makes themdifficult to process jointly. SeparationandIsolationofData In file-based approach,data are isolated in separate files. Hence it is difficult to access data.The application programmer must synchronize the processing of two files to ensure that the correct data are extracted.This difficulty is more if data has to be retrieved from more than twofiles. Sharingof data ispoor: Incase of File Management System data sharing is not possible because there is not mechanism that provide us to connect two files to each other. LackofSecurity: In case of FMS there is no proper security to the data. That is whenever a file is accessed by a program or a user he will have complement control or access to it where he can do any operation of deleting or modifying the file that he is not supposed to do. We cannot restrict users from accessing partial file or only selected columns in the file etc. AdvantagesoftheDBMS: The DBMS acts as an interface between the users and the actual database where the data is stored. The DBMS receives the request from the user and then it is implemented internally hiding the complexities involved in access the database and processing the user requests. There are many other advantages of DBMS that are listed.  Improved Data Sharing:TheDBMSprovidesaccesstothesamedatatomultipleusersatatime. That is data can be shared between the applications at time which enables users to respondfor the requests on same data at a time. DBMS has lots of mechanisms like locking, serializabilitywhichenables theusers to maintaindata integrity though thedatais shared.  Better Data Integration: In any organization the database will be in a centralized server and itwill be accessed by thepeople of different departments at a time. That is the data is integratedsuch that the complete view of data is available at any point of time to the users. That is it will beeasy for the managers to understand how the data is being affected whenever it is changed in theorganization.  Minimized Data Inconsistency: Data inconsistency is a problem that arises due to the occurrenceof same data in different tables and when data in one table is updated and data in other table is not updated.This problem of inconsistency is minimized in DBMS as there is a concept of relationships which reduces the repetition of unless it is compulsory.  Improved Data Access: In case of DBMS is database access or data retrieval isvery easy because of adhoc queries which are written in simple way. The SQL language supported byDBMS is a 4th generation language where the user is supposed to specify only what he wants and the other part will be (where the data isand how to get it) taken careby the DBMS, due to this it will be very easy for the users to write the queries and retrieve what ever they want.  Improved Decision Making: As the data in DBMS centralized the managers will have access toall the data that is required that can be converted to information instantly so that it can be used indecision making. That is they need not waste their time in finding the data they want to use indecisionmaking.  Increased End-User Productivity: As the data required is available to all the users very easilyand quickly, improves the working quality and hence the user productivity increase which in turnproduces lot of advantages to the organization. That is the users will be able to complete the tasksveryeasilyand inlessamounttimeandhenceprofit to theorganization.  Enforcement of Standards: DBMS is a system where there will be centralized control of the database. It will be under the control of DBA (Database Administrator) who will be the whole and sole in-charge of the database and implements all kinds of standards and rules.
  • 13. 14
  • 14. 15 Complex design : Database design is complex, difficult and time consuming. Damaged part : If one part of database is corrupted or damaged, then entire database may get affected. Compatibility: DBMS software may not be compatible with other software systems or platforms, making it difficult to integrate with other applications. DBMS Architecture o The DBMS design depends upon its architecture. The basic client/server architecture is used to deal with a large number of PCs, web servers, database servers and other components that are connected with networks. o The client/server architecture consists of many PCs and a workstation which are connected via the network. o DBMS architecture depends upon how users are connected to the database to get their request done. Types of DBMS Architecture Database architecture can be seen as a single tier or multi-tier. But logically, database architecture is of three types like: 1-tier architecture ,2-tier architecture and 3-tier architecture. 1-Tier Architecture o In this architecture, the database is directly available to the user. It means the user can directly sit on the DBMS and uses it. o Any changes done here will directly be done on the database itself. It doesn't provide a handy tool for end users. o The 1-Tier architecture is used for development of the local application, where programmers can directly communicate with the database for the quick response. 2-Tier Architecture o The 2-Tier architecture is same as basic client-server. In the two-tier architecture, applications on the client end can directly communicate with the database at the server side. For this interaction, API's like: ODBC, JDBC are used. o The user interfaces and application programs are run on the client-side. o The server side is responsible to provide the functionalities like: query processing and transaction management. o To communicate with the DBMS, client-side application establishes a connection with the server side.
  • 15. 16 3-Tier Architecture o The 3-Tier architecture contains another layer between the client and server. In this architecture, client can't directly communicate with the server. o The application on the client-end interacts with an application server which further communicates with the database system. o End user has no idea about the existence of the database beyond the application server. The database also has no idea about any other user beyond the application. o The 3-Tier architecture is used in case of large web application.
  • 16. 17 C
  • 17. 18
  • 18. 19
  • 19. 20
  • 20. 21
  • 21. 22
  • 22. 23
  • 23. 24
  • 24. 25
  • 25. 26
  • 26. 27
  • 27. 28
  • 28. 29
  • 29. 30
  • 30. 31 SituationsWhereDBMSMightNotBeNecessary: Maincosts ofusingaDBMS: - Highinitialinvestmentinhardware,software,training andpossibleneedforadditionalhardware. - Overhead for providing generality, security, recovery, integrity, and concurrency control.Generalitythat aDBMSprovides fordefining andprocessingdata. WhenaDBMSmaybeunnecessary: Ifthedatabaseandapplicationsaresimple,welldefined,andnotexpected tochange. If there are stringent real-time requirements that may not be met because of DBMS overhead.Ifaccess to data bymultiple users is not required. DBMS VendorsandTheirProducts: Therearemanydifferentvendorsthatcurrentlyproducerelationaldatabasemanagementsystems (RDBMS).These products vary significantly in their capabilities and costs.Some productsareproprietary (purchased) whileothersareopensource(meansfreeofcost). TheleadingvendorsofRDBMS arelistedbelow: ****RDBMS Vendors**** ****RDBMSProduct**** ComputerAssociates INGRES IBM DB2 Marketshare:  OracleDatabase–70%  MicrosoftSQLServer–68%  MySQL(OracleCorporation)– 50%  IBMDB2–39%  IBM Informix–18%  SAPSybaseAdaptiveServerEnterprise–15%  SAPSybaseIQ–14%  Teradata–11 INFORMIXSoftware INFORMIX OracleCorporation Oracle MicrosoftCorporation MSAccess MicrosoftCorporation SQLServer MySQLAB MySQL NCRTeradata PostgreSQLDvlpGrp PostgreSQL Sybase Sybase11