Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 38

DBMS

Database Management System

Sem-IV
Highest
Cogniti
CO ID. Course Outcome ve
Level

The learner will be able to differentiate between file systems and


CSC403.1
databases and know the role of the Database administrator L3

The Learner will be able to Design ER and EER diagrams for real-
L3
CSC403.2
life applications.

The learner will be able to derive a relational model and formulate


L3
CSC403.3
relational algebra queries

The learner will be able to Analyze the query statement and


L3
CSC403.4
formulate SQL queries

The learner will be able to Apply the concept of normalization to


L3
CSC403.5
relational database design

The learner will be able to use the concept of transaction


L3
CSC403.6
management for concurrency

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe


Highest
CO ID. Course Outcome Cognitive
Level

Design ER /EER diagram and convert to relational


model for the real world application. 3
CSC402.1

Apply various SQL sublanguage commands and


formulate simple/complex queries to demonstrate
CSL402.2 database operations 3

Implement stored procedure/function for specific task


CSL402.3 3

Demonstrate database connectivity


CSL402.4 3

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 3


MODULE NAME

1. Introduction of DBMS
2. Entity-Relationship(ER) Data Model
3. Relational Model and Relational Algebra
4. Structured Query Language(SQL)
5. Relational Database Design
6. Transaction Management and Concurrency
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 4
CHAPTER 1

Introduction to Databases Management


System

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 5


OUTLINE
 Basic Definitions
 Main Characteristics of the Database Approach
 File Processing System vs DBMS
 Data Abstraction and Data Independence
 DBMS System Architecture
 DBMS Administration
 Types of Database Users

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 6


What is Data, Database, DBMS
 Data: Known facts that can be recorded and have an implicit meaning;
raw
 Database: a highly organized, interrelated, and structured set of data
about a particular enterprise
 Controlled by a database management system (DBMS)
 DBMS
 Set of programs to access the data

 An environment that is both convenient and efficient to use

 Database systems are used to manage collections of data that are:


 Highly valuable

 Relatively large

 Accessed by multiple users and applications, often at the same

time.
 A modern database system is a complex software system whose task
is to manage a large, complex collection of data.
 Databases touch all aspects of our lives
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 7
 The database management system consists of two parts. They
are:
1. Database and
2. Management System
 Data: Collection of RAW Data. (e.g. 1,ABC,20 etc.)

 Database: Collection related data is termed as Database which is

used to organized in such a way that it can be easily retrieved


and managed. Collection of related data items, e.g. in the above
example the three data items had no meaning. But if we organize
them in the following way, then they collectively represent
meaningful information.

 Database Management System(DBMS): Used to perform


various tasks like Creation, Insertion, Modification and Deletion.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 8
Characteristics of Data Base
a. Self-Description:
It contains a description of its own structure. his
description is called metadata - data about the data. The database
is integrated in that it includes the relationships among data items,
as well as including the data items themselves.
b. Insulation between Programs and Data, Data Abstraction:
The structure of data files is stored in the DBMS catalog
separately from the access programs. This property is called as
program-data independence.
c. Multiple views of Data:
Multiple views of Data A view may be a subset of the
database.
d. Data sharing and multi-user Transaction Processing:
A database supports multiple views of data. A view is a
subset of the database, which is defined and dedicated for
particular users of the system. Multiple users in the system might
have different views of the system.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 9
File Processing System
 A file processing system is a collection of programs
that store and manage files in computer hard-disk.
 File processing system has more data redundancy,
 File processing system provides less flexibility in
accessing data,

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 10


Drawbacks of File Processing System
 Data Redundancy
 Data Inconsistency
 Limited Data Sharing
 Difficulty in Accessing Data
 Data Dependence
 Poor Data Control
 Problem of Security
 Concurrency Problems
 Data Isolation
 Atomicity Problems
 Integrity Problems
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 11
 Data redundancy: In File Processing Systems, the same
data is often stored in multiple files, which can lead to data
redundancy. Data redundancy means that the same data is
stored in more than one place, leading to the wastage of
storage space and making data maintenance more difficult.
 Data inconsistency: Due to data redundancy,
inconsistencies can occur in the data. If changes are made to
one file, these changes must be manually made to all other
files containing the same data. If this is not done properly,
data inconsistencies can arise.
 Limited data sharing: File Processing Systems are not
designed to share data between applications or users. Each
application has its own set of files, and sharing data between
applications is difficult and often requires custom coding.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 12
 Security: File Processing Systems do not have built-in
security features to protect data from unauthorized access.
Access to files is typically controlled through file
permissions, which can be difficult to manage and can lead
to security breaches.
 Difficulty in accessing data: In a file processing system, to
