DBMS Class1
DBMS Class1
Banking System: For storing customer info, tracking day to day credit and debit
transactions, generating bank statements etc. All this work has been done with the
help of Database management systems.
Sales: To store customer information, production information and invoice details.
Education sector: Database systems are frequently used in schools and colleges
to store and retrieve the data regarding student details, staff details, course
details, exam details, payroll data, attendance details, fees details etc. There is a
hell lot amount of inter-related data that needs to be stored and retrieved in an
efficient manner.
Online shopping: You must be aware of the online shopping websites such as
Amazon, Flipkart etc. These sites store the product information, your addresses
and preferences, credit details and provide you the relevant list of products based
on your query. All this involves a Database management system.
What is the purpose of Database Management System?
For example: Lets say Steve transfers 100$ to Negan’s account. This
transaction consists multiple operations such as debit 100$ from Steve’s
account, credit 100$ to Negan’s account. Like any other device, a computer
system can fail lets say it fails after first operation then in that case Steve’s
account would have been debited by 100$ but the amount was not credited
to Negan’s account, in such case the rollback of operation should occur to
maintain the atomicity of transaction. It is difficult to achieve atomicity
in file processing systems.
1. Data Abstraction
2. Data Independence
Data abstraction is hiding the complex data structure in order to simplify the
user’s interface of the system. It is done because many of the users interacting
with the database system are not that much computer trained to understand
the complex data structures of the database system.
Three-Schema Architecture:
The physical or the internal level schema describes how the data is stored in
the hardware. It also describes how the data can be accessed. The physical
level shows the data abstraction at the lowest level and it has complex data
structures. Only the database administrator operates at this level.
It is a level above the physical level. Here, the data is stored in the form of
the entity set, entities, their data types, the relationship among the entity
sets, user operations performed to retrieve or modify the data and
certain constraints on the data. Well adding constraints to the view of data
adds the security. As users are restricted to access some particular parts of the
database.
It is the highest level of data abstraction and exhibits only a part of the whole
database. It exhibits the data in which the user is interested. The view level can
describe many views of the same data. Here, the user retrieves the information
using different application from the database.
In the figure above you can clearly distinguish between the three levels of
abstraction.
Example:
Now, the entity sets Student, Lecturer, Department, Course will be stored in
the storage as the consecutive blocks of the memory location. This is
the physical or internal level and is hidden from the programmers but the
database administrator is it aware of it.
The Data Definition Language is used for specifying the database schema, and
the Data Manipulation Language is used for both reading and updating the
database. These languages are called data sub-languages as they do not
include constructs for all computational requirements.
Data Definition Language (DDL) statements are used to classify the database
structure or schema. It is a type of language that allows the DBA or user to
depict and name those entities, attributes, and relationships that are required
for the application along with any associated integrity and security constraints.
Here are the lists of tasks that come under DDL:
There are two other forms of database sub-languages. The Data Control
Language (DCL) is used to control privilege in Databases. To perform any
operation in the database, such as for creating tables, sequences, or views, we
need privileges.
Transaction Control statements are used to run the changes made by DML
statements. It allows statements to be grouped into logical transactions.
The table name and column names are helpful to interpret the meaning of
values in each row. The data are represented as a set of relations. In the
relational model, data are stored as tables. However, the physical storage of
the data is independent of the way the data are logically organized.
2. Tables – In the Relational model the, relations are saved in the table
format. It is stored along with its entities. A table has two properties rows
and columns. Rows represent records and columns represent attributes.
1. Query Processor :
It interprets the requests (queries) received from end user via an application
program into instructions.Query Processor contains the following components
–
DML Compiler –
It processes the DML statements into low level instruction (machine
language), so that they can be executed.
DDL Interpreter –
It processes the DDL statements into a set of table containing meta data
(data about data).
Query Optimizer –
It executes the instruction generated by DML Compiler.
2. Storage Manager :
Storage Manager is a program that provides an interface between the data
stored in the database and the queries received. It is also known as Database
Control System. It maintains the consistency and integrity of the database by
applying the constraints and executes the DCL statements. It is responsible for
updating, storing, deleting, and retrieving data in the database.
It contains the following components –
Authorization Manager –
It ensures role-based access control, i.e,. checks whether the particular
person is privileged to perform the requested operation or not.
Integrity Manager –
It checks the integrity constraints when the database is modified.
Transaction Manager –
It controls concurrent access by performing the operations in a
scheduled way that it receives the transaction. Thus, it ensures that the
database remains in the consistent state before and after the execution
of a transaction.
What is a Database Transaction?
A Database Transaction is a logical unit of processing in a DBMS which
entails one or more database access operation. In a nutshell, database
transactions represent real-world events of any enterprise.
All types of database access operation which are held between the beginning
and end transaction statements are considered as a single logical transaction
in DBMS. During the transaction the database is inconsistent. Only once the
database is committed the state is changed from one consistent state to
another.
States of Transactions