CS3492-DBMS Study Material - Unit I
CS3492-DBMS Study Material - Unit I
CS3492-DBMS Study Material - Unit I
UNIT I INTRODUCTION 9
Purpose of Database System - Views of data - Data Models - Database Languages - Database
System Architecture - Database users and Administrator - Entity-Relationship model (E-R model
) - E-R Diagrams - Introduction to relational databases
UNIT IV TRANSACTIONS 9
Transaction Concepts - Transaction Recovery - ACID Properties - System Recovery - Media
Recovery - Two Phase Commit - Save Points - SQL Facilities for recovery - Concurrency - Need
for Concurrency - Locking Protocols - Two Phase Locking - Intent Locking - Deadlock -
Serializability - Recovery Isolation Levels - SQL Facilities for Concurrency.
REFERENCES:
1. RamezElmasri, Shamkant B. Navathe, “Fundamentals of Database Systems”, 4thEdition,
Pearson / Addisionwesley, 2007.
2. Raghu Ramakrishnan, “Database Management Systems”, Third Edition, McGraw Hill,
2003.
3. S.K.Singh, “Database Systems Concepts, Design and Applications”, 1st Edition, Pearson
Education, 2006.
2
(8138) – SARANATHAN COLLEGE OF ENGINEERING
CS2255 – DATABASE MANAGEMENT SYSTEMS
UNIT – I
INTRODUCTION
1.1 Introduction
3
(8138) – SARANATHAN COLLEGE OF ENGINEERING
CS2255 – DATABASE MANAGEMENT SYSTEMS
Disadvantages:
1. Cost of DBMSs
The cost of DBMSs varies significantly, depending on the environment and
functionality provided
2. Complexity and Size
The provision of the functionality makes DBMS an extremely complex piece of
software. Failure to understand the system can lead to bad design decisions.
3. Higher impact of a failure
The centralization of resources increases the vulnerability of the system. Since all
users and applications rely on the availability of the DBMS, the failure of any
component can bring operations to a halt.
4. Cost of conversion
The cost of converting existing applications to run on the new DBMS and
hardware includes the cost of training staff to use these new systems and running
of the system.
5. Performance
The DBMS is written to be more general in order to support applications in all
domains. The effect is that some applications may not run as they used to.
4
(8138) – SARANATHAN COLLEGE OF ENGINEERING
CS2255 – DATABASE MANAGEMENT SYSTEMS
5
(8138) – SARANATHAN COLLEGE OF ENGINEERING
CS2255 – DATABASE MANAGEMENT SYSTEMS
Integrity problems
The data values stored in database must satisfy certain types of consistency
constraints. Developers enforce those constraints in the system by adding
appropriate code in the various application programs.
When new constraints are added, it is difficult to change the programs to
enforce them. The problem is compounded when constraints involve several
data items from different files.
Atomicity problems
Atomic means the transaction must happen in it’s entirely or not at all. It is
difficult to ensure atomicity in a conventional file-processing system.
A computer system is subject to failure. It is crucial that if a failure occurs,
the data be restored to the consistent state that existed prior to the failure.
Concurrent-access anomalies
Many systems allow multiple users to update the data simultaneously to
provide overall performance of the system and faster response. The result of
the concurrent access may leave the account in an account in an incorrect
state.
Security problems
Enforcing security constraints in an ad hoc manner to the file processing
system is difficult. Not every user of the database system should be able to
access all the data.
For the system to be usable, it must retrieve data efficiently. The need for
efficiency has led designers to use complex data structures to represent data in the
database. Since many users are not computer trained, developers hide the complexity from
users through several levels of abstraction to simplify users’ interactions with the system.
6
(8138) – SARANATHAN COLLEGE OF ENGINEERING
CS2255 – DATABASE MANAGEMENT SYSTEMS
View level
View 1 View 2 …… View n
Logical
Level
Physical
Level
The objective of the three-level architecture is to separate each user’s view of the
database from the way the database is physically represented.
Physical / Internal Level:The lowest level of abstraction describes how
the data are actually stored. This level describes complex low-level data
structures in details.
Logical Level: The next-higher level of abstraction describes what data
are stored in the database and what relationships exist among those data.
Although implementation of the simple structures at the logical level does
not need to be aware of this complexity.
Database administrators, who must decide what information to
keep in the database, use the logical level of abstraction.
View Level:The highest level of abstraction describes only part of the
entire database. Even though the logical level uses simpler structures,
complexity remains because of the variety of information stored in a large
database.
7
(8138) – SARANATHAN COLLEGE OF ENGINEERING
CS2255 – DATABASE MANAGEMENT SYSTEMS
A database may have several schemas at the view level is called subschemas,
that describe different views of the database. The physical schema is hidden beneath the
logical schema.
According to the types of concepts used to describe the database structure, there
are three data models:
1. An External data model: to represent each user’s view of the
organization.
2. A Conceptual data model: to represent the logical view that is DBMS
independent.
3. An Internal data model: to represent the conceptual schema in such a
way that it can be understood by the DBMS.
Extended
Object-Oriented
Relational
Data Model
Data Model
8
(8138) – SARANATHAN COLLEGE OF ENGINEERING
CS2255 – DATABASE MANAGEMENT SYSTEMS
Relational Model
The relational model uses a collection of tables to represent both data and the
relationships among those data. It is based on the concept of mathematical relations.
Relational model stores data in the form of a table. Each table corresponds to en
entity and each row represents an instance of that entity. Table are also called relations,
related to each other through the sharing of a common entity characteristic.
The relational data model is widely used data model and a vast majority of current
database systems are based on the relational model e.g.Relational DBMS - DB2, MS SQL
Server.
Advantages:
Structural independence is promoted by the use of independence of
tables.
Changes in a table’s structure do not affect data access.
Ad hoc query capability is based on SQL.
Disadvantages:
The RDBMS requires substantial hardware and software overhead.
Isolation of Information will prevent the information integration.
Ease of design may lead to bad database schema design.
Entity-Relational Model
The ER Model is based on two component namely entity and relationships. An
entity is a collection of basic real time objects and relationship describe associations
among these objects/ data. There are three types of relationships exist such as One-to-
One, One-to-Many and Many-to-Many.An entity is described by a set of attributes that
describes associations among data.
Advantages:
Visual presentation makes it an effective communication tools.
It is integrated with dominant relation model.
Visual modelling produces exceptional conceptual simplicity.
Disadvantages:
Limited constraint representation.
Limited relationship representation.
Lose of information content occurs when attributes are removed from
entities.
10
(8138) – SARANATHAN COLLEGE OF ENGINEERING
CS2255 – DATABASE MANAGEMENT SYSTEMS
DDL gets as input some instructions, generates some output and it will be stored
in the data dictionary. A database system consults the data dictionary before reading or
modifying actual data.
Domain Constraints
A domain of possible values must be associated with every attributes e.g. integer
type, number type, date/time type. Declaring an attribute to be a particular domain acts as
a constraint on the values.
Domain constraints are tested by the system whenever a new data item is entered
into the database.
Referential Integrity
There are some cases a value that appears in one relation for a given set of
attributes needs to appear also in some other relation. Database modifications can cause
violations of referential integrity and when it is violated, the normal procedure is to reject
the action that caused the violation.
Assertions
An assertion is any condition that the database must always satisfy. Domain
constraints and referential integrity are the special forms of assertions.
When an assertion is created, the system tests it for validity and if it valid then any
future modification to the database is allowed only if it does not cause that assertion to be
violated.
Authorization
In order to provide different types of privileges to database users, authorization is
the only key term which is used to provide the required privileges. The most common
authorizations are as follows:
1. READ Authorization: which allows reading but modification of data is not
permitted.
2. INSERT Authorization: which allows reading of existing data and insertion of
new data but modification of existing data is not allowed.
3. UPDATE Authorization: which allows insertion, reading and updation of
existing data but deletion is not permitted.
4. DELETE Authorization:which allows modification of existing data including
the deletion operation.