Books of Database Management
System
Book Name Author
Database System Concepts
(3rd / 4th Edition)
Abraham Silberschatz,
Henry F. Korth, S. Sudarshan
(TMH)
Fundamentals of Database Systems
(4th edition)
Ramez Elmasari & Shamkant B. Navathe
(Pearson Education)
An Introduction to Database Systems
(Asian Students Edition)
Bipin C. Desai
(Galgotia Publications Ltd.)
Database Management: Objectives, system
functions & Administration
Gordan C. Everest
(TMH)
Introduction to Database Management
Systems
Atul Kahate
(Pearson Education)
Database Management Systems Rajesh Narang (PHI)
Database Management and Oracle
Programming
S.S. Khandare
(S. Chand & Company Ltd.)
Database Management System
Lecture 1
What is Database
• It is a collection of related data or information. It
is used to store data.
• It can be of any size and complexity.
• It represents some aspect of real world
What is DBMS
• A DBMS is a general purpose software system that
facilitates the process of defining, constructing,
manipulating and sharing databases among
various users and application.
• Or we can say that, it is a collection of programs
that enables user to create and maintain a
database.
DBMS Software + Database= Database System
Application Programs/ Queries
Users/ Programmer
Software to process
queries/ programs
Software to access
stored data
DBMS
Software
Stored
Database
Definition
(Meta Data)
Stored
Database
Drawbacks of using file processing
systems
• Data redundancy and inconsistency
– Duplication of information in different files
– Various copies of same data
• Difficulty in accessing data
– Need to write a new program to carry out each new
task
• Integrity problems
– Any operation on database must be atomic. This
means, it must either fully happen, or not happen at
all. It must not complete partially.
Drawbacks contd..
• Concurrent access by multiple users
– Multiple users are allowed to access data simultaneously.
This is for the sake of better performance and faster
response.
– Uncontrolled concurrent accesses can lead to
inconsistencies
– Example: Two people reading a balance (say 500) and
updating it by withdrawing money (say 50 by one & 100
by other person) at the same time
• Security problems
– Prevention of data accession by unauthorized users.
– Each user should be allowed to access data concerning his
requirements only.
Purpose of Database Systems
Database management systems were developed to
handle the following difficulties of typical file-
processing systems supported by conventional
operating systems:
• Data redundancy and inconsistency
• Difficulty in accessing data
• Data isolation – multiple files and formats
• Integrity problems
• Atomicity of updates
• Concurrent access by multiple users
• Security problems
View of Data
View 1 View 2 … View n
An architecture for a database system
Levels of Abstraction
1. Physical level: This is the lowest level of abstraction.
It describes how data is actually stored in database. At
this level complex low level data structures are
described.
2. Logical level: This is the next higher level of
abstraction. This level describes what data is stored
in the database and what relationships among those
data exist.
3. View level: The highest level of abstraction describes
only part of entire database. This level describes the
user interaction with database system.
Instances and Schemas
• A database schema is the skeleton structure that represents the
logical view of the entire database. It defines how the data is
organized and how the relations among them are associated.
• A database schema does not contain any data or information. It
formulates all the constraints that are to be applied on the data.
• A database schema can be divided broadly into two categories :
– Physical Database Schema: This schema pertains to the actual
storage of data and its form of storage like files, indices, etc. It defines
how the data will be stored in a secondary storage.
– Logical Database Schema: This schema defines all the logical
constraints that need to be applied on the data stored. It defines
tables, views, and integrity constraints.
Instance: The collection of information stored in the
database at a particular moment is called an instance
of the database.
• In a given database state, each schema construct
has its own current set of instances.
Data Independence
• Data independence is ability to modify a schema
definition in one level without affecting a schema
definition in the next higher level.
• There are two levels of data independence:
1. Physical Data Independence
2. Logical Data Independence
Physical Data Independence
• Physical Data Independence is the ability to modify the physical
schema without requiring any change in application programs.
• Modifications at the internal levels are occasionally necessary
to improve performance. possible modifications at internal
levels are change in file structures, compression techniques,
hashing algorithms, storage devices, etc.
• Physical data independence separates conceptual levels from
the internal levels.
• This allows to provide a logical description of the database
without the need to specify physical structures.
• Comparatively, it is easy to achieve physical data
independence.
Logical Data Independence
• Logical data independence is ability to modify the logical
schema without requiring any change in application
programs.
• Modification at the logical levels are necessary whenever
the logical structures of the database is altered.
• Logical data independence separates external level from
the conceptual view.
• Comparatively it is difficult to achieve logical data
independence.
• Application programs are heavily dependent on logical
structures of the data they access.so any change in logical
structure also requires programs to change.
Data model
• It is a collection of conceptual tools for describing data,
data relationships, data semantics and consistency
constraints.
• A data model is an idea which describes how the data can
be represented and accessed from software system after its
complete implementation.
• It is a simple abstraction of complex real world data
gathering environment.
• It defines data elements and relationships among various
data elements for a specified system.
• The main purpose of data model is to give an idea that how
final system or software will look like after development is
completed.
Types of Data Model
1. Hierarchical Model
2. Relational Model
3. Network Model
4. Entity Relationship Model
5. Object Model
Hierarchical Model
• It represents the data in a hierarchical tree
structure.
• This model is the first DBMS model.
• In this model, the data is sorted hierarchically.
• It uses pointer to navigate between the stored
data.
Relational Model
• Relational model is based on first-order predicate
logic.
• This model was first proposed by E. F. Codd.
• It represents data as relations or tables.
• Relational database simplifies the database
structure by making use of tables and columns.
Network Model
• Network Database Model is same like
Hierarchical Model, but the only difference is
that it allows a record to have more than one
parent.
• In this model, there is no need of parent to child
association like the hierarchical model.
• It replaces the hierarchical tree with a graph.
• It represents the data as record types and one-
to-many relationship.
• This model is easy to design and understand.
Object Model
• Object model stores the data in the form of objects,
classes and inheritance.
• This model handles more complex applications, such
as Geographic Information System (GIS), scientific
experiments, engineering design and manufacturing.
• It is used in File Management System.
• It represents real world objects, attributes and
behaviors.
• It provides a clear modular structure.
• It is easy to maintain and modify the existing code.
Entity Relationship Model
• Entity Relationship Model is a high-level data model.
• It was developed by Chen in 1976.
• This model is useful in developing a conceptual
design for the database.
• ER model is based on the notion of real-world
entities and relationships among them.
• It is very simple and easy to design logical view of
data.
• The developer can easily understand the system by
looking at an ER model constructed.
In this diagram
• Rectangle represents the entities. Eg. Doctor and Patient.
• Ellipse represents the attributes. Eg. DocId, Dname, PId,
Pname. Attribute describes each entity becomes a major
part of the data stored in the database.
• Diamond represents the relationship in ER diagrams. Eg.
Doctor diagnoses the Patient.
• lines which link attributes to entity sets and entity sets to
relationships.
Database Language
• Database Language are mainly of Two types: they are as
folows ,
1. Data Definition Language (DDL)
2. Data Manipulation Language (DML)
Data Definition Language (DDL): A database schema is
specified by a set of definition expressed by a special
language called a data-definition language(DDL)
• It is a Set of Sql Commands used to create, modify, and
delete database objects such as tables, views, indices etc.
• It is normally used by DBA and Database engineers. It
provides command like -
command Description
CREATE to create objects in a database
ALTER to modify existing data in a table.
DROP to delete objects from the database
TRUNCATE to remove all records from the table
• DML (Data Manipulation Language): A Data
Manipulation Language is a database language
which enables users to access and modify stored
data in a database. The types of access are as
follows,
• Retrieval of information stored in the database.
• Insertion of new information into the database.
• Deletion of information stored in the database.
• Modification of information stored in the
database.
• There are basically two types of Data
Manipulation Language
– Procedural DMLs: Procedural DMLs requires a user to
specify what data are needed and how to get those
data.
– Non Procedural DMLs: Non Procedural DML’s requires
a user only to specify what data are needed.
command Description
INSERT to insert data into table
SELECT to retrieve data from the table
UPDATE to modify existing data in the table
DELETE to delete records from the table.
Database Administrator (DBA)
• DBA is a person in the organization who controls
the design and the use of the database.
• Functions of DBA
1. Schema Definition:
• The DBA definition the logical Schema of the database. A
Schema refers to the overall logical structure of the
database.
• According to this schema, database will be developed to
store required data for an organization.
2. Storage Structure and Access Method Definition:
• The DBA decides how the data is to be represented in the
stored database.
3. Physical Organization Modification:
• The DBA modifies the physical organization of the database to
reflext the changing needs of the organization or to improve
performance.
4. Approving Data Access:
• The DBA determines which user needs access to which part of
the database.
• According to this, various types of authorizations are granted
to different users.
5. Monitoring Performance:
• The DBA monitors performance of the system. The DBA
ensures that better performance is maintained by making
changes in physical or logical schema if required.
6. Backup and Recovery:
• Database should not be lost or damaged.
• The DBA ensures this periodically backing up the database on
magnetic tapes or remote servers.
• In case of failure, such as virus attack database is recovered
from this backup.
Database Users
• Database users are the one who really use and take the benefits of
database. There will be different types of users depending on their
need and way of accessing the database.
• Types of Database users
1. Application Programmers - They are the developers who interact
with the database by means of DML queries. These DML queries
are written in the application programs like C, C++, JAVA, Pascal
etc. These queries are converted into object code to
communicate with the database. For example, writing a C
program to generate the report of employees who are working in
particular department will involve a query to fetch the data from
database. It will include a embedded SQL query in the C Program.
2. Sophisticated Users - They are database developers, who
write SQL queries to select/insert/delete/update data.
They do not use any application or programs to request
the database. They directly interact with the database by
means of query language like SQL. These users will be
scientists, engineers, analysts who thoroughly study SQL
and DBMS to apply the concepts in their requirement. In
short, we can say this category includes designers and
developers of DBMS and SQL.
3. Specialized Users - These are also sophisticated users, but
they write special database application programs. They
are the developers who develop the complex programs to
the requirement.
4. Stand-alone Users - These users will have stand –alone
database for their personal use. These kinds of database
will have readymade database packages which will have
menus and graphical interfaces.
• Native Users - These are the users who use the
existing application to interact with the database.
For example, online library system, ticket booking
systems, ATMs etc. which has existing application
and users use them to interact with the database
to fulfill their requests.
DatabaseManagementSystem.pptx

