DBMS Notes
DBMS Notes
1. Data modeling: A DBMS provides tools for creating and modifying data models,
which define the structure and relationships of the data in a database.
2. Data storage and retrieval: A DBMS is responsible for storing and retrieving data
from the database, and can provide various methods for searching and querying
the data.
3. Concurrency control: A DBMS provides mechanisms for controlling concurrent
access to the database, to ensure that multiple users can access the data without
conflicting with each other.
4. Data integrity and security: A DBMS provides tools for enforcing data integrity
and security constraints, such as constraints on the values of data and access
controls that restrict who can access the data.
5. Backup and recovery: A DBMS provides mechanisms for backing up and
recovering the data in the event of a system failure.
6. DBMS can be classified into two types: Relational Database Management System
(RDBMS) and Non-Relational Database Management System (NoSQL or Non-
SQL)
7. RDBMS: Data is organized in the form of tables and each table has a set of rows
and columns. The data is related to each other through primary and foreign keys.
8. NoSQL: Data is organized in the form of key-value pairs, document, graph, or
column-based. These are designed to handle large-scale, high-performance
scenarios.
Database is a collection of interrelated data which helps in the efficient retrieval, insertion,
and deletion of data from the database and organizes the data in the form of tables, views,
schemas, reports, etc. For Example, a university database organizes the data about
students, faculty, admin staff, etc. which helps in the efficient retrieval, insertion, and
deletion of data from it.
File based systems were an early attempt to computerize the manual system. It is also called
a traditional based approach in which a decentralized approach was taken where each
department stored and controlled its own data with the help of a data processing specialist.
The main role of a data processing specialist was to create the necessary computer file
structures, and also manage the data within structures and design some application programs
that create reports based on file data.
DBMS:
DBMS Architecture
o The DBMS design depends upon its architecture. The basic client/server architecture
is used to deal with a large number of PCs, web servers, database servers and other
components that are connected with networks.
o The client/server architecture consists of many PCs and a workstation which are
connected via the network.
o DBMS architecture depends upon how users are connected to the database to get
their request done.
1-Tier Architecture
o In this architecture, the database is directly available to the user. It means the user
can directly sit on the DBMS and uses it.
o Any changes done here will directly be done on the database itself. It doesn't provide
a handy tool for end users.
o 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-Tier Architecture
o The 2-Tier architecture is 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.
o The user interfaces and application programs are run on the client-side.
o The server side is responsible to provide the functionalities like: query processing and
transaction management.
o To communicate with the DBMS, client-side application establishes a connection with
the server side.
Fig: 2-tier Architecture
3-Tier Architecture
o The 3-Tier architecture contains another layer between the client and server. In this
architecture, client can't directly communicate with the server.
o The application on the client-end interacts with an application server which further
communicates with the database system.
o 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.
o The 3-Tier architecture is used in case of large web application.
Data Independence is defined as a property of DBMS that helps you to change the Database
schema at one level of a database system without requiring to change the schema at the next
higher level. Data independence helps you to keep data separated from all programs that
make use of it.
You can use this stored data for computing and presentation. In many systems, data
independence is an essential function for components of the system.
Levels of Database
1. Physical/Internal
2. Conceptual
3. External
Physical data Independence
Physical data independence helps you to separate conceptual levels from the
internal/physical levels. It allows you to provide a logical description of the database without
the need to specify physical structures. Compared to Logical Independence, it is easy to
achieve physical data independence.
With Physical independence, you can easily change the physical storage structures or devices
with an effect on the conceptual schema. Any change done would be absorbed by the
mapping between the conceptual and internal levels. Physical data independence is achieved
by the presence of the internal level of the database and then the transformation from the
conceptual level of the database to the internal level.
Due to Physical independence, any of the below change will not affect the conceptual layer.
Logical Data Independence is the ability to change the conceptual scheme without changing
1. External views
2. External API or programs
Any change made will be absorbed by the mapping between external and conceptual levels.
Data Models
Data Model is the modeling of the data description, data semantics, and consistency
constraints of the data. It provides the conceptual tools for describing the design of a
database at each level of data abstraction. Therefore, there are following four data models
used for understanding the structure of the database:
1) Relational Data Model: This type of model designs the data in the form of rows and
columns within a table. Thus, a relational model uses tables for representing data and in-
between relationships. Tables are also called relations. This model was initially described by
Edgar F. Codd, in 1969. The relational data model is the widely used model which is primarily
used by commercial data processing applications.
Instances
An Instance is the state of an operational database with data at any given time. It contains
a snapshot of the database. The instances can be changed by certain CRUD operations, such
as like addition, and deletion of data. It may be noted that any search query will not make
any kind of changes in the instances.
Example:
Let’s say a table teacher in our database whose name is School, suppose the table has 50
records so the instance of the database has 50 records for now and tomorrow we are going
to add another fifty records so tomorrow the instance has a total of 100 records. This is
called an instance.
Schema
Schema is the overall description of the database. The basic structure of how the data will
be stored in the database is called schema.
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.
1. Data Definition Language
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.
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.
The earliest and most fundamental form of DBMS interface is the command-line interface
(CLI). Through the use of a command prompt, users may communicate with the database by
inputting commands. Users can only access and modify the database using particular
commands and syntax. Today, programmers and database administrators are the main users
of CLI.
Graphical User Interface (GUI)
The most prevalent kind of DBMS interface used nowadays is the graphical user interface
(GUI). Users may interact with the database using the user-friendly interface's graphical
menus and icons. GUIs are user-friendly and need little to no programming experience. They
are mostly utilized by non-programmers who are end users.
Web-Based Interface
Users can access the database using a browser using the web-based interface. Users can use
online forms, buttons, and other graphical components to interact with the database using a
web browser. Because they can be accessed from any location with an internet connection,
web-based interfaces are common.
This interface enables users to communicate with the database in their own language. The
system will convert user inquiries into SQL instructions and carry them out if they are entered
in plain English. Users who are unfamiliar with SQL commands might benefit from using
natural language interfaces.
Forms-Based Interface
Using the forms-based interface, users may enter data into the database using a graphical
user interface. Users can complete pre-made forms that provide fields for particular
categories of information, such as name, address, and phone number. Applications for data
entry frequently employ forms-based interfaces.
Menu-Based Interface
Users have access to a number of predefined menus and choices when using the menu-based
interface to interact with the database. Users can choose the menu choice that reflects the
intended action, such as adding or removing data, from the available options. The majority of
specialized applications and embedded systems employ menu-based interfaces.
Users can interact with the database thanks in large part to DBMS interfaces. The user's
technical proficiency, the nature of the program, and the target market all influence the
interface choice. The user experience and database usability may both be improved by
selecting the correct interface.