access data differently we need to have different programs.
For example, if you want to access student names from a
file, we need a program that does the job. If you want to
view only address of all students from a specific city, then
we need different program that does the required job. This
list goes endless. Hence, it is difficult to access data.
 Data isolation: Files are stored in different locations,
different formats. Thus they are isolated . For example, one
location the student data may be stored in .txt format. In
other location, the same file may be stored in .doc form
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 13
 Integrity problems: Integrity problem arises when the
database fails to satisfy certain integrity conditions . For
example, the phone number cannot be longer than 10 digits,
bank balance should not go below 1000 etc. The actual
problem arises when we would like to include new such
conditions with the existing database. It is hard to make those
changes.
 Atomicity problems: The database must be in a consistent
state in spite of failures. For example, let us suppose that you
have a savings account with the balance 5000 and a loan
account with an outstanding of 3000. This is the old
consistent state. Now you would like to transfer 500 to your
loan account. If this transaction is successful, then your
savings balance should be 4500 and loan outstanding should
be 2500. This is the new consistent state. Suppose a failure
occurs during this transaction, the database must be in any
one of the 2 consistent states mentioned above.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 14
Advantages of DBMS over File Processing
System
 Reduced Data Redundancy
 Improved Data Consistency
 Improved Data Access and Availability
 Improved Data Sharing
 Data security
 Data Integrity and Security

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 15


 Reduced Data Redundancy: DBMS eliminates
data redundancy by storing data in a structured way.
It allows sharing data across different applications
and users, reducing the need for duplicating data.
 Improved Data Consistency: DBMS ensures data
consistency by enforcing data validation rules and
constraints. This ensures that data is accurate and
consistent across different applications and users.
 Data Integrity and Security: DBMS provides a
centralized approach to data management that
ensures data integrity and security. DBMS allows
defining constraints and rules to ensure that data is
consistent and accurate.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 16
 Improved Data Access and Availability: DBMS
provides efficient data access and retrieval
mechanisms that enable quick and easy data access.
It allows multiple users to access the data
simultaneously, ensuring data availability.
 Improved Data Sharing: DBMS provides a platform
for sharing data across different applications and
users. It allows sharing data between different
departments and systems within an organization,
improving collaboration and decision-making.
 Data security: To prevent illegal access, alteration, or
theft, database management systems (DBMS)
include a number of security features, including
encryption, authentication, and authorization. Slide 1- 17
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe
Disadvantages of DBMS over File
Processing System
 Increased Cost
 Complexity
 Complex design
 Performance
 Frequency Upgrade/Replacement Cycles

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 18


 Increased Cost: To install DB system, we required
standard software and hardware . Also to handle the
Database System , highly skilled personnel are required .
 Complexity: As we all know that nowadays all companies
are using the database management system as it fulfills
lots of requirements and also solves the problem. But a
problem arises, that is all this functionality has made the
database management system an extremely complex
software. For the proper requirement of DBMS, it is very
important to have a good knowledge of it by the
developers, DBA, designers, and also the end-users.
 Complex design : Database design is complex, difficult
and time consuming.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 19


Example of a Database
(with a Conceptual Data Model)
 Mini-world for the example:
 Part of a UNIVERSITY environment
 Some mini-world entities:
 STUDENTs
 COURSEs
 SECTIONs (of COURSEs)
 (Academic) DEPARTMENTs
 INSTRUCTORs

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 20


Example of a Database
(with a Conceptual Data Model)
 Some mini-world relationships:
 SECTIONs are of specific COURSEs

 STUDENTs take SECTIONs

 COURSEs have prerequisite COURSEs

 INSTRUCTORs teach SECTIONs

 COURSEs are offered by DEPARTMENTs

 STUDENTs major in DEPARTMENTs

 Note: The above entities and relationships are typically


expressed in a conceptual data model, such as the entity-
relationship (ER) data or UML class model (see Chapters 3, 4)

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 21


Example of a Simple Database

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 22


The relational model

E.F. “Ted” Codd

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 23


Example of a Simplified Database Catalog

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 24


File Processing System Database Management System

1. The file system is a way of arranging the 1. DBMS is software for managing the
files in a storage medium within a database.
computer.
2. Redundant data can be present in a file
2. In DBMS there is no redundant data.
system.
3.Data Inconsistent occurs when the data 3.The Data Consistency is obtained by
is not updated in all the files controlling the data redundancy.
simultaneously.
4. Data is distributed in many files. So, it is 4. Due to centralized nature data sharing is
not easy to share data. easy

5. It is less complex as compared to 5. It has more complexity in handling as


DBMS. compared to the file system.

6. File systems provide less security in 6. DBMS has more security mechanisms
comparison to DBMS. as compared to file systems.

7. There is less data consistency in the 7. There is more data consistency because
file system. of the process of normalization
8. It is less expensive than DBMS. 8. It has a comparatively higher cost than a
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe file system.
Data Abstraction
 Abstraction is an important feature of DBMS. Extracting
