DBMS-Module 1
DBMS-Module 1
System)
What is Database?
Data refers to raw, unorganized facts and figures, such as numbers, text, images, or
symbols, that can be processed and analyzed to extract meaningful information
● The DBMS handles tasks like querying, updating, deleting and managing
access permissions, without requiring users to know the physical details of
where data is stored.
● When a user submits a request (such as a search or update), the DBMS
processes the query, locates the relevant data, and returns results in a
structured format.
● DBMSs provide features like backup, recovery, performance optimization
and data security to ensure the system runs efficiently and reliably.
Databases consist of several critical components that work together to store, organize
and retrieve data effectively. Here is a detailed explanation of each component:
● Data: The actual information stored in the database, such as text, numbers,
images, or files.
● Schema: The structural blueprint that defines how data is
organized—tables, fields, data types, and relationships.
● DBMS: The software that manages database operations like storage,
retrieval, and security (e.g., MySQL, Oracle).
● Queries: Instructions (usually SQL) used to retrieve or manipulate data
within the database.
● Users: People or systems that interact with the database, each with specific
roles and access permissions.
Types of Databases
Databases can be classified into two primary types Relational (SQL) and NoSQL
Databases. NoSQL is then further divided into four types: Document-oriented,
Key-Value, Wide-Column, and Graph databases.
1. Relational Databases (RDBMS)
Relational databases organize data into tables made up of rows (records) and columns
(fields). They use schemas (blueprints) to define how data is structured and how
different tables relate to each other.
2. NoSQL Databases
"NoSQL" stands for "Not Only SQL". These databases are designed to handle
unstructured or semi-structured data, such as text, images, videos or sensor data. They
don’t rely on the traditional table format.
ACID Properties
ACID stands for Atomicity, Consistency, Isolation, and Durability—four essential
principles that ensure your database transactions are reliable, accurate, and secure.
Databases are essential part of our life. There are several everyday activities that
involve our interaction with databases.
DBMS acts as a bridge between a central database and multiple clients-including apps
and users. It uses APIs to handle data requests, enabling apps and users to interact
with the database securely and efficiently without directly accessing the data.
A university file-based system storing data in separate files (e.g., Academics, Results,
Hostels) often faced these problems.
Any DBMS based applications is made up of six key components that work together
to handle data effectively.
Components of DBMS Applications
1. Hardware
2. Software
4. Procedures
● Used to interact with the database (create, read, update, delete data).
● Examples: SQL, MyAccess, Oracle PL/SQL.
● DDL (Data Definition Language) – CREATE, ALTER, DROP
● DML (Data Manipulation Language) – INSERT, UPDATE, DELETE
6. People
Types of DBMS
There are several types of Database Management Systems (DBMS), each tailored to
different data structures, scalability requirements and application needs. The most
common types are as follows:
2. NoSQL DBMS
● They are designed to handle large-scale data and provide high performance
for scenarios where relational models might be restrictive.
● They store data in various non-relational formats, such as key-value pairs,
documents, graphs or columns.
● These flexible data models enable rapid scaling and are well-suited for
unstructured or semi-structured data.
4. Hierarchical Database
6. Cloud-Based Database
● They are hosted on cloud computing platforms like AWS, Azure or Google
Cloud.
● They offer on-demand scalability, high availability, automatic backups and
remote accessibility.
● These databases can be relational (SQL) or non-relational (NoSQL) and are
maintained by cloud service providers, reducing administrative overhead.
● They support modern application requirements, including distributed access
and real-time analytics.
Example: Amazon RDS (for SQL), MongoDB Atlas (for NoSQL), Google BigQuery.
Database Languages
Database languages are specialized sets of commands and instructions used to define,
manipulate and control data within a database. Each language type plays a distinct role
in database management, ensuring efficient storage, retrieval and security of data. The
primary database languages include:
DDL is the short name for Data Definition Language, which deals with database
schemas and descriptions, of how the data should reside in the database.
● CREATE: to create a database and its objects like (table, index, views,
store procedure, function and triggers)
● ALTER: alters the structure of the existing database
● DROP: delete objects from the database
● TRUNCATE: remove all records from a table, including all spaces
allocated for the records are removed
● COMMENT: add comments to the data dictionary
● RENAME: rename an object
DML focuses on manipulating the data stored in the database, enabling users to
retrieve, add, update and delete data.
● SELECT: The primary DQL command, used to query data from the
database without altering its structure or contents.
Applications of DBMS
● Banking: Manages accounts and transactions.
● E-commerce: Tracks products, orders, and customers.
● Healthcare: Stores patient records and diagnoses.
● Education: Handles student grades and schedules.
● Social Media: Manages user profiles and interactions.
● Data Science: Supports analytics and predictions.
There are several types of DBMS Architecture that we use according to the usage
requirements.
● 1-Tier Architecture
● 2-Tier Architecture
● 3-Tier Architecture
1-Tier Architecture
In 1-Tier Architecture, the user works directly with the database on the same system.
This means the client, server and database are all in one application. The user can
open the application, interact with the data and perform tasks without needing a
separate server or network connection.
● Limited to Single User: Only one person can use the application at a time.
It’s not designed for multiple users or teamwork.
● Poor Security: Since everything is on the same machine, if someone gets
access to the system, they can access both the data and the application
easily.
● No Centralized Control: Data is stored locally, so there's no central
database. This makes it hard to manage or back up data across multiple
devices.
● Hard to Share Data: Sharing data between users is difficult because
everything is stored on one computer.
2-Tier Architecture
The application at the client end directly communicates with the database on the
server side. APIs like ODBC and JDBC are used for this interaction. The server side is
responsible for providing query processing and transaction management
functionalities.
● On the client side, the user interfaces and application programs are run. The
application on the client side establishes a connection with the server side to
communicate with the DBMS. For Example: A Library Management
System used in schools or small organizations is a classic example of
two-tier architecture.
● Client Layer (Tier 1): This is the user interface that library staff or users
interact with. For example they might use a desktop application to search
for books, issue them, or check due dates.
● Database Layer (Tier 2): The database server stores all the library records
such as book details, user information and transaction logs.
● The client layer sends a request (like searching for a book) to the database
layer which processes it and sends back the result. This separation allows
the client to focus on the user interface, while the server handles data
storage and retrieval.
3-Tier Architecture
In 3-Tier Architecture, there is another layer between the client and the server. The
client does not directly communicate with the server. Instead, it interacts with an
application server which further communicates with the database system and then the
query processing and transaction management takes place. This intermediate layer acts
as a medium for the exchange of partially processed data between the server and the
client. This type of architecture is used in the case of large web applications.
● User: You visit an online store, search for a product and add it to your cart.
● Processing: The system checks if the product is in stock, calculates the total
price and applies any discounts.
● Database: The product details, your cart and order history are stored in the
database for future reference.
This is the lowest level of data abstraction. It tells us how the data is actually stored in
memory. Access methods like sequential or random access and file organization
methods like B+ trees and hashing are used for the same. Usability, size of memory,
and the number of times the records are factors that we need to know while designing
the database.
Suppose we need to store the details of an employee. Blocks of storage and the
amount of memory used for these purposes are kept hidden from the user.
Logical or Conceptual Level
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.
The logical level thus describes the entire database in terms of a small number of
relatively simple structures. Although implementation of the simple structures at the
logical level may involve complex physical-level structures, the user of the logical
level does not need to be aware of this complexity. This is referred to as physical data
independence. Database administrators, who must decide what information to keep in
the database, use the logical level of abstraction.
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. Even though the logical level uses simpler structures, complexity remains
because of the variety of information stored in a large database. Many users of the
database system do not need all this information; instead, they need to access only a
part of the database. The view level of abstraction exists to simplify their interaction
with the system
Data Abstraction
The main purpose of data abstraction is to achieve data independence in order to save
the time and cost required when the database is modified or altered.
Data Independence
\
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:
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.
Data Models in DBMS
A Data Model in Database Management System (DBMS) is the concept of tools that
are developed to summarize the description of the database. Data Models provide us
with a transparent picture of data which helps us in creating an actual database. It
shows us from the design of the data to its proper implementation of data.
The conceptual data model describes the database at a very high level and is useful to
understand the needs or requirements of the database. It is this model, that is used in
the requirement-gathering process i.e. before the Database Designers start making a
particular database. One such popular model is the entity/relationship model (ER
model). The E/R model specializes in entities, relationships, and even attributes that
are used by database designers. In terms of this concept, a discussion can be made
even with non-computer science(non-technical) users and stakeholders, and their
requirements can be understood.
Components of ER Model:
Conceptual data models known as Domain models create a common vocabulary for
all stakeholders by establishing basic concepts and scope
2. Representational Data Model
This type of data model is used to represent only the logical part of the database and
does not represent the physical structure of the database. The representational data
model allows us to focus primarily, on the design part of the database. A popular
representational model is a Relational model. The relational Model consists of
Relational Algebra and Relational Calculus. In the Relational Model, we basically use
tables to represent our data and the relationships between them. It is a theoretical
concept whose practical implementation is done in Physical Data Model.
This Data Model describes HOW the system will be implemented using a specific
DBMS system. This model is typically created by DBA and developers. The purpose
is actual implementation of the database.
● The physical data model describes data need for a single project or
application though it maybe integrated with other physical data models
based on project scope.
● Data Model contains relationships between tables that which addresses
cardinality and nullability of the relationships.
● Developed for a specific version of a DBMS, location, data storage or
technology to be used in the project.
● Columns should have exact datatypes, lengths assigned and default values.
● Primary and Foreign keys, views, indexes, access profiles, and
authorizations, etc. are defined
Some Other Data Models
1. Hierarchical Model
The hierarchical Model is one of the oldest models in the data model which was
developed by IBM, in the 1950s. In a hierarchical model, data are viewed as a
collection of tables, or we can say segments that form a hierarchical relation. In this,
the data is organized into a tree-like structure where each record consists of one parent
record and many children. Even if the segments are connected as a chain-like structure
by logical associations, then the instant structure can be a fan structure with multiple
branches. We call the illogical associations as directional associations.
2. Network Model
The Network Model was formalized by the Database Task group in the 1960s. This
model is the generalization of the hierarchical model. This model can consist of
multiple parent segments and these segments are grouped as levels but there exists a
logical association between the segments belonging to any level. Mostly, there exists a
many-to-many logical association between any of the two segments.
In the Object-Oriented Data Model, data and their relationships are contained in a
single structure which is referred to as an object in this data model. In this, real-world
problems are represented as objects with different attributes. All objects have multiple
relationships between them. Basically, it is a combination of Object Oriented
programming and a Relational Database Model.
4. Float Data Model
The float data model basically consists of a two-dimensional array of data models that
do not contain any duplicate elements in the array. This data model has one drawback
it cannot store a large amount of data that is the tables can not be of large size.
The Context data model is simply a data model which consists of more than one data
model. For example, the Context data model consists of ER Model, Object-Oriented
Data Model, etc. This model allows users to do more than one thing which each
individual data model can do.
Conclusion
In conclusion, data modeling is a crucial process for designing databases that ensure
consistency, quality, and accuracy in how data is stored and managed. It establishes a
structured framework using conceptual, logical, and physical models to define
entities, relationships, and implementation details. While data modeling supports
better organization and ensures data integrity, it can be challenging due to the impact
of structural changes on the entire application. Despite its drawbacks, data modeling is
essential for creating efficient, reliable, and scalable database systems.