Understanding Database Management Systems
Understanding Database Management Systems
A DBMS is software that enables users to define, create, maintain, and control access to the
database. It provides mechanisms to ensure data integrity, security, and efficient data retrieval.
1. Data Definition – Allows defining database structure using Data Definition Language
(DDL).
2. Data Manipulation – Enables inserting, updating, deleting, and querying data using Data
Manipulation Language (DML).
3. Data Security – Restricts unauthorized access using authentication and authorization
controls.
4. Concurrency Control – Manages multiple users accessing the database simultaneously.
5. Backup and Recovery – Ensures data safety through regular backups and restoration
mechanisms.
What is Database
A database is an organized collection of data that allows for easy access, management, and
updating. It is used to store, retrieve, and manipulate data efficiently. Databases are widely used
in applications such as websites, mobile apps, and enterprise software to manage large amounts
of structured information.
Types of Databases
1. Relational Databases (RDBMS) – Store data in tables with rows and columns (e.g.,
MySQL, PostgreSQL, SQL Server).
2. NoSQL Databases – Handle unstructured or semi-structured data (e.g., MongoDB,
Cassandra).
3. Cloud Databases – Hosted on cloud platforms (e.g., Amazon RDS, Google Cloud
Firestore).
4. Graph Databases – Store relationships between entities (e.g., Neo4j).
5. Time-Series Databases – Optimize for time-stamped data (e.g., InfluxDB).
6. Key-Value Databases – Simple storage using key-value pairs (e.g., Redis).
The database approach differs from traditional file-based systems by centralizing data storage
and management, reducing redundancy, and improving efficiency. Below are its key
characteristics:
A DBMS stores not only the data but also a catalog (metadata) that describes the
database structure (tables, columns, data types, constraints, etc.).
This allows the database to be self-descriptive, making it flexible for different applications.
A database can provide different views for different users based on their needs.
Example:
o A student transcript view may show only courses and grades.
o An administrative view may show tuition fees, payments, and course
enrollments.
o
Metadata is "data about data"—it provides descriptive information about other data, helping
users and systems understand, manage, and organize data efficiently.
Characteristics of Metadata
Definition:
Program-Data Independence is a property of Database Management Systems (DBMS) where
the structure of the database (metadata) is stored separately from application programs. This
allows changes to the database structure without requiring changes to the application
programs that access the data.
In traditional file systems, data structures are embedded in application programs, making
them dependent on each other. In a DBMS, data is stored separately in a catalog
(metadata), ensuring that programs do not rely on specific data structures.
Schema Flexibility
Changes in database structure (schema), such as adding new attributes or modifying data
types, do not require modifications in application programs. Only the metadata needs to
be updated.
Data Abstraction
Users and applications interact with data at a high level without needing to know how it
is physically stored. The DBMS abstracts these storage details.
Reduces Program Maintenance
Different users or applications can have customized views of the same database without
affecting the underlying structure, improving accessibility and usability.
DBMS encapsulates the physical storage details from applications, allowing for
optimized storage management without impacting user applications.
Since all applications access a single, centralized data source, redundancy is minimized,
and data consistency is improved.
Access to the database is controlled through permissions and authentication, ensuring that
users and applications can only access the data they are authorized to use.
As business needs change, the database can evolve without affecting existing programs,
making it adaptable and scalable.
The DBMS manages indexing, caching, and query optimization, improving data retrieval
speed and system performance.
ACID Properties in DBMS
1. Atomicity
2. Consistency
3. Isolation
4. Durability
Ensures that a transaction is either fully completed or fully rolled back if an error
occurs.
If any part of the transaction fails, the entire transaction is undone to prevent partial
updates.
Example:
o Suppose you are transferring ₹5000 from Account A to Account B.
o If ₹5000 is deducted from Account A but not credited to Account B due to a
system failure, the transaction should be rolled back so that Account A is restored
to its original balance.
Ensures that a transaction brings the database from one valid state to another valid
state.
No transaction should violate database integrity constraints.
Example:
o In a banking system, the total amount of money before and after a transaction
must remain the same.
o If ₹5000 is deducted from Account A, it must be added to Account B.
Ensures that once a transaction is committed, the changes are permanently stored
even in case of system failures.
The database should not lose data due to power failures, crashes, or unexpected
shutdowns.
Example:
o If a user successfully books a flight ticket, the booking must remain in the
system even if the server crashes immediately after the confirmation.
OLTP (Online Transaction Processing) in DBMS
What is OLTP?
OLTP (Online Transaction Processing) is a database system that is optimized for handling a
large number of short, real-time transactions. It is commonly used in applications where
quick, frequent insertions, updates, and deletions are required.
A Database Management System (DBMS) offers several advantages over traditional file-based
data management systems. Some key benefits include:
1. Controlling Redundancy
2. Restricting Unauthorized Access
3. Providing Persistent Storage for Program Objects
4. Efficient Query Processing and Storage Optimization
5. Backup and Recovery Support
6. Multiple User Interfaces
7. Representing Complex Relationships Among Data
8. Enforcing Integrity Constraints
9. Inferencing and Triggers for Automated Actions
10. Enforcing Standards
11. Reduced Application Development Time
12. Flexibility and Scalability
13. Availability of Up-to-Date Information
14. Economies of Scale
1. Controlling Redundancy
In traditional file systems, multiple copies of the same data may be stored in different
files, leading to data redundancy.
DBMS integrates data storage, minimizing duplication and ensuring data consistency
through normalization.
DBMS provides security mechanisms such as user authentication, access control, and
encryption to prevent unauthorized access.
Users can be assigned different privileges (e.g., read-only or read-write access) to
safeguard sensitive information.
DBMS allows long-term storage of program objects and data structures, supporting
object-oriented programming languages like C++ and Java.
This eliminates the impedance mismatch problem between databases and programming
languages.
4. Efficient Query Processing and Storage Optimization
DBMS provides automated backup and recovery features to restore data in case of
system failures.
Transactions are logged to ensure consistency in case of unexpected shutdowns.
A DBMS provides a variety of interfaces such as GUIs, query languages (SQL), and
mobile applications.
It supports different user types, including casual users, application programmers, and
database administrators (DBAs).
DBMS enforces constraints like primary keys, foreign keys, and unique constraints
to maintain data accuracy.
Referential integrity ensures that relationships between records remain valid.
Modern DBMSs support deductive databases that infer new information based on stored
data.
Triggers and stored procedures automate actions when specific conditions are met.
Once a database is designed, creating new applications (e.g., generating reports, data
analysis) requires less time compared to file-based systems.
DBMSs allow easy modifications to the database schema without affecting existing
applications.
They are scalable to accommodate growing data volumes and user demands.
Changes made to the database are immediately available to all users, ensuring real-time
access to the latest information.
This is crucial for applications like banking systems, airline reservations, and e-
commerce platforms.
A Database Management System (DBMS) serves different types of users who interact with it
in various ways. End users are the people who need access to the database for querying,
updating, and generating reports. These users can be categorized as follows:
These users access the database occasionally and do not use it regularly.
Each time they access the database, they may require different types of information.
They use a sophisticated query interface to retrieve data.
Examples: Middle- or high-level managers who need reports for decision-making.
These are experienced users such as engineers, scientists, and business analysts.
They understand the DBMS in depth and develop their own complex queries and
applications.
They may use advanced tools like SQL, analytics software, or programming
languages to manipulate data.
4. Standalone Users
These users work with personal databases using ready-made software packages.
They do not interact with large-scale database systems but instead use local applications.
Their interface is often menu-based or graphical, requiring minimal technical knowledge.
Example: A user managing personal finances with a financial software package like
QuickBooks or Microsoft Excel.
Implications of Using the Database Approach
1. Enforcing Standards
3. Flexibility
A DBMS ensures real-time data updates, making it ideal for transaction-based systems
like banking and reservations.
Concurrency control mechanisms allow multiple users to access and modify data
simultaneously without inconsistencies.
5. Economies of Scale
Despite its numerous advantages, a DBMS may not always be the best choice due to its
associated overhead costs. Some situations where a DBMS might not be ideal include:
Some applications require instant processing without the latency introduced by DBMS
features like security and concurrency control.
Examples include telecommunications, industrial control systems, and embedded
systems.
Limited memory and processing power may prevent the use of a full-fledged DBMS.
Devices like IoT sensors, embedded controllers, and mobile devices may rely on
lightweight database solutions or file storage.
5. Single-User Applications
If only one user accesses and updates the data, a DBMS may be unnecessary.
Personal finance tools, simple spreadsheets, or stand-alone applications may function
well without a database system.
6. Domain-Specific Applications with Custom Data Management Needs
Some industries require specialized data handling that a general-purpose DBMS cannot
efficiently support. Examples include:
o Computer-Aided Design (CAD) Software: Uses proprietary file formats
optimized for drawing and 3D modeling.
o Telecommunication Systems: Use hierarchical data structures for fast call
routing.
o Geographic Information Systems (GIS): Require spatial indexing and custom
data structures to process maps, contours, and polygons.
Advantages of DBMS.
Using a Database Management System (DBMS) provides several advantages over traditional
file-based systems. Here are some key benefits:
Ensures accuracy and consistency of data through constraints (e.g., primary keys,
foreign keys).
Prevents duplication and inconsistencies that can occur in file-based systems.
2. Data Security
Uses powerful query languages like SQL to fetch, filter, and manipulate data efficiently.
Optimizes performance using indexes and caching.
8. Data Independence
Separates logical and physical data structures, allowing modifications without affecting
applications.
9. Transaction Management
Databases have evolved significantly over the decades, from simple file-based storage systems to
highly advanced, AI-driven, cloud-based solutions. Below is a timeline of database evolution,
including current database technologies and examples.
Introduction of the Relational Model (by Edgar F. Codd, 1970, IBM Research).
Key Features:
o Data stored in tables (relations).
o Used Structured Query Language (SQL) for data manipulation.
o Supported ACID (Atomicity, Consistency, Isolation, Durability) properties for
transactions.
Examples of RDBMS:
o Oracle (1979) – Enterprise database.
o IBM DB2 (1983) – Used in banking & finance.
o Microsoft SQL Server (1989) – Enterprise and cloud applications.
o MySQL (1995) – Web applications, open-source.
Impact: Became the dominant database model used in finance, healthcare,
government, and enterprises.
Cloud Databases
AI-Driven Databases
Blockchain Databases
Solution
Data refers to raw facts, figures, or details that can be processed or analyzed to derive
meaningful information. It can exist in various forms, such as numbers, text, images, audio, or
video, and is stored in databases for retrieval and processing.
Database is an organized collection of data that is stored, managed, and accessed electronically.
It allows users to efficiently retrieve, update, and manipulate data while ensuring consistency,
security, and integrity.
DBMS (Database Management System) is software that enables users to create, manage, and
manipulate databases efficiently. It provides tools for storing, retrieving, updating, and securing
data while ensuring integrity, concurrency control, and data consistency.
A Database Catalog is a centralized repository that stores metadata about the database,
including information about tables, schemas, data types, constraints, views, indexes, and
relationships. It helps the DBMS manage and organize data efficiently.
DBA (Database Administrator) is a person responsible for managing, maintaining, and
securing a database system. The DBA ensures database integrity, performance, backup and
recovery, user access control, and overall system optimization. They also define database
schemas, enforce security policies, and monitor database operations.
End User refers to individuals who interact with a database system to perform tasks such as
querying, updating, or generating reports. End users can be categorized into different types:
Casual End Users – Occasionally access the database with complex queries.
Naïve or Parametric End Users – Regularly use predefined transactions (e.g., bank
tellers, reservation agents).
Sophisticated End Users – Develop their own database applications (e.g., engineers,
analysts).
Standalone Users – Use personal database applications (e.g., financial software users).
Program-Data Independence refers to the ability to change the database schema without
requiring changes to the application programs that access the data. This is achieved through the
use of data abstraction, where the database structure is separate from the application logic,
allowing flexibility in modifying the data organization without affecting existing applications.
User View refers to the specific way a particular user or group of users interacts with and
perceives the database. It defines what data they can access and how it is presented, ensuring that
users only see relevant information based on their roles and requirements. Different users may
have different views of the same database, depending on their needs.
Examples include:
A Deductive Database System is a database system that extends traditional databases with
logic-based inference capabilities. It uses rules and facts to derive new information from existing
data. These systems are often based on logic programming languages like Datalog and are useful
for applications requiring complex reasoning.
Key Features:
A persistent object is an object that continues to exist beyond the execution of the program that
created it. It is stored in a non-volatile storage medium, such as a database, file system, or
cloud storage, allowing it to be retrieved and used later.
Meta-data (short for "data about data") refers to descriptive information about the structure,
properties, and management of data stored in a database. It helps the DBMS understand,
organize, and retrieve data efficiently.
Examples of Meta-data:
Meta-data is typically stored in the Database Catalog (or Data Dictionary) and is used by the
DBMS to manage the database efficiently.
Data Dictionary is a centralized repository that stores metadata about the database. It contains
detailed information about the database's structure, including definitions of tables, columns, data
types, constraints, relationships, and other database objects. This repository helps the DBMS
manage and organize the data efficiently and serves as a reference for database administrators
and developers.
Key Characteristics:
These applications are critical for environments where timely and accurate data processing is
essential to business operations.
Each action plays a vital role in overall database management, ensuring that data is structured
properly (Data Definition), remains accurate (Data Manipulation), can be efficiently retrieved
(Data Retrieval), and is processed reliably in business-critical operations (Transaction
Processing).
Security Management:
o Ensure proper user authentication and authorization.
o Implement and monitor access controls and encryption.
Performance Tuning:
o Optimize query performance, indexing, and resource allocation.
o Monitor and manage the overall performance of the database.
Backup and Recovery:
o Implement regular backup schedules.
o Develop and execute recovery plans to handle data loss or system failures.
Maintenance and Updates:
o Apply patches and updates to the DBMS software.
o Monitor system health and perform routine maintenance tasks.
Data Integrity and Consistency:
o Enforce integrity constraints and manage data consistency.
o Ensure compliance with ACID properties in transactions.
User Support and Troubleshooting:
o Assist users with database issues and queries.
o Monitor logs and resolve operational issues.
Resource Management:
o Manage storage allocation and optimize hardware resources.
o Plan for scalability and future growth.
Data abstraction generally refers to the suppression of details of data organization and storage,
and the highlighting of the essential features for an improved understanding of data. One of the
main characteristics of the database approach is to support data abstraction so that different users
can perceive data at their preferred level of detail.
1. Physical Level:
o Describes how data is actually stored on hardware (e.g., file structures, indexing,
storage formats).
o Hidden from users to shield them from low-level details.
2. Logical Level:
o Defines what data is stored in the database and the relationships among those
data.
o Focuses on the schema, tables, and constraints without exposing physical storage
details.
3. View Level:
o Provides tailored representations of the database for different users or
applications.
o Users interact with the data through views that only show relevant information.
This layered approach simplifies database interaction, promotes data independence, and enables
easier maintenance and evolution of the system.
Data Model
A data model is a set of conceptual tools that enables us to outline the architecture of a database
in an abstract manner. It defines the data types, associations, and restrictions that the stored
information must adhere to, and it generally incorporates a collection of operations for retrieving
and modifying that data.
Essential Concepts:
Structure Specification:
o Details the data formats (e.g., integer, string, date),
o Describes the associations between different data entities (e.g., one-to-many,
many-to-many), and
o Establishes rules to maintain data validity (e.g., primary keys, foreign keys,
unique constraints).
Abstraction:
o By delivering a high-level conceptual framework, the data model conceals the
intricacies of how data is physically stored on disk, enabling users and developers
to interact with information in a more intuitive and consistent fashion.
Fundamental Operations:
o Data models not only delineate the structure of information but also support
actions such as querying (extracting data) and updating (adding, modifying, or
removing data).
In a data model, it is important to distinguish between the description of the database and the
database itself. The description of a database is called the database schema,
Most data models have certain conventions for displaying schemas as diagrams. A displayed
schema is called schema diagram.
A schema diagram displays only some aspects of a schema, such as the names of record types
and data items, and some types of constraints. Other aspects are not specified in the schema
diagram., shows neither the data type of each data item nor the relationships among the various
files. Many types of constraints are not represented in schema diagrams.
The database schema and database state are two fundamental concepts in database design:
The DBMS plays a crucial role in ensuring that every state of the database remains valid by
enforcing the constraints and structure specified in the schema. This separation of schema (the
blueprint) from state (the actual data) is essential for maintaining data integrity and supporting
effective database management.
1. Self-Describing Nature:
o The DBMS uses a catalog to store the database description (schema).
o This metadata makes the system self-describing because the DBMS can refer to
the catalog to understand the database structure, constraints, and relationships,
regardless of the specific application.
2. Program-Data and Program-Operation Independence:
oThe separation of the schema (structure) from the application programs ensures
that changes in the data organization do not force a complete rewrite of the
programs.
o This insulation allows the DBMS to adapt to changes in storage or operations
(like new indexing strategies or modifications in table structure) without affecting
the application layer.
3. Support for Multiple User Views:
o The architecture allows different users or user groups to have customized views of
the database.
o These views ensure that each user sees only the relevant subset of the data, which
is particularly useful in large, multiuser environments.
This architecture divides the database system into three distinct levels:
Data Independence
The goal of the three-schema architecture is to separate the user applications from the physical
database. In this architecture, schemas can be defined at the following three levels:
1. The internal level has an internal schema, which describes the physical storage structure of the
database. The internal schema uses a physical data model and describes the complete details
of data storage and access paths for the database
2. The conceptual level has a conceptual schema, which describes the structure of the whole
database for a community of users. The conceptual schema hides the details of physical
storage structures and concentrates on describing entities, data types, relationships, user
operations, and constraints. Usually, a rep resentational data model is used to describe the
conceptual schema when a database system is implemented. This implementation conceptual
schema is often based on a conceptual schema design in a high-level data model.
3. The external or view level includes a number of external schemas or user views. Each
external schema describes the part of the database that a particular user group is interested in
and hides the rest of the database from that user group. As in the previous level, each external
schema is typically implemented using a representational data model, possibly based on an
external schema design in a high-level conceptual data model.
The three-schema architecture is a conceptual framework that helps visualize and separate the
different levels of abstraction in a database system. Here’s a summary of its key points:
Separation of Levels:
The architecture divides the database into three levels:
1. External Level:
Defines user views or external schemas.
Each user or group sees a tailored subset of the data, which is relevant to
their needs.
2. Conceptual Level:
Represents the overall logical structure of the entire database.
It describes the entities, relationships, and constraints without including
physical storage details.
3. Internal Level:
Details the physical storage of data, including file structures, indexes, and
access paths.
Mappings Between Levels:
o Mappings are used to translate requests and data between these levels.
o When a user submits a query via an external schema, the DBMS maps this request
first to the conceptual schema and then to the internal schema to retrieve the
actual data.
o After processing, the results are mapped back to the external view, ensuring that
users see data in a format that makes sense to them.
Practical Implications:
o Although many DBMSs may not completely separate these levels explicitly (for
example, some older systems may mix physical details with conceptual
information), the three-schema architecture remains crucial for designing flexible,
scalable, and maintainable databases.
o Modern systems like Oracle or SQL Server often use the same data model (e.g.,
relational SQL) for both external and conceptual schemas, but they still
conceptually support this separation to achieve data independence and modularity.
Advantages:
o It promotes data independence, allowing changes in one level (like physical
storage modifications) without affecting the others (such as user interfaces).
o It helps in managing complexity by isolating the user’s perspective from the
underlying data organization.
The three-schema architecture provides a powerful way to design a database system by clearly
distinguishing between how data is viewed by users, how it is logically organized, and how it is
physically stored, with mappings ensuring seamless transformation of requests across these
layers.
Data independence
Data independence is the ability to modify the schema at one level of a database system without
altering the schema or application programs at the next higher level. It ensures that changes in
the structure or storage of data do not ripple through the entire system. There are two primary
types:
Definition:
The capacity to change the conceptual schema (the overall logical structure of the
database) without having to modify the external schemas (user views) or the application
programs that interact with the database.
What It Means:
You can add, delete, or reorganize data items or record types in the conceptual schema,
and as long as the changes do not affect the external view, the applications remain
unaffected. For example, if you expand the database by adding a new data item or modify
constraints, only the mappings and possibly the view definitions might need
adjustment—not the applications that query the database.
Example:
Imagine a university database where a new attribute "Middle Name" is added to the
student record in the conceptual schema. If the external schema (e.g., a student transcript
view) does not require displaying "Middle Name," the change is invisible to the
application programs using that view.
Definition:
The capacity to change the internal schema (how data is physically stored on the storage
media) without having to alter the conceptual schema.
What It Means:
You can reorganize the physical storage of data, such as creating new indexes, changing
file organization, or modifying access paths, without affecting the logical structure of the
database or the user views. This allows improvements in performance (e.g., faster query
processing) while keeping the higher-level schema and application logic intact.
Example:
Consider a database storing course information. If the DBMS introduces an additional
access path—such as an index based on semester and year—to speed up queries like “List
all sections offered in Fall 2008,” this physical reorganization does not require any
changes to the conceptual schema or the query itself.
Mapping Between Levels
To maintain data independence, the DBMS uses mappings stored in its catalog to translate
requests between:
When a change is made at one level (for example, adding an index at the physical level), only the
mapping information is updated, and the schema at the next higher level remains unchanged.
This separation ensures that application programs and user views remain consistent and do not
need to be modified with every change in data organization.
Importance
Maintains Flexibility:
Allows the database to evolve (both logically and physically) without forcing changes to
all dependent applications or user interfaces.
Reduces Maintenance:
Developers and DBAs can optimize storage or update constraints without rewriting
application code.
Improves Performance:
Physical changes can be made to improve performance (like better indexing) without
impacting the logical design that users interact with.
DBMS Languages and Interfaces provide the tools and methods by which users, programmers,
and administrators interact with a database. The main points are:
Used in banking, e-commerce, and reservation systems to access data via smartphones.
Typically includes login authentication and provides limited menus for common
actions.
Example: Google Pay, Amazon, Zomato.
3. Forms-Based Interfaces
Displays a structured form where users can enter or search for data.
Users fill in fields to input new data or retrieve matching records.
Example:
o A hospital management system where users enter patient details.
o Oracle Forms for enterprise applications.
7. Speech-Based Interfaces
A DBMS consists of multiple modules responsible for different tasks, from storing data to processing
user requests efficiently.
Query Compiler: Parses, validates, and converts SQL queries into an internal format.
Query Optimizer: Improves execution efficiency by:
o Reordering operations.
o Removing redundant computations.
o Using efficient search algorithms.
Programs written in host languages (e.g., Java, C, C++) contain Embedded SQL or DML
commands.
Precompiler: Extracts SQL/DML commands and sends them to the DML compiler.
The compiled DML object code is linked with the host program.
Canned Transactions: Predefined queries embedded in applications, executed frequently (e.g.,
bank transfers, e-commerce orders).
The stored data manager handles disk access using buffer management.
Some DBMSs use their own buffer management module to optimize disk read/write operations,
improving performance.
Conceptual Modelling.
This passage discusses conceptual modeling as an essential phase in database design, focusing
on the Entity-Relationship (ER) model and its role in structuring database applications.
The ER model is a high-level conceptual data model used for designing databases. It includes:
Unified Modeling Language (UML) is used for software and database design.
Class diagrams in UML are similar to ER diagrams but also specify:
o Operations on objects (methods).