the important data by ignoring the renaming irrelevant
details know as Abstraction.
 As we know, the DBS usually has complex data structure
as per their requirements so to make user interaction easy
with DB, internal irrelevant details can be hidden from
users.
 Complexity of DB can be hiding from user by different
level of abstraction as follows:
 Level of Abstraction
1. Physical Level
2. Logical Level
3. View Level
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 26
1. Physical Level
It is the lowest level in abstraction.

It describes how the data is actually stored.

This level is kept hidden by compiler from

programmer.
It can be Hard disk, Magnetic Tape etc.

2. Logical level
It is the middle level in abstraction.

Used to describe what data the database stores and

what relationships exits in between the data items.


Programmer works at this level.

Data administrator use this level of abstraction to

decide what information to be keep in a database.Slide 1- 27


Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe
3. View Level
It is the highest level in abstraction.
Describes only specific part of database.

At this level we have application programs which are


accessed by user according to data required.
There are many different views of same data.

Example: In case of storing customer data,


Physical level – it will contains block of storages (bytes ,
GB, TB , etc)
Logical level – it will contain the fields and the
attributes of data.
View level – it works with GUI access of database

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 28


Data Independence
 Data Independence is mainly defined as a property of
DBMS that helps you to change the database schema
at one level of a system without requiring to change
the schema at the next level. it helps to keep the data
separated from all program that makes use of it.
 We have namely two levels of data independence

arising from these levels of abstraction:


1.Physical level data independence
2.Logical level data independence

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 29


1. Physical Level Data Independence
It refers to the characteristic of being able to modify the

physical schema without any alterations to the conceptual or


logical schema, done for optimization purposes.
It means we change the physical storage/level without

affecting the conceptual or external view of the data.


The alterations or modifications to the physical structure

may include Utilization of new storage devices.


2. Logical Level Data Independence
 It refers characteristic of being able to modify the logical

schema without affecting the external schema or application


program. The user view of the data would not be affected by
any changes to the conceptual view of the data.
 These changes may include insertion or deletion of

attributes, altering table structures entities or relationships to


the logical schema, etc.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 30
Database Users
 Database users are categorized based up on their interaction with
the database
1. Naive / Parametric End Users : Parametric End Users are the
unsophisticated who don’t have any DBMS knowledge but they
frequently use the database applications in their daily life to get
the desired results
. For examples, Railway’s ticket booking users are naive users.
2. Database Administrator (DBA) : Database Administrator
(DBA) is a person/team who defines the schema and also
controls the 3 levels of database.
• DBA is also responsible for providing security to the database
and he allows only the authorized users to access/modify the
data base.
• DBA is responsible for the problems such as security breaches

and poor system response time.


Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 31
2. Application Programmers : Application Programmers
also referred as System Analysts or simply Software
Engineers, are the back-end programmers who writes the
code for the application programs.
•They are the computer professionals.

•Application programmers design, debug, test, and

maintain set of programs called “canned transactions” for


the new users in order to interact with database.
3. Sophisticated Users : Sophisticated users can be
engineers, scientists, business analyst, who are familiar
with the database.
•They can develop their own database applications

according to their requirement.


Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 32
DBMS ARCHITECTURE
 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.
 The client/server architecture consists of many PCs and a

workstation which are connected via the network.


 DBMS architecture depends upon how users are

connected to the database to get their request


done.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 33


1-Tier Architecture
In this architecture, the database is directly available to

the user. It means the user can directly sit on the DBMS
and uses it.
Any changes done here will directly be done on the

database itself. It doesn't provide a handy tool for end


users.
The 1-Tier architecture is used for development of the

local application, where programmers can directly


communicate with the database for the quick response.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 34


2-Tier Architecture
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.
The user interfaces and application programs are run on

the client-side.
The server side is responsible to provide the functionalities

like: query processing and transaction management.


To communicate with the DBMS, client-side application

establishes a connection with the server side.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 35


3-Tier Architecture
The 3-Tier architecture contains another layer between the client

and server. In this architecture, client can't directly communicate


with the server.
The application on the client-end interacts with an application

server which further communicates with the database system.


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.
The 3-Tier architecture is used in

case of large web application.

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 36


DBMS System Architecture /Structure

Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 37


Database Administrator

 A person who has central control over the system is called


a Database Administrator(DBA).
 Responsibilities of DBA include Designing ,
Implementing and Maintaining the Database System.
 Functions or Role of DBA:-
1. Installing and upgrading the database server and
application tools.
2. Controlling and Monitoring user access to the database.
3. Planning for backup and recovery of data information.
4. Enrolling users and maintaining system security.
5. Maintaining Archive data.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 1- 38

You might also like