The Constitution Review Committee (CRC) has released an updated schedule for ...nservice241
Ad
Database Management System Unit 1 Full Chapter.docx
1. Unit 1
Database concepts
A Database Management System (DBMS) is a software solution
designed to efficiently manage, organize, and retrieve data in a
structured manner. It serves as a critical component in modern
computing, enabling organizations to store, manipulate, and secure
their data effectively. From small applications to enterprise systems,
DBMS plays a vital role in supporting data-driven decision-
making and operational efficiency.
A DBMS is a system that allows users to create, modify, and query
databases while ensuring data integrity, security, and efficient data
access. Unlike traditional file systems, DBMS minimizes data
redundancy, prevents inconsistencies, and simplifies data management
with features like concurrent access and backup mechanisms. It
organizes data into tables, views, schemas, and reports, providing a
structured approach to data management.
Example:
A university database can store and manage student information, faculty
records, and administrative data, allowing seamless retrieval, insertion,
and deletion of information as required.
Key Features of DBMS
1. Data Modeling: Tools to create and modify data models, defining the
structure and relationships within the database.
2. Data Storage and Retrieval: Efficient mechanisms for storing data
and executing queries to retrieve it quickly.
3. Concurrency Control: Ensures multiple users can access the
database simultaneously without conflicts.
4. Data Integrity and Security: Enforces rules to maintain accurate and
secure data, including access controls and encryption.
5. Backup and Recovery: Protects data with regular backups and
enables recovery in case of system failures.
comparison between a Traditional File System and a Database
Management System (DBMS):
1. Data Storage
2. Traditional File System: Stores data in separate files. Each file is
like a notebook.
DBMS: Stores data in a structured way, like a well-organized
library.
2. Data Organization
Traditional File System: No proper structure; data is scattered.
DBMS: Data is stored in tables with rows and columns, making it
easy to find.
3. Data Redundancy (Duplicate Data)
Traditional File System: Same data can be saved in multiple files,
wasting space.
DBMS: Avoids duplicate data by linking related information.
4. Data Security
Traditional File System: Anyone with access to the file can see or
change the data.
DBMS: Provides password protection and controlled access to
data.
5. Data Integrity (Correct & Accurate Data)
Traditional File System: Hard to maintain accurate and updated
data.
DBMS: Ensures data remains correct and up-to-date.
6. Data Retrieval (Finding Data Quickly)
Traditional File System: Searching for specific data takes time.
DBMS: Quick and efficient searching using queries.
7. Data Consistency (Same Data Everywhere)
Traditional File System: Changes made in one file do not update
other related files.
DBMS: Ensures all data remains the same across different tables.
8. Backup & Recovery
3. Traditional File System: Sometimes, in traditional file system
there might or might not be Backup. Or, even if it is there, it must
be done manually - which is again acomplex process. If by chance,
there was no backup, and if data is lost, recovery will be very
difficult.
DBMS: Automatic backup is there and easy recovery options are
available.
9. Multi-User Access
Traditional File System: Difficult for multiple people to work on
the same file at the same time.
DBMS: Many users can access and update data simultaneously.
10. Speed & Performance
Traditional File System: Slower because it searches files one by
one.
DBMS: Faster due to indexing and query processing.
Conclusion:
Traditional File System is simple but becomes messy when data
grows.
DBMS is structured, secure, and efficient for handling large
amounts of data.
For large organizations or businesses, DBMS is the better choice!
Characteristics of DBMS (Database Management System) in Simple
Words
A DBMS is a system that helps store, manage, and organize data easily.
Here are its main characteristics:
1. Organized Data Storage
Data is stored in tables with rows and columns.
This makes it easy to find and manage information.
2. No Duplicate Data (Redundancy Control)
4. The same data is not stored in multiple places.
Saves storage space and avoids confusion.
3. Data Security
Only authorized people can access the database.
Passwords and permissions protect the data.
4. Correct and Accurate Data (Integrity)
Ensures that the data is always correct and updated.
Prevents wrong or missing information.
5. Multiple Users Can Use It (Multi-User Access)
Many people can work on the database at the same time.
Avoids conflicts when making changes.
6. Backup and Recovery
Automatically saves copies of data.
If data is lost, it can be restored easily.
7. Same Data Everywhere (Consistency)
If data is updated, all related records are also updated.
Prevents errors and mismatched data.
8. Easy Searching (Query Processing)
Uses SQL (Structured Query Language) to quickly find data.
No need to search through files manually.
9. Easy to Update (Data Independence)
Changes in data storage do not affect how applications use it.
Makes updating and modifying data simple.
10. Many People Can Use It at the Same Time (Concurrent Access)
The database works smoothly even when multiple users access it.
Prevents system slowdowns or errors.
5. => DBMS makes data safe, fast, organized, and easy to manage. That’s
why it is better than traditional file storage!
Components of Database System Environment
Hardware, Software, Data, Database Access Language, Procedures and
Users all together form the components of a DBMS.
Let us discuss the components one by one clearly.
Hardware
The hardware is the actual computer system used for keeping and
accessing the database. The conventional DBMS hardware consists of
secondary storage devices such as hard disks. Databases run on the range
of machines from micro computers to mainframes.
Software
Software is the actual DBMS between the physical database and the users
of the system. All the requests from the user for accessing the database
are handled by DBMS.
Data
It is an important component of the database management system. The
main task of DBMS is to process the data. Databases are used to store the
data, retrieved, and updated to and from the databases.
Users
There are a number of users who can access or retrieve the data on
demand using the application and the interfaces provided by the DBMS.
The components of DBMS are given below in pictorial form −
6. Database Users:
Types of Database Users
Database users are categorized based on their interaction with the
database. There are seven types of database users in DBMS. Below
mentioned are the types of database users:
1. Database Administrator (DBA)
A Database Administrator (DBA) is a person/team who defines the
schema and also controls the 3 levels of the database. The DBA will
then create a new account ID and password for the user if he/she needs
to access the database. DBA is also responsible for providing security to
the database and he allows only authorized users to access/modify the
database. DBA is responsible for problems such as security breaches
and poor system response time.
DBA also monitors the recovery and backup and provides technical
support.
7. The DBA has a DBA account in the DBMS which is called a system
or superuser account.
DBA repairs damage caused due to hardware and/or software failures.
DBA is the one having privileges to perform DCL (Data Control
Language) operations such as GRANT and REVOKE, to
allow/restrict a particular user from accessing the database.
2. Naive / Parametric End Users
Parametric End Users are the unsophisticated who don’t have any
DBMS knowledge but they frequently use the database applications in
their daily life to get the desired results. For example, Railway’s ticket
booking users are naive users. Clerks in any bank is a naive user
because they don’t have any DBMS knowledge but they still use the
database and perform their given task.
3. A System Analyst
A system Analyst is a user who analyzes the requirements of parametric
end users. They check whether all the requirements of end users are
satisfied.
4. Sophisticated Users
Sophisticated users can be engineers, scientists, business analyst, who
are familiar with the database. They can develop their own database
applications according to their requirement. They don’t write the
program code but they interact the database by writing SQL queries
directly through the query processor.
5. Database Designers
Data Base Designers are the users who design the structure of database
which includes tables, indexes, views, triggers, stored procedures and
constraints which are usually enforced before the database is created or
populated with data. He/she controls what data must be stored and how
the data items to be related. It is the responsibility of Database
Designers to understand the requirements of different user groups and
then create a design which satisfies the need of all the user groups.
6. Application Programmers
Application Programmers also referred as System Analysts or simply
Software Engineers, are the back-end programmers who writes the code
8. for the application programs. They are the computer professionals.
These programs could be written in Programming languages such as
Visual Basic, Developer, C, FORTRAN, COBOL etc. Application
programmers design, debug, test, and maintain set of programs called
“canned transactions” for the Naive (parametric) users in order to
interact with database.
7. Casual Users / Temporary Users
Casual Users are the users who occasionally use/access the database but
each time when they access the database they require the new
information, for example, Middle or higher level manager.
8. Specialized users
Specialized users are sophisticated users who write specialized database
application that does not fit into the traditional data-processing
framework. Among these applications are computer aided-
design systems, knowledge-base and expert systems etc.
Advantages of Database Management System
The advantages of database management systems are:
1. Data Security: The more accessible and usable the database, the
more it is prone to security issues. As the number of users increases,
the data transferring or data sharing rate also increases thus increasing
the risk of data security. It is widely used in the corporate world
where companies invest large amounts of money, time, and effort to
ensure data is secure and used properly. A Database Management
System (DBMS) provides a better platform for data privacy and
security policies thus, helping companies to improve Data Security.
2. Data integration: Due to the Database Management System we have
access to well-managed and synchronized forms of data thus it makes
data handling very easy and gives an integrated view of how a
particular organization is working and also helps to keep track of how
one segment of the company affects another segment.
3. Data abstraction: The major purpose of a database system is to
provide users with an abstract view of the data. Since many complex
algorithms are used by the developers to increase the efficiency of
databases that are being hidden by the users through various data
abstraction levels to allow users to easily interact with the system.
9. 4. Reduction in data Redundancy: When working with a structured
database, DBMS provides the feature to prevent the input of duplicate
items in the database. for e.g. – If there are two same students in
different rows, then one of the duplicate data will be deleted.
5. Data sharing: A DBMS provides a platform for sharing data across
multiple applications and users, which can increase productivity and
collaboration.
6. Data consistency and accuracy: DBMS ensures that data is
consistent and accurate by enforcing data integrity constraints and
preventing data duplication. This helps to eliminate data discrepancies
and errors that can occur when data is stored and managed manually.
7. Data organization: A DBMS provides a systematic approach to
organizing data in a structured way, which makes it easier to retrieve
and manage data efficiently.
8. Efficient data access and retrieval: DBMS allows for efficient data
access and retrieval by providing indexing and query optimization
techniques that speed up data retrieval. This reduces the time required
to process large volumes of data and increases the overall
performance of the system.
9. Concurrency and maintained Atomicity : That means, if some
operation is performed on one particular table of the database, then
the change must be reflected for the entire database. The DBMS
allows concurrent access to multiple users by using the
synchronization technique.
10. Scalability and flexibility: DBMS is highly scalable and can easily
accommodate changes in data volumes and user requirements. DBMS
can easily handle large volumes of data, and can scale up or down
depending on the needs of the organization. It provides flexibility in
data storage, retrieval, and manipulation, allowing users to easily
modify the structure and content of the database as needed.
DBMS offers numerous advantages, including data security,
integrity, and reduced redundancy. If you’re looking to master
database concepts and their benefits, the GATE CS Self-Paced Course
covers DBMS in a structured, easy-to-follow manner, ensuring you’re
exam-ready.
Advantages of Database Management System over Traditional File
System
1. Better Data Security : DBMS provides a centralized approach to
data management that ensures data integrity and security. To prevent
illegal access, alteration, or theft, database management systems
10. (DBMS) include a number of security features, including encryption,
authentication, and authorization. Sensitive data is safeguarded
against both internal and external attacks thanks to this.
2. Reduced Data Redundancy : DBMS eliminates data redundancy by
storing data in a structured way. It allows sharing data across different
applications and users, reducing the need for duplicating data. By
keeping data centrally and offering methods for sharing and reusing
it, database management systems (DBMS) remove data redundancy.
As a result, less data storage is needed, and data consistency is
increased.
3. Improved Data Consistency : DBMS allows defining constraints
and rules to ensure that data is consistent and accurate. DBMS
ensures data consistency by enforcing data validation rules and
constraints. This ensures that data is accurate and consistent across
different applications and users.
4. Improved Data Access and Availability : DBMS provides efficient
data access and retrieval mechanisms that enable quick and easy data
access. It allows multiple users to access the data simultaneously,
ensuring data availability.
5. Improved Data Sharing : DBMS provides a platform for sharing
data across different applications and users. It allows sharing data
between different departments and systems within an organization,
improving collaboration and decision-making. Database Management
Systems prevent conflicts and data loss by enabling numerous people
to view and edit the same data at once. This promotes teamwork and
enhances data uniformity throughout the company.
6. Improved Data Integration : DBMS allows integrating data from
different sources, providing a comprehensive view of the data. It
enables data integration from different systems and platforms,
improving the quality of data analysis. To avoid data mistakes and
inconsistencies, database management systems (DBMSs) apply data
integrity requirements including referential integrity, entity integrity,
and domain integrity. This guarantees the consistency, accuracy, and
completeness of the data.
7. Improved Data Backup and Recovery : DBMS provides backup
and recovery mechanisms that ensure data is not lost in case of a
system failure. It allows restoring data to a specific point in time,
ensuring data consistency. Database management systems (DBMS)
offer backup and recovery features that let businesses swiftly and
effectively restore lost or damaged data. This guarantees business
continuity and lowers the chance of data loss.
8. Data independence: By separating the logical and physical views of
data, database management systems (DBMS) enable users to work
11. with data without being aware of its exact location or structure. This
offers adaptability and lowers the possibility of data damage as a
result of modifications to the underlying hardware or software.
What is Schema?
A schema is the blueprint or structure that defines how data is organized
and stored in a database. It outlines the tables, fields, relationships, views,
indexes, and other elements within the database. The schema defines the
logical view of the entire database and specifies the rules that govern the
data, including its types, constraints, and relationships.
Key points about a database schema:
It defines how data is logically organized, including tables, fields, and
relationships.
It outlines the relationships between entities, such as primary and
foreign keys.
It helps resolve issues with unstructured data by organizing it in a
clear, structured way.
Database schemas guide how data is accessed, modified, and
maintained.
Types of Database Schemas
Physical Database Schema
A physical schema defines how data is stored in the storage system,
including the arrangement of files, indices and other storage
structures. It specifies the actual code and syntax needed to create the
12. database structure. Essentially, it determines where and how the data
is stored in the physical storage medium.
The database administrator decides the storage locations and
organization of data within the storage blocks. This schema represents
the lowest level of abstraction
Logical Database Schema
A logical database schema defines the logical structure of the data,
including tables, views, relationships, and integrity constraints. It
describes how data is organized in tables and how the attributes of
these tables are connected. The logical schema ensures that the data is
stored in an organized manner, while maintaining data integrity.
Using Entity-Relationship (ER) modeling, the logical schema outlines
the relationships between different data components. It also defines
integrity constraints to ensure the quality of data during insertion and
updates.
This schema represents a higher level of abstraction compared to the
physical schema, focusing on logical constraints and how the data is
structured, without dealing with the physical storage details.
View Database Schema
The view schema is the highest level of abstraction in a database,
focusing on how users interact with the database. It defines the
interface through which users can access and manipulate data,
without needing to understand the underlying storage mechanisms.
A database can have multiple view schemas, also known as
subschemas, each providing a different perspective of the data. These
schemas describe only a part of the database.
Database Schema Designs
There are many ways to structure a database and we should use the best-
suited schema design for creating our database because ineffective
schema designs are difficult to manage & consume extra memory and
resources.
Schema design mostly depends on the application’s requirements. Here
we have some effective schema designs to create our applications, let’s
take a look at the schema designs:
1. Flat Model
2. Hierarchical Model
3. Network Model
4. Relational Model
5. Star Schema
13. 6. Snowflake Schema
Flat Model
A flat model schema is a 2-D array in which every column contains the
same type of data/information and the elements with rows are related to
each other. It is just like a table or a spreadsheet. This schema is better
for small applications that do not contain complex data.
Flat Model
Hierarchical Model
Data is arranged using parent-child relationships and a tree-like structure
in the Hierarchical Database Model. Because each record consists of
several children and one parent, it can be used to illustrate one-to-many
relationships in diagrams such as organizational charts. A hierarchical
database structure is great for storing nested data.
Designing Hierarchical Model
Network Model
14. The network model is similar to the hierarchical model in that it
represents data using nodes (entities) and edges (relationships).
However, unlike the hierarchical model, which enforces a strict parent-
child relationship, the network model allows for more flexible many-to-
many relationships. This flexibility means that a node can have multiple
parent nodes and child nodes, making the structure more dynamic.
The network model can contain cycles which is a situation where a path
exists that allows you to start and end at the same node. These cycles
enable more complex relationships and allow for greater data
interconnectivity.
Designing Network Model
Relational Model
The relational model is mainly used for relational databases, where the
data is stored as relations of the table. This relational model schema is
better for object-oriented programming.
15. Designing Relational Model
Star Schema
Star schema is better for storing and analyzing large amounts of data. It
has a fact table at its center & multiple dimension tables connected to it
just like a star, where the fact table contains the numerical data that run
business processes and the dimension table contains data related to
dimensions such as product, time, people, etc. or we can say, this table
contains the description of the fact table. The star schema allows us to
structure the data of RDBMS.
Designing Star Schema
Snowflake Schema
Just like star schema, the snowflake schema also has a fact table at its
center and multiple dimension tables connected to it, but the main
difference in both models is that in snowflake schema – dimension
tables are further normalized into multiple related tables. The snowflake
schema is used for analyzing large amounts of data.
16. Designing Snowflake Schema
Difference between Logical and Physical Database Schema
Physical Schema Logical Schema
Physical schema describes the
way of storage of data in the disk.
Logical schema provides the
conceptual view that defines the
relationship between the data
entities.
Having Low level of abstraction. Having a high level of abstraction.
The design of database is
independent to any
database management system.
The design of a database must
work with a specific database
management system or hardware
platform.
Changes in Physical schema
effects the logical schema
Any changes made in logical
schema have minimal effect in the
physical schema
Physical schema does not include
attributes.
Logical schema includes
attributes.
17. Physical Schema Logical Schema
Physical schema contains the
attributes and their data types.
Logical schema does not contain
any attributes or data types.
Examples: Data definition
language(DDL), storage
structures, indexes.
Examples: Entity Relationship
diagram, Unified Modeling
Language, class diagram.
Advantages of Database Schema
Providing Consistency of data: Database schema ensures the data
consistency and prevents the duplicates.
Maintaining Scalability: Well designed database schema helps in
maintaining addition of new tables in database along with that it helps
in handling large amounts of data in growing tables.
Performance Improvement: Database schema helps in faster data
retrieval which is able to reduce operation time on the database tables.
Easy Maintenance: Database schema helps in maintaining the entire
database without affecting the rest of the database
Security of Data: Database schema helps in storing the sensitive data
and allows only authorized access to the database.
Database Instance
A database instance is a snapshot of a database at a specific moment in
time, containing all the properties described by a database schema as
data values. Unlike database schemas, which are considered the
“blueprint” of a database, instances can change over time whereas it is
very difficult to modify the schema because the schema represents the
fundamental structure of the database. Database instance does not hold
any information related to the saved data in database.
Instance
18. Database schema versus database instance:
Aspect Database Schema Database Instance
Definition Blueprint or design of the
database structure
Actual data stored in the
database at a given time
Nature Static (does not change
frequently)
Dynamic (changes with
every data modification)
Represents Structure (tables, columns,
data types, relationships)
State of the data in the
database
Example Table definitions, data types,
constraints
Actual rows of data in
the tables
Change
Frequency
Changes infrequently (e.g.,
during schema design
changes)
Changes frequently with
transactions
DBMS Architecture 1-level, 2-Level, 3-Level
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. Database Management System (DBMS)
architecture is crucial for efficient data management and system
performance.
Types of DBMS Architecture
19. 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. This setup is simple
and is often used in personal or standalone applications where the user
interacts directly with the database.
For Example: A Microsoft Excel spreadsheet is a great example of one-
tier architecture.
Everything—the user interface, application logic and data is handled
on a single system.
The user directly interacts with the application, performs operations
like calculations or data entry and stores data locally on the same
machine.
This architecture is simple and works well for personal, standalone
applications where no external server or network connection is needed.
DBMS 1-Tier Architecture
Advantages of 1-Tier Architecture
Below mentioned are the advantages of 1-Tier Architecture.
20. Simple Architecture: 1-Tier Architecture is the most simple
architecture to set up, as only a single machine is required to maintain
it.
Cost-Effective: No additional hardware is required for implementing
1-Tier Architecture, which makes it cost-effective.
Easy to Implement: 1-Tier Architecture can be easily deployed, and
hence it is mostly used in small projects.
2-Tier Architecture
The 2-tier architecture is similar to a basic client-server model . The
application at the client end directly communicates with the database on
the server side. 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.
1. 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.
2. 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.
21. DBMS 2-Tier Architecture
Advantages of 2-Tier Architecture
Easy to Access: 2-Tier Architecture makes easy access to the
database, which makes fast retrieval.
Scalable: We can scale the database easily, by adding clients or
upgrading hardware.
Low Cost: 2-Tier Architecture is cheaper than 3-Tier Architecture
and Multi-Tier Architecture .
Easy Deployment: 2-Tier Architecture is easier to deploy than 3-Tier
Architecture.
Simple: 2-Tier Architecture is easily understandable as well as simple
because of only two components.
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.
For Example: E-commerce Store
User: You visit an online store, search for a product and add it to your
22. 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.
DBMS 3-Tier Architecture
Advantages of 3-Tier Architecture
Enhanced scalability: Scalability is enhanced due to the distributed
deployment of application servers. Now, individual connections need
not be made between the client and server.
Data Integrity: 3-Tier Architecture maintains Data Integrity. Since
there is a middle layer between the client and the server, data
corruption can be avoided/removed.
Security: 3-Tier Architecture Improves Security. This type of model
prevents direct interaction of the client with the server thereby
reducing access to unauthorized data.
Disadvantages of 3-Tier Architecture
More Complex: 3-Tier Architecture is more complex in comparison
to 2-Tier Architecture. Communication Points are also doubled in 3-
Tier Architecture.
Difficult to Interact: It becomes difficult for this sort of interaction
to take place due to the presence of middle layers.
23. What is Data Independence in DBMS?
In the context of a database management system, data independence is
the feature that allows the schema of one layer of the database system to
be changed without any impact on the schema of the next higher level of
the database system. ”
Types of Data Independence
There are two types of data independence.
logical data independence
Physical data independence
Logical Data Independence
Changing the logical schema (conceptual level) without changing the
external schema (view level) is called logical data independence.
It is used to keep the external schema separate from the logical
schema.
If we make any changes at the conceptual level of data, it does not
affect the view level.
This happens at the user interface level.
For example, it is possible to add or delete new entities, attributes to
the conceptual schema without making any changes to the external
schema.
Physical Data Independence
Making changes to the physical schema without changing the logical
schema is called physical data independence.
If we change the storage size of the database system server, it will not
affect the conceptual structure of the database.
It is used to keep the conceptual level separate from the internal level.
This happens at the logical interface level.
Example – Changing the location of the database from C drive to D
drive.
Difference Between Physical and Logical Data Independence
24. Physical Data Independence Logical Data Independence
It mainly concerns how the data
is stored in the system.
It mainly concerns about changes to
the structure or data definition.
It is easier to achieve than
logical independence.
It is difficult to achieve compared to
physical independence.
To make changes at the physical
level we generally do not
require changes at the
application program level.
To make changes at the logical level,
we need to make changes at the
application level.
It tells about the internal
schema.
It tells about the conceptual schema.
There may or may not be a need
for changes to be made at the
internal level to improve the
structure.
Whenever the logical structure of
the database has to be changed, the
changes made at the logical level are
important.
Example- change in
compression
technology, hashing
algorithm, storage device etc.
Example – adding/modifying or
deleting a new attribute.
Database Languages in DBMS
Types of Database Languages in DBMS
Database languages are specialized languages used to interact with a
database. They allow users to perform different tasks such
as defining, controlling, and manipulating the data. There are several
types of database languages in DBMS, categorized into the following
four main types:
25. 1. DDL (Data Definition Language)
2. DCL (Data Control Language)
3. DML (Data Manipulation Language)
4. TCL (Transaction Control Language)
(Already explained in Unit 3)
ach category serves a different purpose within the database management
process. Let's break down each one.
TCL ( Transaction Control Language )
The TCL full form is Transaction Control Language commands are used
to manage and control transactions in a database, grouping them into
logical units. These commands help ensure the integrity of data and
consistency during complex operations. Here are the two main
commands in this category:
Commit: Saves all the changes made during the current transaction to
the database. These are very useful in the banking sector.
Rollback: used to restore the database to its original state from the
last commit. This command also plays an important role in Banking
Sectors.
Now we will explain these two commands for better understanding with
examples
Commit Command
The COMMIT command is used to save all changes made during a
transaction in the database. This command ensures that modifications
26. made by DML statements (such as INSERT, UPDATE, or DELETE)
become permanent in the database.
Syntax
Database Operation
Commit
Example:
commit
ROLLBACK Command
The rollback command is used to restore the database to its state at the
last COMMIT, effectively undoing any changes made since that point. It
helps ensure data consistency by allowing the reversal of partial or
erroneous operations.
Syntax
ROLLBACK;
Example:
rollback
27. What Are Databases?
A database is an organized collection of data stored and accessed
electronically. Databases can store structured, semi-structured,
or unstructured data, such as text, images, videos, and files, making
them indispensable for modern applications. They are managed
using Database Management Systems (DBMS), which provide tools for
creating, retrieving, and modifying data.
Key Characteristics of a Database
Data Organization: Arranges data for easy access and management.
Efficiency: Provides quick retrieval and updates.
Scalability: Handles growing amounts of data.
Security: Protects sensitive information with robust controls.
Classifications of DBMS
Databases are essential for storing and managing data in
today’s digital world. They serve as the backbone of various
applications, from simple personal projects to complex enterprise
systems.
Types of Databases
Databases can be classified based on their structure, usage, or storage
methods. Below are the main types:
Hierarchical databases
Network databases
Object-oriented databases
Relational databases
Cloud Database
Centralized Database
Operational Database
NoSQL databases
1. Hierarchical Databases
Hierarchical databases organize data in a tree-like structure where
data is arranged in levels or ranks. Higher-level data serves as a
common link for lower-level data, similar to a hierarchy. For example,
28. in a university, “University” is at the top level, while “Departments”
and “Administration” are at lower levels, even though they are distinct
entities.
Hierarchical Database Example
This structure can also be viewed as a parent-child relationship, where
each parent record can have multiple child records, but a child record
can only have one parent. As more data is added, the structure expands
like a tree. However, hierarchical databases have limitations, such as
being less flexible and harder to scale. Adding new data or elements
often requires traversing the hierarchy, which can be time-consuming.
2. Network Databases
A network database builds on the hierarchical model but allows child
records to link to multiple parent records, creating a web-like
structure of interconnected data. For example, in a university database,
“Students,” “Faculty,” and “Resources” can be linked to both
“Departments” and “Clubs,” forming a flexible, two-directional
relationship.
29. Network Database Example
This model is ideal for complex frameworks as it effectively
represents many-to-many relationships. Additionally, its structure
simplifies the use of certain database management languages. However,
the downside is that network databases are highly dependent on
their predefined structure, making changes difficult and time-
consuming due to their complexity.
3. Object-Oriented Databases
Object-oriented databases are based on the principles of object-oriented
programming (OOP), where data is stored as objects. These objects
include attributes (data) and methods (functions), making them
easily referenced and manipulated. For instance, a “Person” object in
the database could include attributes like Name and Address and
methods like getLatestAddress() to retrieve information.
30. Object-Oriented Example
This approach reduces the workload on the database by allowing
objects to be reused and linked directly, streamlining data
access and manipulation. Each object behaves as an instance of
the database model, enabling efficient operations.
4. Relational Databases
Considered the most mature of all databases, these databases lead in
the production line along with their management systems. In this
database, every piece of information has a relationship with every other
piece of information. This is on account of every data value in the
database having a unique identity in the form of a record.
Note that all data is tabulated in this model. Therefore, every row of data
in the database is linked with another row using a primary key.
Similarly, every table is linked with another table using a foreign key.
Refer to the diagram below and notice how the concept of ‘Keys‘ is
used to link two tables.
Relational Database Example
31. Due to this introduction of tables to organize data, it has become
exceedingly popular. In consequence, they are widely integrated
into Web-Ap interfaces to serve as ideal repositories for user data.
5. Cloud Databases
A cloud database operates in a virtual environment hosted on cloud
computing platforms. It is designed for storing, managing, and
executing data over the internet, providing flexibility and scalability.
Cloud databases are widely used for applications requiring dynamic
workloads, as they eliminate the need for on-premises infrastructure.
Common cloud services for accessing and managing databases
include SaaS (Software as a Service) and PaaS (Platform as a
Service), which simplify database operations for businesses. Popular
cloud platforms offering database services include:
Amazon Web Services (AWS)
Google Cloud Platform (GCP)
Microsoft Azure
ScienceSoft, etc.
6. Centralized Databases
A centralized database is a database stored and managed at a single
location, such as a central server or data center. It ensures higher
security and consistency as all data is maintained in one place, making
it easier to control and manage.
Users access the database remotely to fetch or update information.
Centralized databases are commonly used in enterprise systems where
data consistency and security are critical.
However, scalability and performance limitations should be carefully
considered.
Advantages
Data Security: Centralized storage makes it easier to implement
robust security measures.
32. Reduced Redundancy: Data duplication is minimized, ensuring
efficiency.
Consistency: A single data source ensures uniformity across the
system.
Disadvantages
Response Time: The large size of centralized databases can lead to
slower data retrieval times.
Difficulty in Modifications: Modifying, deleting, or updating data
can be challenging and time-consuming, especially for large datasets.
7. Personal Databases
A personal database is a small-scale database designed for a single
user, typically used on personal computers or mobile devices. These
databases are ideal for managing individual data
like contacts, budgets, notes, or schedules. They are lightweight, easy
to use, and require minimal database administration, making them
accessible for non-technical users.
Examples:
Microsoft Access: A simple database solution for personal or small
business needs.
SQLite: A lightweight, self-contained database commonly used in
mobile and desktop applications.
Advantages:
1. Ease of Use: Simple to set up and manage without requiring
advanced technical skills.
2. Low Storage Requirements: Occupies minimal space, making it
suitable for smaller devices.
8. Operational Databases
33. An operational database is designed to manage and process real-time
data for daily operations within organizations and businesses. It allows
users to create, update, and delete data efficiently, ensuring that the
database reflects current activities and transactions.
Advantages:
1. Easy to Fetch: Data retrieval is quick and efficient, supporting
operational tasks.
2. Structured Data: Organizes data systematically for better
management and access.
3. Real-Time Processing: Enables immediate updates, ensuring data is
always current.
9. NoSQL Databases
A NoSQL database (short for “non-SQL” or “non-relational”) provides
a mechanism for storing and retrieving data that does not rely on
traditional table-based relational models. Instead, it uses flexible data
models like key-value pairs, documents, column families, or graphs,
making it ideal for handling unstructured, semi-structured, and
structured data.
NoSQL databases are known for their simplicity of design, horizontal
scalability (adding more servers for scaling), and high availability.
Unlike relational databases, their data structures allow faster operations
in certain use cases. MongoDB, for instance, is a widely used document-
based NoSQL database.
Advantages
Easily scales horizontally by adding more servers.
Can be run on commodity hardware, lowering costs.
Optimized for large volumes of data and fast queries.
Handles unstructured, semi-structured, or structured data.
Disadvantages
NoSQL is an open-source database.
GUI is not available
Backup is a weak point for some NoSQL databases like MongoDB.
Large document size.
34. Applications of Database
A Database Management System (DBMS) makes easier to create,
maintain and work with the databases. It acts as the channel between
end users and the database enabling the functions including
administration, retrieval, updating and storing of data. By structuring
data into the organized formats and controlling concurrent access the
database management systems (DBMSs) contribute to the efficient
handling, security and integrity of data.
Applications of DBMS
1. Railway Reservation System
In the rail route reservation framework, the information base is needed
to store the record or information of ticket appointments, status of
train’s appearance, and flight. Additionally, if trains get late, individuals
become acquainted with it through the information base update.
2. Library Management System
There are many books in the library so; it is difficult to store the record
of the relative multitude of books in a register or duplicate. Along these
lines, the data set administration framework (DBMS) is utilized to keep
35. up all the data identified with the name of the book, issue date,
accessibility of the book, and its writer.
3. Banking
Database the executive’s framework is utilized to store the exchange
data of the client in the information base.
4. Education Sector
Presently, assessments are led online by numerous schools and colleges.
They deal with all assessment information through the data set
administration framework (DBMS). In spite of that understudy’s
enlistments subtleties, grades, courses, expense, participation, results,
and so forth all the data is put away in the information base.
5. Credit card exchanges
The database Management framework is utilized for buying on charge
cards and age of month to month proclamations.
6. Social Media Sites
We all utilization of online media sites to associate with companions
and to impart our perspectives to the world. Every day, many people
group pursue these online media accounts like Pinterest, Facebook,
Twitter, and Google in addition to. By the utilization of the data set
administration framework, all the data of clients are put away in the
information base and, we become ready to interface with others.
7. Broadcast communications
Without DBMS any media transmission organization can’t think. The
Database the executive’s framework is fundamental for these
organizations to store the call subtleties and month to month postpaid
bills in the information base.
8. Accounting and Finance
The information base administration framework is utilized for putting
away data about deals, holding and acquisition of monetary instruments,
for example, stocks and bonds in a data set.
9. E-Commerce Websites
36. These days, web-based shopping has become a major pattern. Nobody
needs to visit the shop and burn through their time. Everybody needs to
shop through web based shopping sites, (for example, Amazon, Flipkart,
Snapdeal) from home. So all the items are sold and added uniquely with
the assistance of the information base administration framework
(DBMS). Receipt charges, installments, buy data these are finished with
the assistance of DBMS.
10. Human Resource Management
Big firms or organizations have numerous specialists or representatives
working under them. They store data about worker’s compensation,
assessment, and work with the assistance of an information base
administration framework (DBMS).
11. Manufacturing
Manufacturing organizations make various kinds of items and deal them
consistently. To keep the data about their items like bills, acquisition of
the item, amount, inventory network the executives, information base
administration framework (DBMS) is utilized.
12. Airline Reservation System
This framework is equivalent to the railroad reservation framework.
This framework additionally utilizes an information base administration
framework to store the records of flight takeoff, appearance, and defer
status.
13. Healthcare System
DBMS is used in healthcare to manage patient data, medical records,
and billing information.
14. Security
DBMS provides security features to ensure that only authorized users
have access to the data.
15. Telecommunication
Database Management Systems (DBMS) are essential to the
telecommunications industry because they manage enormous volumes
of data on billing, customer information, and network optimization.