0% found this document useful (0 votes)
54 views15 pages

DBMS Class1

Database management systems (DBMS) are used in many applications to store and manage large amounts of data. Some key applications of DBMS include telecoms to track call and network usage data, manufacturing and distribution to manage inventory records, banking to process transactions and generate statements, sales to store customer and invoice details, airlines for flight and reservation information, and education to maintain student, staff, course, and other academic data. The DBMS allows efficient storage, retrieval, and updating of large, complex, and interrelated datasets for these and other applications.

Uploaded by

sangeetha sheela
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views15 pages

DBMS Class1

Database management systems (DBMS) are used in many applications to store and manage large amounts of data. Some key applications of DBMS include telecoms to track call and network usage data, manufacturing and distribution to manage inventory records, banking to process transactions and generate statements, sales to store customer and invoice details, airlines for flight and reservation information, and education to maintain student, staff, course, and other academic data. The DBMS allows efficient storage, retrieval, and updating of large, complex, and interrelated datasets for these and other applications.

Uploaded by

sangeetha sheela
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Database Applications – DBMS

Applications where we use Database Management Systems are:

 Telecom: There is a database to keeps track of the information regarding calls


made, network usage, customer details etc. Without the database systems it is
hard to maintain that huge amount of data that keeps updating every millisecond.

 Industry: Where it is a manufacturing unit, warehouse or distribution centre,


each one needs a database to keep the records of ins and outs. For example
distribution centre should keep a track of the product units that supplied into the
centre as well as the products that got delivered out from the distribution centre
on each day; this is where DBMS comes into picture.

 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.

 Airlines: To travel though airlines, we make early reservations, this reservation


information along with flight schedule is stored in database.

 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?

The Database Management System (DBMS) is defined as a software system


that allows the user to define, create and maintain the database and provide
control access to the data.
It is a collection of programs used for managing data and simultaneously it
supports different types of users to create, manage, retrieve, update and store
information.
Purpose
The purpose of DBMS is to transform the following −
 Data into information.
 Information into knowledge.
 Knowledge to the action.
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 −
Drawbacks of File system

 Data redundancy: Data redundancy refers to the duplication of data, lets


say we are managing the data of a college where a student is enrolled for
two courses, the same student details in such case will be stored twice,
which will take more storage than needed. Data redundancy often leads to
higher storage costs and poor access time.
 Data inconsistency: Data redundancy leads to data inconsistency, lets
take the same example that we have taken above, a student is enrolled for
two courses and we have student address stored twice, now lets say student
requests to change his address, if the address is changed at one place and
not on all the records then this can lead to data inconsistency.
 Data Isolation: Because data are scattered in various files, and files may be
in different formats, writing new application programs to retrieve the
appropriate data is difficult.
 Dependency on application programs: Changing files would lead to
change in application programs.
 Atomicity issues: Atomicity of a transaction refers to “All or nothing”,
which means either all the operations in a transaction executes or none.

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.

 Data Security: Data should be secured from unauthorised access, for


example a student in a college should not be able to see the payroll details
of the teachers, such kind of security constraints are difficult to apply in file
processing systems.

Advantage of DBMS over file system


There are several advantages of Database management system over file system.
Few of them are as follows:

 No redundant data: Redundancy removed by data normalization. No data


duplication saves storage and improves access time.
 Data Consistency and Integrity: As we discussed earlier the root cause of
data inconsistency is data redundancy, since data normalization takes care
of the data redundancy, data inconsistency also been taken care of as part
of it
 Data Security: It is easier to apply access constraints in database systems
so that only authorized user is able to access the data. Each user has a
different set of access thus data is secured from the issues such as identity
theft, data leaks and misuse of data.
 Privacy: Limited access means privacy of data.
 Easy access to data – Database systems manages data in such a way so
that the data is easily accessible with fast response times.
 Easy recovery: Since database systems keeps the backup of data, it is
easier to do a full recovery of data in case of a failure.
 Flexible: Database systems are more flexible than file processing systems.
View of Data in DBMS
View of data in DBMS narrate how the data is visualized at each level of data
abstraction? Data abstraction allow developers to keep complex data
structures away from the users. The developers achieve this by hiding the
complex data structures through levels of abstraction.

Content: View of Data in DBMS

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.

To achieve data abstraction, we will discuss a Three-Schema


