DBMS Unit_1_notes
DBMS Unit_1_notes
Unit-1
Topics covered: Overview of DBMS, Advantages of DBMS over a file processing system,
Introduction & applications of DBMS, Purpose of database system, Views of data, Database
system architecture, Data independence, Evolution of data models, Degree of data abstraction,
Database users & DBA, Database languages .
1. Overview of DBMS
What is a Database?
The database is a collection of inter-related data which is used to retrieve, insert and delete
the data efficiently. It is also used to organize the data in the form of a table, schema, views,
and reports, etc.
For example: The college Database organizes the data about the admin, staff, students and
faculty etc.
Using the database, you can easily retrieve, insert, and delete the information.
What is RDBMS?
• All modern database management systems like SQL, MS SQL Server, IBM DB2,
ORACLE, My-SQL and Microsoft Access are based on RDBMS.
• It is called Relational Data Base Management System (RDBMS) because it is based on
relational model introduced by E.F. Codd.
• Data is represented in terms of tuples (rows) in RDBMS.
• Relational database is most commonly used database. It contains number of tables
and each table has its own primary key.
• Due to a collection of organized set of tables, data can be accessed easily in RDBMS.
• During 1970 to 1972, E.F. Codd published a paper to propose the use of relational
database model.
• RDBMS is originally based on that E.F. Codd's relational model invention.
• The RDBMS database uses tables to store data. A table is a collection of related data
entries and contains rows and columns to store data.
• A table is the simplest example of data storage in RDBMS.
1
Neetu Bansla DBMS 18CSC303J
1 Ajeet 24 B.Tech
2 aryan 20 C.A
3 Mahesh 21 BCA
4 Ratan 22 MCA
5 Vimal 26 BSC
o Data Definition: It is used for creation, modification, and removal of definition that
defines the organization of data in the database.
o Data Updation: It is used for the insertion, modification, and deletion of the actual
data in the database.
o Data Retrieval: It is used to retrieve the data from the database which can be used
by applications for various purposes.
o User Administration: It is used for registering and monitoring users, maintaining
data integrity, enforcing data security, dealing with concurrency control, monitoring
performance and recovering information corrupted by unexpected failure.
Characteristics of DBMS
o It uses a digital repository established on a server to store and manage the
information.
2
Neetu Bansla DBMS 18CSC303J
o It can provide a clear and logical view of the process that manipulates data.
o DBMS contains automatic backup and recovery procedures.
o It contains ACID properties which maintain data in a healthy state in case of failure.
o It can reduce the complex relationship between data.
o It is used to support manipulation and processing of data.
o It is used to provide security of data.
o It can view the database from different viewpoints according to the requirements of
the user.
Advantages of DBMS
o Controls database redundancy: It can control data redundancy because it stores all
the data in one single database file and that recorded data is placed in the database.
o Data sharing: In DBMS, the authorized users of an organization can share the data
among multiple users.
o Easily Maintenance: It can be easily maintainable due to the centralized nature of
the database system.
o Reduce time: It reduces development time and maintenance need.
o Backup: It provides backup and recovery subsystems which create automatic backup
of data from hardware and software failures and restores the data if required.
o multiple user interface: It provides different types of user interfaces like graphical
user interfaces, application program interfaces
File based systems were an early attempt to computerize the manual system. It is also called
a traditional based approach in which a decentralized approach was taken where each
department stored and controlled its own data with the help of a data processing specialist.
The main role of a data processing specialist was to create the necessary computer file
structures, and also manage the data within structures and design some application
programs that create reports based on file data.
3
Neetu Bansla DBMS 18CSC303J
Consider an example of a student's file system. The student file will contain information
regarding the student (i.e. roll no, student name, course etc.). Similarly, we have a subject file
that contains information about the subject and the result file which contains the
information regarding the result.
Some fields are duplicated in more than one file, which leads to data redundancy. So to
overcome this problem, we need to create a centralized system, i.e. DBMS approach.
DBMS:
4
Neetu Bansla DBMS 18CSC303J
There are the following differences between DBMS and File systems:
Meaning DBMS is a collection of data. In DBMS, the The file system is a collection of data. In
user is not required to write the this system, the user has to write the
procedures. procedures for managing the database.
Sharing of data Due to the centralized approach, data Data is distributed in many files, and it
sharing is easy. may be of different formats, so it isn't
easy to share data.
Data Abstraction DBMS gives an abstract view of data that The file system provides the detail of the
hides the details. data representation and storage of data.
5
Neetu Bansla DBMS 18CSC303J
Security and DBMS provides a good protection It isn't easy to protect a file under the file
Protection mechanism. system.
Recovery DBMS provides a crash recovery The file system doesn't have a crash
Mechanism mechanism, i.e., DBMS protects the user mechanism, i.e., if the system crashes
from system failure. while entering some data, then the
content of the file will be lost.
Manipulation DBMS contains a wide variety of The file system can't efficiently store and
Techniques sophisticated techniques to store and retrieve the data.
retrieve the data.
Concurrency DBMS takes care of Concurrent access of In the File system, concurrent access has
Problems data using some form of locking. many problems like redirecting the file
while deleting some information or
updating some information.
Where to use Database approach used in large systems File system approach used in large
that interrelates many files. systems that interrelates many files.
Cost The database system is expensive to The file system approach is cheaper to
design. design.
Data Redundancy Due to the centralization of the database, In this, the files and application
and Inconsistency the problems of data redundancy and programs are created by different
inconsistency are controlled. programmers therefore there exists a lot
of duplication of data which may lead to
inconsistency.
Structure The database structure is complex to The file system approach has a simple
design. structure.
Data In this system, Data Independence exists, In the File system approach, there exists
Independence and it can be of two types. no Data Independence.
6
Neetu Bansla DBMS 18CSC303J
Integrity Integrity Constraints are easy to apply. Integrity Constraints are difficult to
Constraints implement in file system.
Flexibility Changes are often a necessity to the The flexibility of the system is less as
content of the data stored in any system, compared to the DBMS approach.
and these changes are more easily with a
database approach.
3. Application of DBMS
There are different fields where a database management system is utilized. Following are
a few applications which utilize the information base administration framework –
3. Banking –
Database the executive’s framework is utilized to store the exchange data of the client
in the information base.
4. Education Sector –
Presently, assessments are led online by numerous schools and colleges. They deal
with all assessment information through the data set administration framework
7
Neetu Bansla DBMS 18CSC303J
7. Broadcast communications –
Without DBMS any media transmission organization can’t think. The Database the
executive’s framework is fundamental for these organizations to store the call
subtleties and month to month postpaid bills in the information base.
8. Account –
The information base administration framework is utilized for putting away data about
deals, holding and acquisition of monetary instruments, for example, stocks and bonds
in a data set.
9. Online Shopping –
These days, web-based shopping has become a major pattern. Nobody needs to visit
the shop and burn through their time. Everybody needs to shop through web based
shopping sites, (for example, Amazon, Flipkart, Snapdeal) from home. So all the items
are sold and added uniquely with the assistance of the information base
administration framework (DBMS). Receipt charges, installments, buy data these are
finished with the assistance of DBMS.
8
Neetu Bansla DBMS 18CSC303J
11. Manufacturing –
Manufacturing organizations make various kinds of items and deal them consistently.
To keep the data about their items like bills, acquisition of the item, amount, inventory
network the executives, information base administration framework (DBMS) is
utilized.
The diagram given below explains the process as to how the transformation of data to
information to knowledge to action happens respectively in the DBMS −
9
Neetu Bansla DBMS 18CSC303J
• Data abstraction
• Instances and schemas.
Data abstraction
As a data in database are stored with very complex data structure so when user come and
want to access any data, he will not be able to access data if he has go through this data
structure. So to simplify the interaction of user and database, DBMS hides some
information which is not of user interest, a this is called data abstraction:- So developer
hides complexity from user and store abstract view of data.
• Physical level / internal level: this is the lowest level of data abstraction which
describes how data is actually stored in database? This level basically describes the
data structure and access path /indexing use for accessing file.
• Logical level / conceptual level: The next level of abstraction describe what data
are stored in the database and what are the relationship existed among those of
data.
• View level / external level: In this level user only interact with database and the
complexity remain unviewed. User sees data and there may be many views of one
data like chart and graph.
• 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.
10
Neetu Bansla DBMS 18CSC303J
Database architecture can be seen as a single tier or multi-tier. But logically, database
architecture is of two types like: 2-tier architecture and 3-tier architecture.
1-Tier Architecture
o In this architecture, the database is directly available to the user. It means the user
can directly sit on the DBMS and uses it.
o Any changes done here will directly be done on the database itself. It doesn't provide
a handy tool for end users.
o The 1-Tier architecture is used for development of the local application, where
programmers can directly communicate with the database for the quick response.
2-Tier Architecture
o 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. For this interaction, API's like: ODBC, JDBC are used.
o The user interfaces and application programs are run on the client-side.
o The server side is responsible to provide the functionalities like: query processing
and transaction management.
o To communicate with the DBMS, client-side application establishes a connection with
the server side.
11
Neetu Bansla DBMS 18CSC303J
3-Tier Architecture
o The 3-Tier architecture contains another layer between the client and server. In this
architecture, client can't directly communicate with the server.
o The application on the client-end interacts with an application server which further
communicates with the database system.
o 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.
o The 3-Tier architecture is used in case of large web application.
12
Neetu Bansla DBMS 18CSC303J
7. Data Independence
13
Neetu Bansla DBMS 18CSC303J
Managing data was the key and was essential. Therefore, data model originated to solve
the file system issues. Here are the Data Models in DBMS −
Hierarchical Model
• In Hierarchical Model, a hierarchical relation is formed by collection of relations
and forms a tree-like structure.
• One of the first and most popular Hierarchical Model is Information Management
System (IMS), developed by IBM.
Example: The hierarchy shows an Employee can be an Intern, on Contract or Full- Time.
Sub-levels show that Full-Time Employee can be hired as a Writer, Senior Writer or
Editor:
Advantages
• Implementation is complex.
• This model has to deal with anomalies like Insert, Update and Delete.
• Maintenance is difficult since changes done in the database may want you to do
changes in the entire database structure.
14
Neetu Bansla DBMS 18CSC303J
Network Model
• The Hierarchical Model creates hierarchical tree with parent/ child relationship,
whereas the Network Model has graph and links.
• The relationship can be defined in the form of links and it handles many-to-many
relations. It itself states that a record can have more than one parent.
Example
Advantages
• Pointers bring complexity since the records are based on pointers and graphs.
• Changes in the database are not easy, that makes it hard to achieve structural
independence.
Relational Model
• A relational model groups data into one or more tables. These tables are related to
each other using common records.
15
Neetu Bansla DBMS 18CSC303J
• The data is represented in the form of rows and columns i.e. tables:
Example
Let us see an example of two relations <Employee> and <Department> linked to each
other, with DepartmentID, which is Foreign Key of <Employee> table and Primary key
of <Department> table.
Advantages
• The Relational Model does not have any issues that we saw in the previous two
models i.e. update, insert and delete anomalies have nothing to do in this model.
• Changes in the database do not require you to affect the complete database.
• Implementation of a Relational Model is easy.
• To maintain a Relational Model is not a tiresome task.
16
Neetu Bansla DBMS 18CSC303J
Disadvantages
• Database inefficiencies hide and arise when the model has large volumes of data.
• The overheads of using relational data model come with the cost of using powerful
hardware and devices.
17
Neetu Bansla DBMS 18CSC303J
The main purpose of data abstraction is to achieve data independence in order to save time
and cost required when the database is modified or altered.
10. Database Users & Database Administrator (DBA)
Database users are categorized based up on their interaction with the data base.
These are seven types of data base users in DBMS.
Database Administrator (DBA):-
Database Administrator (DBA) is a person/team who defines the schema and also
controls the 3 levels of database. The DBA will then create a new account id and
password for the user if he/she needs to access the data base.DBA is also responsible
for providing security to the data base and he allows only the authorized users to
access/modify the data base.DBA also monitors the recovery and back up and provide
technical support. The DBA has a DBA account in the DBMS which called a system or
super user account.DBA repairs damage caused due to hardware and/or software
failures.
Naive / Parametric End Users :
Parametric End Users are the unsophisticated who don’t have any DBMS knowledge
but they frequently use the data base applications in their daily life to get the desired
results.
18
Neetu Bansla DBMS 18CSC303J
For examples, Railway’s ticket booking users are naive users. Clerk in any bank is a naive
user because they don’t have any DBMS knowledge but they still use the database and
perform their given task.
System Analyst:
System Analyst is a user who analyzes the requirements of parametric end users. They
check whether all the requirements of end users are satisfied.
Sophisticated Users:
Sophisticated users can be engineers, scientists, business analyst, who are familiar with
the database. They can develop their own data base applications according to their
requirement. They don’t write the program code but they interacts the data base by
writing SQL queries directly through the query processor.
Application Programmers:
Application Program is the back end programmers who write the code for the application
programs. They are the computer professionals. These programs could be written in
Programming languages such as Visual Basic, Developer, C, FORTRAN, COBOL etc.
19
Neetu Bansla DBMS 18CSC303J
These commands are used to update the database schema that's why they come under Data
definition language.
DML stands for Data Manipulation Language. It is used for accessing and manipulating data
in a database. It handles user requests.
20
Neetu Bansla DBMS 18CSC303J
(But in Oracle database, the execution of data control language does not have the
feature of rolling back.)
There are the following operations which have the authorization of Revoke:
TCL is used to run the changes made by the DML statement. TCL can be grouped into a logical
transaction.
21