DatabaseManagementSystem.pptx

  • 1.
    Books of DatabaseManagement System Book Name Author Database System Concepts (3rd / 4th Edition) Abraham Silberschatz, Henry F. Korth, S. Sudarshan (TMH) Fundamentals of Database Systems (4th edition) Ramez Elmasari & Shamkant B. Navathe (Pearson Education) An Introduction to Database Systems (Asian Students Edition) Bipin C. Desai (Galgotia Publications Ltd.) Database Management: Objectives, system functions & Administration Gordan C. Everest (TMH) Introduction to Database Management Systems Atul Kahate (Pearson Education) Database Management Systems Rajesh Narang (PHI) Database Management and Oracle Programming S.S. Khandare (S. Chand & Company Ltd.)
  • 2.
  • 3.
    What is Database •It is a collection of related data or information. It is used to store data. • It can be of any size and complexity. • It represents some aspect of real world
  • 4.
    What is DBMS •A DBMS is a general purpose software system that facilitates the process of defining, constructing, manipulating and sharing databases among various users and application. • Or we can say that, it is a collection of programs that enables user to create and maintain a database. DBMS Software + Database= Database System
  • 5.
    Application Programs/ Queries Users/Programmer Software to process queries/ programs Software to access stored data DBMS Software Stored Database Definition (Meta Data) Stored Database
  • 6.
    Drawbacks of usingfile processing systems • Data redundancy and inconsistency – Duplication of information in different files – Various copies of same data • Difficulty in accessing data – Need to write a new program to carry out each new task • Integrity problems – Any operation on database must be atomic. This means, it must either fully happen, or not happen at all. It must not complete partially.
  • 7.
    Drawbacks contd.. • Concurrentaccess by multiple users – Multiple users are allowed to access data simultaneously. This is for the sake of better performance and faster response. – Uncontrolled concurrent accesses can lead to inconsistencies – Example: Two people reading a balance (say 500) and updating it by withdrawing money (say 50 by one & 100 by other person) at the same time • Security problems – Prevention of data accession by unauthorized users. – Each user should be allowed to access data concerning his requirements only.
  • 8.
    Purpose of DatabaseSystems Database management systems were developed to handle the following difficulties of typical file- processing systems supported by conventional operating systems: • Data redundancy and inconsistency • Difficulty in accessing data • Data isolation – multiple files and formats • Integrity problems • Atomicity of updates • Concurrent access by multiple users • Security problems
  • 9.
    View of Data View1 View 2 … View n An architecture for a database system
  • 10.
    Levels of Abstraction 1.Physical level: This is the lowest level of abstraction. It describes how data is actually stored in database. At this level complex low level data structures are described. 2. Logical level: This is the next higher level of abstraction. This level describes what data is stored in the database and what relationships among those data exist. 3. View level: The highest level of abstraction describes only part of entire database. This level describes the user interaction with database system.
  • 11.
    Instances and Schemas •A database schema is the skeleton structure that represents the logical view of the entire database. It defines how the data is organized and how the relations among them are associated. • A database schema does not contain any data or information. It formulates all the constraints that are to be applied on the data. • A database schema can be divided broadly into two categories : – Physical Database Schema: This schema pertains to the actual storage of data and its form of storage like files, indices, etc. It defines how the data will be stored in a secondary storage. – Logical Database Schema: This schema defines all the logical constraints that need to be applied on the data stored. It defines tables, views, and integrity constraints.
  • 12.
    Instance: The collectionof information stored in the database at a particular moment is called an instance of the database. • In a given database state, each schema construct has its own current set of instances.
  • 13.
    Data Independence • Dataindependence is ability to modify a schema definition in one level without affecting a schema definition in the next higher level. • There are two levels of data independence: 1. Physical Data Independence 2. Logical Data Independence
  • 14.
    Physical Data Independence •Physical Data Independence is the ability to modify the physical schema without requiring any change in application programs. • Modifications at the internal levels are occasionally necessary to improve performance. possible modifications at internal levels are change in file structures, compression techniques, hashing algorithms, storage devices, etc. • Physical data independence separates conceptual levels from the internal levels. • This allows to provide a logical description of the database without the need to specify physical structures. • Comparatively, it is easy to achieve physical data independence.
  • 15.
    Logical Data Independence •Logical data independence is ability to modify the logical schema without requiring any change in application programs. • Modification at the logical levels are necessary whenever the logical structures of the database is altered. • Logical data independence separates external level from the conceptual view. • Comparatively it is difficult to achieve logical data independence. • Application programs are heavily dependent on logical structures of the data they access.so any change in logical structure also requires programs to change.
  • 16.
    Data model • Itis a collection of conceptual tools for describing data, data relationships, data semantics and consistency constraints. • A data model is an idea which describes how the data can be represented and accessed from software system after its complete implementation. • It is a simple abstraction of complex real world data gathering environment. • It defines data elements and relationships among various data elements for a specified system. • The main purpose of data model is to give an idea that how final system or software will look like after development is completed.
  • 17.
    Types of DataModel 1. Hierarchical Model 2. Relational Model 3. Network Model 4. Entity Relationship Model 5. Object Model
  • 18.
    Hierarchical Model • Itrepresents the data in a hierarchical tree structure. • This model is the first DBMS model. • In this model, the data is sorted hierarchically. • It uses pointer to navigate between the stored data.
  • 19.
    Relational Model • Relationalmodel is based on first-order predicate logic. • This model was first proposed by E. F. Codd. • It represents data as relations or tables. • Relational database simplifies the database structure by making use of tables and columns.
  • 20.
    Network Model • NetworkDatabase Model is same like Hierarchical Model, but the only difference is that it allows a record to have more than one parent. • In this model, there is no need of parent to child association like the hierarchical model. • It replaces the hierarchical tree with a graph. • It represents the data as record types and one- to-many relationship. • This model is easy to design and understand.
  • 22.
    Object Model • Objectmodel stores the data in the form of objects, classes and inheritance. • This model handles more complex applications, such as Geographic Information System (GIS), scientific experiments, engineering design and manufacturing. • It is used in File Management System. • It represents real world objects, attributes and behaviors. • It provides a clear modular structure. • It is easy to maintain and modify the existing code.
  • 23.
    Entity Relationship Model •Entity Relationship Model is a high-level data model. • It was developed by Chen in 1976. • This model is useful in developing a conceptual design for the database. • ER model is based on the notion of real-world entities and relationships among them. • It is very simple and easy to design logical view of data. • The developer can easily understand the system by looking at an ER model constructed.
  • 24.
    In this diagram •Rectangle represents the entities. Eg. Doctor and Patient. • Ellipse represents the attributes. Eg. DocId, Dname, PId, Pname. Attribute describes each entity becomes a major part of the data stored in the database. • Diamond represents the relationship in ER diagrams. Eg. Doctor diagnoses the Patient. • lines which link attributes to entity sets and entity sets to relationships.
  • 25.
    Database Language • DatabaseLanguage are mainly of Two types: they are as folows , 1. Data Definition Language (DDL) 2. Data Manipulation Language (DML) Data Definition Language (DDL): A database schema is specified by a set of definition expressed by a special language called a data-definition language(DDL) • It is a Set of Sql Commands used to create, modify, and delete database objects such as tables, views, indices etc. • It is normally used by DBA and Database engineers. It provides command like -
  • 26.
    command Description CREATE tocreate objects in a database ALTER to modify existing data in a table. DROP to delete objects from the database TRUNCATE to remove all records from the table
  • 27.
    • DML (DataManipulation Language): A Data Manipulation Language is a database language which enables users to access and modify stored data in a database. The types of access are as follows, • Retrieval of information stored in the database. • Insertion of new information into the database. • Deletion of information stored in the database. • Modification of information stored in the database.
  • 28.
    • There arebasically two types of Data Manipulation Language – Procedural DMLs: Procedural DMLs requires a user to specify what data are needed and how to get those data. – Non Procedural DMLs: Non Procedural DML’s requires a user only to specify what data are needed. command Description INSERT to insert data into table SELECT to retrieve data from the table UPDATE to modify existing data in the table DELETE to delete records from the table.
  • 29.
    Database Administrator (DBA) •DBA is a person in the organization who controls the design and the use of the database. • Functions of DBA 1. Schema Definition: • The DBA definition the logical Schema of the database. A Schema refers to the overall logical structure of the database. • According to this schema, database will be developed to store required data for an organization. 2. Storage Structure and Access Method Definition: • The DBA decides how the data is to be represented in the stored database.
  • 30.
    3. Physical OrganizationModification: • The DBA modifies the physical organization of the database to reflext the changing needs of the organization or to improve performance. 4. Approving Data Access: • The DBA determines which user needs access to which part of the database. • According to this, various types of authorizations are granted to different users. 5. Monitoring Performance: • The DBA monitors performance of the system. The DBA ensures that better performance is maintained by making changes in physical or logical schema if required. 6. Backup and Recovery: • Database should not be lost or damaged. • The DBA ensures this periodically backing up the database on magnetic tapes or remote servers. • In case of failure, such as virus attack database is recovered from this backup.
  • 31.
    Database Users • Databaseusers are the one who really use and take the benefits of database. There will be different types of users depending on their need and way of accessing the database. • Types of Database users 1. Application Programmers - They are the developers who interact with the database by means of DML queries. These DML queries are written in the application programs like C, C++, JAVA, Pascal etc. These queries are converted into object code to communicate with the database. For example, writing a C program to generate the report of employees who are working in particular department will involve a query to fetch the data from database. It will include a embedded SQL query in the C Program.
  • 32.
    2. Sophisticated Users- They are database developers, who write SQL queries to select/insert/delete/update data. They do not use any application or programs to request the database. They directly interact with the database by means of query language like SQL. These users will be scientists, engineers, analysts who thoroughly study SQL and DBMS to apply the concepts in their requirement. In short, we can say this category includes designers and developers of DBMS and SQL. 3. Specialized Users - These are also sophisticated users, but they write special database application programs. They are the developers who develop the complex programs to the requirement. 4. Stand-alone Users - These users will have stand –alone database for their personal use. These kinds of database will have readymade database packages which will have menus and graphical interfaces.
  • 33.
    • Native Users- These are the users who use the existing application to interact with the database. For example, online library system, ticket booking systems, ATMs etc. which has existing application and users use them to interact with the database to fulfill their requests.