Professional Documents
Culture Documents
DMS Ch1
DMS Ch1
Database
Management System
As per MSBTE ‘I’ Scheme Syllabus
DMS-22319
Unit-I
Database System Concept
Total Marks- 12
Contents:
1.1 Concept of Data, database, DBMS, advantages of DBMS, over file Processing system,
Application of database.
1.2 Three level architecture for database system.
1.3 Data abstraction: Different level of Data abstraction, Instance and schema, Data
independence- Logical and Physical independence.
1.4 Overall Structure of DBMS.
1.5 Data Modelling: Record based logical model- Relation, Network, Hierarchical.
1.6 Data Modelling using the E-R Model: Entity Relationship Model, Strong Entity set, Weak
Entity set, Types of Attributes, E-R Diagrams.
1.1. Data
In computer science, data is information that has been translated into a form that is
efficient for movement or processing. In a simple words data can be facts related to any
object in consideration.
For example your name, age, height, weight, etc are some data related to you.
A picture, image, file, pdf etc. Can also be considered data.
1.2. Database(DB)
A database is a collection of information or facts that is organized so that it can be
easily accessed, managed and updated.
Data is organized into rows, columns and tables, and it is indexed to make it easier
to find relevant information.
DBMS also provides protection and security to the databases. It also maintains data
consistency in case of multiple users.
o MySql
o Oracle
o SQL Server
o IBM DB2
o PostgreSQL
o Amazon SimpleDB (cloud based) etc.
DMS-22319 www.gunwantmankar.com Page 2
Unit-I Database System Concept
It's Complexity
Except MySQL, which is open source, licensed DBMSs are generally costly.
They are large in size.
Controlling Redundancy
Maintaining Integrity
Inconsistency can be avoided
Data can be shared
Restricting unauthorized access
Providing Backup and Recovery
Concurrency Control
Better security.
Data searching can be provided.
Simplicity
Back up and Recovery.
3. Data isolation
4. Integrity problems
5. Atomicity problems
Database is required to keep record of ticket booking, train’s departure and arrival
status. Also if trains get late then people get to know it through database update.
There are thousands of books in the library so it is very difficult to keep record of all
the books in a copy or register. So DBMS used to maintain all the information relate
to book issue dates, name of the book, author and availability of the book.
Banking
Examinations are done online today and universities and colleges maintain all
these records through DBMS. Student’s registrations details, results, courses and
grades all the information are stored in database.
For purchase of credit cards and all the other transactions are made possible
only by DBMS. A credit card holder knows the importance of their information that
all are secured through DBMS.
We all are on social media websites to share our views and connect with our
friends. Daily millions of users signed up for these social media accounts like
facebook, twitter, pinterest and Google plus. But how all the information of users are
stored and how we become able to connect to other people, yes this all because
DBMS.
DMS-22319 www.gunwantmankar.com Page 4
Unit-I Database System Concept
Telecommunications
Finance
Those days have gone far when information related to money was stored in
registers and files. Today the time has totally changed because there are lots f thing to
do with finance like storing sales, holding information and finance statement
management etc.
Military
Military keeps records of millions of soldiers and it has millions of files that
should be keep secured and safe. As DBMS provides a big security assurance to the
military information so it is widely used in militaries. One can easily search for all the
information about anyone within seconds with the help of DBMS.
Online Shopping
Online shopping has become a big trend of these days. No one wants to go to
shops and waste his time. Everyone wants to shop from home. So all these products
are added and sold only with the help of DBMS. Purchase information, invoice bills
and payment, all of these are done with the help of DBMS.
Big firms have many workers working under them. Human resource
management department keeps records of each employee’s salary, tax and work
through DBMS.
Manufacturing
Manufacturing companies make products and sales them on the daily basis. To
keep records of all the details about the products like quantity, bills, purchase, supply
chain management, DBMS is used.
Same as railway reservation system, airline also needs DBMS to keep records
of flights arrival, departure and delay status.
So in short, one can say the DBMS is used everywhere around us and we
cannot rely without DBMS.
Database systems are made-up of complex data structures. To ease the user
interaction with database, the developers hide internal irrelevant details from users.
This process of hiding irrelevant details from user is called data abstraction.
i) Data Abstraction :
Many end users are not computer trained so it is needed to hide complex data
structures from them.
Hiding complexity of data structures from end user through different levels is
known as data abstraction.
It has 3 levels
a. Physical level
b. logical level
c. view level
ii) Data redundancy :
The repetition of information is known as redundancy .This redundancy leads to
higher storage and access cost.
It may lead to data inconsistency, that is different copies of the same data may have
different values.
Solution-
(i) Instance: The data stored in database at a particular moment of time is called instance
of database.
(ii) Schema: Design of a database is called the schema. Schema is of three types:
Physical schema, logical schema and view schema.
3.2.1. Schema -
The design of a database at physical level is called physical schema, how the data
stored in blocks of storage is described at this level.
Design of database at logical level is called logical schema, programmers and
database administrators work at this level, at this level data can be described as certain
types of data records gets stored in data structures, however the internal details such as
implementation of data structure is hidden at this level (available at physical level).
Design of database at view level is called view schema. This generally describes
end user interaction with database systems.
3.2.2. Instance
Definition of instance: The data stored in database at a particular moment of time
is called instance of database. Database schema defines the variable declarations in tables
that belong to a particular database; the value of these variables at a moment of time is
called the instance of that database.
For example, lets say we have a single table student in the database, today the
table has 100 records, so today the instance of the database has 100 records. Lets say we
are going to add another 100 records in this table by tomorrow so the instance of database
tomorrow will have 200 records in table. In short, at a particular moment the data stored
in database is called the instance, that changes over time when we add or delete data from
the database.
1. Query processor :
Transaction manager: It ensures that the database remains in consistent state despite
of the system failure and that concurrent transaction execution proceeds without
conflicting.
File Manager: It manages the allocation of space on disk storage and data structures
used to represent information stored on disk Buffer Manager: It is responsible for
fetching data from disk storage into main memory and deciding what data to cache
memory.
3. Disk storage :
Data files: It stores the database. Data Dictionary: It stores metadata that hold
particular values. Indices: Provide fast access to data items that hold particular values.
Statistical data: It stores statistical information about the data in the database.
4. Granting authorization for data access -The DBA provides different access
rights to the users according to their level. Ordinary users might have highly restricted
access to data, while you go up in the hierarchy to the administrator, you will get more
access rights. Integrity constraints specifications: Integrity constraints are written by
DBA and they are stored in a special file which is accessed by database manager while
updating data.
5. Routine Maintenance some of the routine maintenance activities of a DBA is
given below.
(i) Taking backup of database periodically
(ii) Ensuring enough disk space is available all the time.
(iii) Monitoring jobs running on the database.
(iv) Ensure that performance is not degraded by some expensive task submitted by
some users.
6. Integrity- constraint specification: Integrity constraints are written by DBA and
they are stored in a special file, which is accessed by database manager, while updating
the data.
5. Data model
A Database model defines the logical design and structure of a database and
defines how data will be stored, accessed and updated in a database management system.
Types of Model
Hierarchical Model
Network Model
Entity-relationship Model
Relational Model
This database model organises data into a tree-like-structure, with a single root,
to which all the other data is linked. The heirarchy starts from the Root data, and
expands like a tree, adding child nodes to the parent nodes.
In this model, a child node will only have a single parent node. This model
efficiently describes many real-world relationships like index of a book, recipes etc.
6. Components of ER Model
6.1. Entity
For example: In the following ER diagram we have two entities Student and
College and these two entities have many to one relationship as many students study
in a single college.
Weak Entity:
An entity that cannot be uniquely identified by its own attributes and relies on the
relationship with other entity is called weak entity. The weak entity is represented by
a double rectangle.
For example – a bank account cannot be uniquely identified without knowing the
bank to which the account belongs, so bank account is a weak entity.
6.2. Attribute
An attribute describes the property of an entity. An attribute is represented as
Oval in an ER diagram. There are four types of attributes:
1. Key attribute
2. Composite attribute
3. Multivalued attribute
4. Derived attribute
6.3. Relationship
A relationship is represented by diamond shape in ER diagram, it shows the
relationship among entities. There are four types of relationships:
1. One to One
2. One to Many
3. Many to One
4. Many to Many
When more than one instances of an entity is associated with a single instance of
another entity then it is called many to one relationship. For example – many students can
study in a single college but a student cannot study in many colleges at the same time.
OR
Sol-