DBMS Part 1
DBMS Part 1
DBMS Part 1
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.
o Database management system is a software which is used to manage the database. For
example: MySQL, Oracle, etc are a very popular commercial database which is used in
different applications.
o DBMS provides an interface to perform various operations like database creation,
storing data in it, updating data, creating a table in the database and a lot more.
o It provides protection and security to the database. In the case of multiple users, it also
maintains data consistency.
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, maintain 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.
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
Disadvantages of DBMS
o Cost of Hardware and Software: It requires a high speed of data processor and large
memory size to run DBMS software.
o Size: It occupies a large space of disks and large memory to run them efficiently.
o Complexity: Database system creates additional complexity and requirements.
o Higher impact of failure: Failure is highly impacted the database because in most of
the organization, all the data stored in a single database and if the database is damaged
due to electric failure or database corruption then the data may be lost forever.
File System: A File Management system is a DBMS that allows access to single files or
tables at a time. In a File System, data is directly stored in a set of files. It contains flat files
that have no relation to other files (when only one table is stored in a single file, then this file
is known as a flat file).
DBMS: A Database Management System (DBMS) is application software that allows users
to efficiently define, create, maintain and share databases. Defining a database involves
specifying the data types, structures and constraints of the data to be stored in the database.
Creating a database involves storing the data on some storage medium that is controlled by
DBMS. Maintaining a database involves updating the database whenever required to evolve
and reflect changes in the Mini world and also generating reports for each change. Sharing a
database involves allowing multiple users to access the database. DBMS also serves as an
interface between the database and end users or application programs. It provides control
access to the data and ensures that data is consistent and correct by defining rules on them.
An application program accesses the database by sending queries or requests for data to the
DBMS. A query causes some data to be retrieved from the database.
Logical: This level comprises the information that is actually stored in the database in the
form of tables. It also stores the relationship among the data entities in relatively simple
structures. At this level, the information available to the user at the view level is unknown.
We can store the various attributes of an employee and relationships, e.g. with the manager
can also be stored.
View: This is the highest level of abstraction. Only a part of the actual database is viewed
by the users. This level exists to ease the accessibility of the database by an individual user.
Users view data in the form of rows and columns. Tables and relations are used to store
data. Multiple views of the same database may exist. Users can just view the data and
interact with the database, storage and implementation details are hidden from them.
Data Independence
Data Independence is mainly defined as a property of DBMS that helps you to change the
database schema at one level of a system without requiring to change the schema at the next
level. it helps to keep the data separated from all program that makes use of it.
We have namely two levels of data independence arising from these levels of abstraction:
Physical level data independence: It refers to the characteristic of being able to modify the
physical schema without any alterations to the conceptual or logical schema, done for
optimization purposes, e.g., the Conceptual structure of the database would not be affected
by any change in storage size of the database system server. Changing from sequential to
random access files is one such example. These alterations or modifications to the physical
structure may include:
Logical level data independence: It refers characteristic of being able to modify the logical
schema without affecting the external schema or application program. The user view of the
data would not be affected by any changes to the conceptual view of the data. These changes
may include insertion or deletion of attributes, altering table structures entities or
relationships to the logical schema, etc.
Database Languages
o A DBMS has appropriate languages and interfaces to express database queries and
updates.
o Database languages can be used to read, store and update the data in the database.
o DDL stands for Data Definition Language. It is used to define database structure or
pattern.
o It is used to create schema, tables, indexes, constraints, etc. in the database.
o Using the DDL statements, you can create the skeleton of the database.
o Data definition language is used to store the information of metadata like the number
of tables and schemas, their names, indexes, columns in each table, constraints, etc.
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.
o DCL stands for Data Control Language. It is used to retrieve the stored or saved data.
o The DCL execution is transactional. It also has rollback parameters.
(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.