DBMS Complete Notes by RS
DBMS Complete Notes by RS
DBMS Complete Notes by RS
(EG2201CT)
Unit 1. Introduction [8 marks]
History
1950s and early 1960s:
Data processing using magnetic tapes for storage.
Tapes provided only sequential access.
Punched cards for input.
Late 1960s and 1970s:
Hard disks allowed direct access to data.
Hierarchical and network data models in widespread use
IBM’s DL/I (Data Language One)
CODAYSL’s DBTG (Data Base Task Group) model
Ted Codd defines the relational data model.
IBM Research develops System R prototype.
UC Berkeley develops Ingres prototype.
Entity Relationship Model for database design
1980s:
Research relational prototypes evolve into commercial systems.
DB2 from IBM is the first DBMS product based on the
relational model
Oracle and Microsoft SQL Server are the most prominent
commercial DBMS products based on the relational model.
SQL becomes industrial standard
Parallel and distributed database systems
Object oriented database systems (OODBMS)
Object relational database systems allow both relational and
object views of data in the same database.
Late 1990s:
Large decision support and data mining applications
Large multi-terabyte data warehouses
Emergence of Web commerce
Early 2000s:
XML and XQuery standards
Automated database administration
Later 2000s
Web databases (semi structured data, XML, complex data types)
Cloud computing
Giant data storage systems (Google BigTable , Yahoo PNuts , Amazon
Web Services, …)
Advanced databases (mainly non-relational (e.g., graph based, text
based) but also advanced relational)
What is Database?
A database is an organized collection of data, stored and accessed
electronically. Databases are used to store and manage large amounts of
structured and unstructured data, and they can be used to support a wide
range of activities, including data storage, data analysis, and data
management.
There are many different types of databases, including relational databases,
object-oriented databases, and NoSQL databases, and they can be used in a
variety of settings, including business, scientific, and government
organizations.
Database Applications
1. Universities: student information, teacher information, non-teaching
staff information, course information, section information, grade report
information, and many more.
2. Banking: information about account holders. It stores customer details,
asset details, banking transactions, balance sheets, credit card and debit
card details, loans, fixed deposits, and much more.
3. Railway Reservation System: passenger name, mobile number,
booking status, reservation details, train schedule, employee information,
account details, seating arrangement, route & alternate route details, etc.
4. Social Media Sites: millions of accounts, which means they have a huge
amount of data that needs to be stored and maintained. Social media sites
use databases to store information about users, images, videos, chats, etc.
5. Library Management System: stores information like book name, issue
date, author name, book availability, book issuer name, book return details,
etc.
6. E-commerce Websites: customer details, product details, dealer
details, purchase details, bank & card details, transactions details, invoice
details, etc.
7. Medical: patient details, medicine details, practitioner details, surgeon
details, appointment details, doctor schedule, patient discharge details,
payment detail, invoices, and other medical records.
8. Accounting and Finance: accounting details, bank details, purchases of
stocks, invoice details, sales records, asset details, etc.
9. Industries: customer details, sales records, product lists, transactions,
etc. All the information is kept secure and maintained by the database.
10. Airline Reservation System: passenger name, passenger check-in,
passenger departure, flight schedule, number of flights, distance from source
to destination, reservation information, pilot details, accounting detail, route
detail, etc.
11. Telecommunication: customer names, phone numbers, calling details,
prepaid & post-paid connection records, network usage, bill details, balance
details, etc.
12. Manufacturing: product details, customer information, order details,
purchase details, payment info, worker's details, invoice, etc.
13. Human Resource Management: employee name, joining details,
designation, salary details, tax information, benefits & goodies details, etc.
14. Broadcasting: subscriber information, event recordings, event
schedules, etc., so it becomes important to store broadcasting data in the
database.
15. Insurance: policy details, user details, buyer details, payment details,
nominee details, address details, etc.
Characteristics
Self-describing nature of a database system:
A database system is referred to as self-describing because it not only
contains the database itself, but also metadata which defines and
describes the data and relationships between tables in the database.
This information is used by the DBMS software or database users if
needed. This separation of data and information about the data makes
a database system totally different from the traditional file-based
system in which the data definition is part of the application programs.
Insulation between program and data
In the file-based system, the structure of the data files is defined in the
application programs so if a user wants to change the structure of a
file, all the programs that access that file might need to be changed as
well.
On the other hand, in the database approach, the data structure is
stored in the system catalogue and not in the programs. Therefore, one
change is all that is needed to change the structure of a file. This
insulation between the programs and data is also called program-data
independence.
Support for multiple views of data
A database supports multiple views of data. A view is a subset of the
database, which is defined and dedicated for users of the system.
Multiple users in the system might have different views of the system.
Each view might contain only the data of interest to a user or group of
users.
Sharing of data and multiuser system
Current database systems are designed for multiple users. That is, they
allow many users to access the same database at the same time. This
access is achieved through features called concurrency control
strategies. These strategies ensure that the data accessed is always
correct and that data integrity is maintained.
The design of modern multiuser database systems is a great
improvement from those in the past which restricted usage to one
person at a time.
Control of data redundancy
In the database approach, ideally, each data item is stored in only one
place in the database. In some cases, data redundancy still exists to
improve system performance, but such redundancy is controlled by
application programming and kept to minimum by introducing as little
redundancy as possible when designing the database.
Data sharing
The integration of all the data, for an organization, within a database
system has many advantages. First, it allows for data sharing among
employees and others who have access to the system. Second, it gives
users the ability to generate more information from a given amount of
data than would be possible without the integration.
Enforcement of integrity constraints
Database management systems must provide the ability to define and
enforce certain constraints to ensure that users enter valid information
and maintain data integrity. A database constraint is a restriction or
rule that dictates what can be entered or edited in a table such as a
postal code using a certain format or adding a valid city in the City
field.
There are many types of database constraints. Data type, for example,
determines the sort of data permitted in a field, for example numbers
only. Data uniqueness such as the primary key ensures that no
duplicates are entered. Constraints can be simple (field based) or
complex (programming).
Restriction of unauthorized access
Not all users of a database system will have the same accessing
privileges. For example, one user might have read-only access (i.e., the
ability to read a file but not make changes), while another might have
read and write privileges, which is the ability to both read and modify a
file. For this reason, a database management system should provide a
security subsystem to create and control different types of user
accounts and restrict unauthorized access.
Data independence
Another advantage of a database management system is how it allows
for data independence. In other words, the system data descriptions or
data describing data (metadata) are separated from the application
programs. This is possible because changes to the data structure are
handled by the database management system and are not embedded
in the program itself.
Transaction processing
A database management system must include concurrency control
subsystems. This feature ensures that data remains consistent and
valid during transaction processing even if several users update the
same information.
Provision for multiple views of data
By its very nature, a DBMS permits many users to have access to its
database either individually or simultaneously. It is not important for
users to be aware of how and where the data they access is stored.
Backup and recovery facilities
Backup and recovery are methods that allow you to protect your data
from loss. The database system provides a separate process, from
that of a network backup, for backing up and recovering data. If a hard
drive fails and the database stored on the hard drive is not accessible,
the only way to recover the database is from a backup.
If a computer system fails in the middle of a complex update process,
the recovery subsystem is responsible for making sure that the
database is restored to its original state. These are two more benefits
of a database management system.
Architecture
The DBMS design depends upon its architecture. The basic
client/server architecture is used to deal with many 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.
Types:
1. 1-Tier
The database is directly available to the user. It means the user can
directly sit on the DBMS and use it.
Any changes done here will directly be done on the database itself. It
doesn't provide a handy tool for end users.
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. 2-Tier
The 2-Tier architecture is the 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.
The user interfaces and application programs are run on the client-
side.
The server side is responsible for providing the functionalities like
query processing and transaction management.
To communicate with the DBMS, client-side application establishes a
connection with the server side.
3. 3-Tier
The 3-Tier architecture contains another layer between the client and
server. In this architecture, the client can't directly communicate with
the server.
The application on the client-end interacts with an application server
which further communicates with the database system.
The 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.
The 3-Tier architecture is used in the case of large web applications.
Classifications of DBMS