architecture which abstracts the database at three levels discussed below:

 Three-Schema Architecture:

The main objective of this architecture is to have an effective separation


between the user interface and the physical database. So, the user never has to
be concerned regarding the internal storage of the database and it has a
simplified interaction with the database system.

The three-schema architecture defines the view of data at three levels:

1. Physical level (internal level)


2. Logical level (conceptual level)
3. View level (external level)

1. Physical Level/ Internal Level

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.

2. Logical Level/ Conceptual 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 developer and database administrator who operates at the logical or


the conceptual level.

3. View Level/ User level/ External level 

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.

The figure below describes the three-schema architecture of the database:

In the figure above you can clearly distinguish between the three levels of
abstraction.
Example:

We have to create a database of a college. Now, what entity sets would be


involved? Student, Lecturer, Department, Course and so on…

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.

At the logical level, the programmers define the entity sets and relationship


among these entity sets using a programming language like SQL. So, the
programmers work at the logical level and even the database administrator also
operates at this level.

At the view level, the users have the set of applications which they use to


retrieve the data they are interested in.
A data sublanguage mainly has two parts:

 Data Definition Language (DDL) and

 Data Manipulation Language (DML).

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

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:

 CREATE - used to create objects in the database

 ALTER - used to alters the structure of the database

 DROP - used to delete objects from the database

 TRUNCATE - used to remove all records from a table, including all


spaces allocated for the records are removed

 COMMENT - used to add comments to the data dictionary

 RENAME - used to rename an object

Data Manipulation Language

A language that offers a set of operations to support the fundamental data


manipulation operations on the data held in the database. Data Manipulation
Language (DML) statements are used to manage data within schema objects.
Here are the lists of tasks that come under DML:

 SELECT - It retrieves data from a database

 INSERT - It inserts data into a table

 UPDATE - It updates existing data within a table


 DELETE - It deletes all records from a table, the space for the records
remain

Data Control Language

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.

 Grant - It gives user access privileges to a database.

 Revoke - It takes back permissions from the user.

Transaction Control Language (TCL)

Transaction Control statements are used to run the changes made by DML
statements. It allows statements to be grouped into logical transactions.

 COMMIT - It saves the work done

 SAVEPOINT - It identifies a point in a transaction to which you can later


roll back

 ROLLBACK - It restores the database to original since the last COMMIT

 SET TRANSACTION - It changes the transaction options like isolation


level and what rollback segment to use
What is Relational Model?

Relational Model (RM) represents the database as a collection of relations. A


relation is nothing but a table of values. Every row in the table represents a
collection of related data values. These rows in the table denote a real-world
entity or relationship.

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.

Some popular Relational Database management systems are:

 DB2 and Informix Dynamic Server – IBM

 Oracle and RDB – Oracle

 SQL Server and Access – Microsoft

Relational Model Concepts in DBMS

1. Attribute: Each column in a Table. Attributes are the properties which


define a relation. e.g., Student_Rollno, NAME,etc.

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.

3. Tuple – It is nothing but a single row of a table, which contains a single


record.

4. Relation Schema: A relation schema represents the name of the relation


with its attributes.

5. Degree: The total number of attributes which in the relation is called the


degree of the relation.

6. Cardinality: Total number of rows present in the Table.

7. Column: The column represents the set of values for a specific attribute.

8. Relation instance – Relation instance is a finite set of tuples in the


RDBMS system. Relation instances never have duplicate tuples.
9. Relation key – Every row has one, two or multiple attributes, which is
called relation key.

10. Attribute domain – Every attribute has some pre-defined value


and scope which is known as attribute domain
Data storage and Querying

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

The various states of a transaction concept in DBMS are listed below:

State Transaction types

A transaction enters into an active state when the


Active State execution process begins. During this state read or
write operations can be performed.
Partially A transaction goes into the partially committed state
Committed after the end of a transaction.

When the transaction is committed to state, it has


Committed already completed its execution successfully.
State Moreover, all of its changes are recorded to the
database permanently.

A transaction considers failed when any one of the


Failed State checks fails or if the transaction is aborted while it is
in the active state.

State of transaction reaches terminated state when


Terminated
certain transactions which are leaving the system
State
can’t be restarted.

Fig. State Transition Diagram for a Database Transaction

You might also like