Unit-1 DBMS English
Unit-1 DBMS English
Database Management System (DBMS) is software for storing and retrieving users’ data
while considering appropriate security measures. It consists of a group of programs that
manipulate the database. The DBMS accepts the request for data from an application and
instructs the operating system to provide the specific data. In large systems, a DBMS helps
users and other third-party software store and retrieve data.
DBMS allows users to create their own databases as per their requirements. The term
“DBMS” includes the user of the database and other application programs. It provides an
interface between the data and the software application.
Example of a DBMS
Let us see a simple example of a university database. This database is maintaining
information concerning students, courses, and grades in a university environment. The
database is organized as five files:
To define DBMS:
We need to specify the structure of the records of each file by defining the different
types of data elements to be stored in each record.
We can also use a coding scheme to represent the values of a data item.
Basically, your Database will have 5 tables with a foreign key defined amongst the
various tables.
History of DBMS
Here, are the important landmarks from the history of DBMS:
Characteristics of DBMS
Here are the characteristics and properties of a Database Management System:
Information:
Information is the processed data on which decisions and actions are based. Information
can be defined as the organized and classified data to provide meaningful values. Eg: “The
age of Ravi is 25”
File Oriented Approach: The traditional file oriented approach to information processing
each application has a separate master file and its own set of personal file. In file oriented
approach the program dependent on the files and files dependent upon the programs.
2) Difficulty in accessing data : The conventional file processing system do not allow data to
be retrieved in a convenient and efficient manner according to user choice.
3) Data isolation: Because data are scattered in various files and files may be in different
formats with new application programs to retrieve the appropriate data is difficult.
Meghraj Soni Class-BSc-IV Sem (CS)
4) Integrity Problems: Developers enforce data validation in the system by adding
appropriate code in the various application program. However when new constraints are
added, it is difficult to change the programs to enforce them.
6) Concurrent access: In the file processing system it is not possible to access the same file
for transaction at same the time.
7) Security problems: There is no security provided in file processing system to secure the
data from unauthorized user access.
MySQL
Microsoft Access
Oracle
PostgreSQL
dBASE
FoxPro
SQLite
IBM DB2
LibreOffice Base
MariaDB
Microsoft SQL Server
Data Independence
o Logical data independence refers characteristic of being able to change the conceptual
schema without having to change the external schema.
o Physical data independence can be defined as the capacity to change the internal
schema without having to change the conceptual schema.
o If we do any changes in the storage size of the database system server, then the
Conceptual structure of the database will not be affected.
o Physical data independence is used to separate conceptual levels from the internal
levels.
o Physical data independence occurs at the logical interface level.
Users of DBMS
Following are the various category of users of DBMS
A Database stores a lot of critical information to access data quickly and securely. Hence it is
important to select the correct architecture for efficient data management. DBMS
Architecture helps users to get their requests done while connecting to the database. We
choose database architecture depending on several factors like the size of the database,
number of users, and relationships between the users. There are two types of database
models that we generally use, logical model and physical model. Several types of architecture
are there in the database which we will deal with in the next section.
Types of DBMS Architecture
There are several types of DBMS Architecture that we use according to the usage
requirements. Types of DBMS Architecture are discussed here.
1-Tier Architecture
2-Tier Architecture
3-Tier Architecture
1-Tier Architecture
In 1-Tier Architecture the database is directly available to the user, the user can directly sit
on the DBMS and use it that is, the client, server, and Database are all present on the same
machine. For Example: to learn SQL we set up an SQL server and the database on the local
system. This enables us to directly interact with the relational database and execute
operations. The industry won’t use this architecture they logically go for 2-tier and 3-tier
Architecture.
1. External level
It is also called view level. The reason this level is called “view” is because several users
can view their desired data from this level which is internally fetched from database with
the help of conceptual and internal level mapping.
The user doesn’t need to know the database schema details such as data structure, table
definition etc. user is only concerned about data which is what returned back to the view
level after it has been fetched from database (present at the internal level).
External level is the “top level” of the Three Level DBMS Architecture.
2. Conceptual level
It is also called logical level. The whole design of the database such as relationship
among data, schema of data etc. are described in this level.
3. Internal level
This level is also known as physical level. This level describes how the data is actually
stored in the storage devices. This level is also responsible for allocating space to the data.
This is the lowest level of the architecture.
1. Query Processor: It interprets the requests (queries) received from end user via an
application program into instructions. It also executes the user request which is received
from the DML compiler.
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).
Embedded DML Pre-compiler: It processes DML statements embedded in an application
program into procedural calls.
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 executing the DCL statements. It is responsible for updating, storing,
Integrity Manager: It checks the integrity constraints when the database is modified.
File Manager: It manages the file space and the data structure used to represent
information in the database.
Buffer Manager: It is responsible for cache memory and the transfer of data between
the secondary storage and main memory.
Data Dictionary: It contains the information about the structure of any database object.
It is the repository of information that governs the metadata (data about data).
The data dictionary does not contain the actual data of the database, rather it only stores
information (such as table names and descriptions, etc.) in the form of ledgers to manage
the data.
Without data dictionary, dbms cannot access data from the database.
Data dictionary is also called metadata and the data that provides information about the
data is called metadata.
Data dictionary is used to control database operations, data integrity and accuracy.
1:-Active data dictionary:-The data dictionary which is automatically updated by the DBMS
all the time is called Active data dictionary.
In Activate data dictionary, database and data dictionary are together, that is, data
dictionary is created in the data base.
If we have to delete or rename some data, we can do it easily in the data dictionary through
DDL (Data Definition Language), but if we have to insert or modify something, it is updated
by the database itself. That means there is no mismatch of any kind between the data
dictionary and the database. This type of data dictionary is called Active data dictionary.
2:-Passive data dictionary:-Passive data dictionary is also similar to active data dictionary
but in this it is not automatically updated by DBMS.
In passive data dictionary there is no match between data dictionary and database. In some
databases, the data dictionary is made a separate database. Which only stores the
information of data dictionary. If we delete or insert something in the data dictionary, it
remains limited to the data dictionary only, it does not have any effect on the main
database. This type of data dictionary is called Passive data dictionary.
Database Language
Meghraj Soni Class-BSc-IV Sem (CS)
• To communicate with the database.
The language used to read, update, and store data in the database is called database
language.
In DBMS, database languages are used to create, delete and manage the database.
Types of Database Languages
Database languages are basically as follows.
1) DDL Data Definition Language
2) DML Data Manipulation Language
3) DCL Data Control Language
4) TCL Transaction Control Language
1- DDL
• Full name of DDL is Data Definition Language. It is used to define the structure of the
database.
• DDL is used to create schema, index, and constraints etc. in the database.
• Apart from this, DDL is also used to store metadata information.
DDL commands
1. CREATE – It is used to create objects in the database.
2. ALTER – It is used to make changes in the structure of the database.
3. TRUNCATE – It is used to remove the data present in the table.
4. DROP – It is used to delete the objects present in the database.
5. COMMENT – It is used to comment in the data dictionary.
6. RENAME – It is used to change the name of the object.
2- DML
• The full name of DML is Data Manipulation Language.
• DML is used to access and manipulate data in the database.
• It handles user requests.
DML commands
1. SELECT – It is used to retrieve or fetch data from the database.
2. INSERT – It is used to insert data in the table.
3. UPDATE – It is used to update the existing data in the table.
4. DELETE – It is used to delete all the records from the table.
5. CALL – It is used to call SQL function and java subprogram. ,
6. LOCK TABLE – It is used to control concurrency.
7. MERGE – This command is made up of INSERT, DELETE, and UPDATE commands.
Therefore it can do all three tasks insert, delete and update.
3- DCL
• Full name of DCL is Data Control Language. It is used to access stored data.
• DCL is used to control user privileges.
• It is mostly used to provide and take away access to the database to the user.
DCL commands
1. GRANT – It is used to provide access to the database to the user.
Meghraj Soni Class-BSc-IV Sem (CS)
2. REVOKE – REVOKE command is used to withdraw the privilege or access given by GRANT
command.
4- TCL
• The full name of TCL is Transaction Control Language.
• TCL is used to manage transactions in the database.
TCL commands
1. Rollback- It is used to restore the old database.
2. Savepoint- This command sets a save point within a transaction.
3. Commit – It is used to save the transaction in the database.
Data Model
Data models in DBMS help to understand the design at the conceptual, physical, and logical
levels as it provides a clear picture of the data making it easier for developers to create a
physical database.
Data models are used to describe how the data is stored, accessed, and updated in a DBMS.
A set of symbols and text is used to represent them so that all the members of an
organization can understand how the data is organized. It provides a set of conceptual tools
that are vastly used to represent the description of data.
1. Hierarchical Model
2. Network Model
3. Entity-relationship Model
4. Relational Model
5. Object-oriented Model
6. NoSQL Model
7. Graph Model
1. Hierarchical Model
The hierarchical database model organizes data into a tree-like structure, with
a single root, to which all the other data is linked.
The hierarchy starts from the Root data, and expands like a tree, adding child nodes
to the parent nodes.
In this model, a child node will only have a single parent node.
This model efficiently describes many real-world relationships like the index of a
book, etc.
IBM's Information Management System (IMS) is based on this model.
Data is organized into a tree-like structure with a one-to-many relationship between
two different types of data, for example, one department can have many courses,
many teachers, and of course many students(like shown in the diagram below).
Here are a few points to mark the advantages and disadvantages of the Hierarchical
database model:
2. Network Model
3. Entity-relationship Model
4. Relational Model
5. Object-oriented Model
6. NoSQL Model
7. Graph Model