DBMS Unit I
DBMS Unit I
What is database?
(or)
A Database Management System (DBMS) is software designed to store, retrieve,
define, and manage data in a database.
Popular DBMS Software: Here, is the list of some popular DBMS systems:
• Oracle
• NCR Teradata
• Microsoft SQL Server
• MySQL
• IBM DB2
• Microsoft Access
• SQLite
• MariaDB, etc.
system software for banking system, then we need to create a lot of text file to store
different information. By considering this example we understand disadvantages of
__________________________________________________________________________________
Ch. Vijayananda Ratnam @ Dept. of CSE 1
Database Management Systems UNIT-I
• Data redundancy means repetition of data.
a situation a customer’s detail like: name, address, e-mail, contact number, city,
etc... stored in both the files, saving.txt - a file which store's details of saving
account holder and current.txt- a file which store's details of current account
holder. because of storing same information of customer in two separate files,
kind of accounts a saving and a current. so, in file system this customers address
is stored in both the files saving.txt and current.txt. Now customer changed
• Example: We have stored customers data like: name, address, e-mail, contact
number, and city. Now we want a complete record of the customer who lives in
the record from file ii) select only those record whose city is Guntur from the
result of first (i) program. We cannot achieve convenient and efficient data
5) Integrity Problems
• It means the data available in the database is must be correct and consistent.
• To achieve this data stored in a file must satisfy the rules define by the DBA.
• Example: Initially while developing s/w for any bank they have decided that
account balance should not be less than zero, and they developed an
application program according to this constraint/rule. Now after few years
to change in application program and need to install in all systems using that
application program, but this is not an easy task.
6) Atomicity Problems
• It means, transaction/operation completes either all (100%) or none (0%).
balance Rs.4500 and Rs.2000 respectively. Now we have to transfer Rs.500 from
A/c1 to A/c-2. To achieve this, entire transaction divide into two separate parts:
i) debit Rs.500 from A/c-1 and ii) credit Rs.500 to A/c-2, but after performing
debit operation somehow system goes down or power failure happened and
credit operation not complete, because of that we loss Rs.500. This leads
database towards in-consistence state.
• It is difficult to ensure atomicity in a file system, while in DBMS you do not need
to worry about it.
A/c-1. A person access A/c-1 and debit Rs.1000 by reading A/c-1 data from
database, but before writing change back to database, simultaneously someone
performed debit operation on same account worth Rs.500. So, it will read
Rs.5000 as balance and after debit Rs.500 remaining balance is Rs. 4500. But
after two simultaneous transaction worth Rs.1000 and Rs.500 actual balance
would be Rs.3500.
8) Security Problems
• Database should be accessible in a limited way to different users.
• Each user are allowed to access only those data, which is required for his/her
application.
• Example: Only a customer can check his/her account detail, no one else have to
rights to access his/her account.
search for any train in IRCTC then we get results about that train only in a
fraction of seconds. But the file system would have given us the entire file. Such
a file size is large hence its access time will also be more.
• Minimized Data Redundancy: DBMS has different constraints like primary key
constraints which helps in ensuring that we store only unique data in our
database i.e. same data can't be stored in more than one places.
__________________________________________________________________________________
Ch. Vijayananda Ratnam @ Dept. of CSE 4
Database Management Systems UNIT-I
• Data Consistency: Since DBMS solves the problem of data redundancy, the
• Security: We have role-based access control in DBMS. Each user has a different
set of access thus the data is secured from problems like data leaks, misuse of
i.e. the accounts manager will have the access to all the data related to the
accounts and the teacher will not be allowed to view the accounts data.
• No attributes for accessing the data: Here, we don't need to know the
location of the file. The user makes a request from any web application or app
and the server responds accordingly. Example: If we want to know the fastest
train between two stations we make a request on IRCTC and we get the result
__________________________________________________________________________________
Ch. Vijayananda Ratnam @ Dept. of CSE 5
Database Management Systems UNIT-I
• Airlines: reservations, schedules.
Data Abstraction refers to the process of hiding irrelevant details from the user. There
are mainly three levels of data abstraction. They are:
1. Physical Level
2. Conceptual Level
3. View Level
Physical Level:
External Level:
• Only part of the database can be viewed at a time but not the entire database.
Data independence refers to the property of DBMS through which we can modify
the schema definition at one level without changing the schema definition at higher
level.
We have two levels of data independence that are defined on the basis of three
levels of abstraction.
1. Physical Data Independence
Physical Data Independence refers to the characteristic of changing the physical level
without affecting the logical level or conceptual level. Using this property, we can easily
change the storage device of the database without affecting the logical schema.
Example: Suppose you want to replace the storage device form hard disk to SSD or
magnetic tape then it should not affect the data stored at the logical level.
external or view level. If we do any changes in the logical level then the user view of
the data remains unaffected. The changes in the logical level are required whenever
database.
called Instance.
• Data Models are used to show how data is stored, connected, accessed and
updated in the database management system
• There are many data models being used nowadays but the relational model is
the most widely used model.
• These are used for designing the logical/ conceptual level of a database.
• Otherwise called as semantic models.
• For example: ER Model, ER diagrams are used for designing logical level of a
database.
• Network Model uses the data structure Graph for representing data
• Hierarchical Model uses the data structure Tree for representing the data
• Relational Model uses relation / table (set of rows & columns) for representing
data
Hierarchical Model
Hierarchical Model was the first DBMS model. This model organizes the data in the
hierarchical tree structure. The hierarchy starts from the root which has root data and
then it expands in the form of a tree adding child node to the parent node. This model
easily represents some of the real-world relationships like food recipes, sitemap of a
website etc.
Example: We can represent the relationship between the shoes present on a shopping
website in the following way:
Network Model
This model is an extension of the hierarchical model. It was the most popular model
before the relational model. This model is the same as the hierarchical model, the only
difference is that a record can have more than one parent. It replaces the hierarchical
tree with a graph.
__________________________________________________________________________________
Ch. Vijayananda Ratnam @ Dept. of CSE 9
Database Management Systems UNIT-I
Example: we can see that node student has two parents i.e., CSE Department and
• Both network and hierarchical models are involved with a greater number of
pointers.
• A single misplaced pointer corrupts the entire database.
Relational Model
Relational Model is the most widely used model. In this model, the data is maintained
in the form of a two-dimensional table. All the information is stored in the form of row
and columns. The basic structure of a relational model is table. So, the tables are also
object.
• Number of columns represents degree of the table.
__________________________________________________________________________________
Ch. Vijayananda Ratnam @ Dept. of CSE 10
Database Management Systems UNIT-I
• Number of tuples represents cardinality of the table.
Properties of Relation:
• All values in a table are atomic.
• Scalable: This model can be easily scaled as we can add as many rows and
columns we want.
employee.
• They are:
1. Database Administrators.
2. Database Designers.
3. System Analysts.
4. Application Programmers.
5. Sophisticated Users.
6. Naïve Users/Parametric Users.
7. Casual/Temporary Users.
__________________________________________________________________________________
Ch. Vijayananda Ratnam @ Dept. of CSE 11
Database Management Systems UNIT-I
DBA stands for database administrator
He is responsible for managing the overall database management system like a
superuser of the system.
DBA is responsible for:
• Storage Structure and Access Method Definition: The storage structure and
accessing methods of data at physical storage medium is modified by DBA only.
user must take authorization from DBA in-order to access the parts which the
user cannot access.
• Database designers design the appropriate structure for the database, where
we share data.
System Analyst
• System analyst analyses the requirements of end-users, especially naïve and
programs.
• They develop application programs such as C, C++, Java, PHP, Python, etc.
• These users interact with the database but they do not write programs
Naïve Users / Parametric Users
• Naïve Users are Unsophisticated users, who have no knowledge of the database.
• They are the end-users of the database who work through the menu-driven
applications.
• For Example: Railway’s ticket booking users are naive users. Or Clerical staff in
• These types of users communicate with the database for a little period of time.
The database system is divided into three components: Query Processor, Storage
Manager, and Disk Storage.
1. Storage Manager:
the system.
• It is responsible for interaction with the File Manager.
__________________________________________________________________________________
Ch. Vijayananda Ratnam @ Dept. of CSE 13
Database Management Systems UNIT-I
b) Transaction Manager: Ensures the consistency of database despite of system
2. Disk Storage
The Storage Manager implements several data structures at physical level of database.
They are:
__________________________________________________________________________________
Ch. Vijayananda Ratnam @ Dept. of CSE 14
Database Management Systems UNIT-I
• Data Files: Stores database.
3. Query Processor
translates the query into a number of evaluation plans. DML Compiler performs
query optimization i.e., selects the optimal evaluation plan for execution of
query.
• Query Evaluation Engine: Executes the low-level instructions generated by
DML compiler.
*************End of Unit-1*************
__________________________________________________________________________________
Ch. Vijayananda Ratnam @ Dept. of CSE 15