Database Management System UNIT 1
Database Management System UNIT 1
Data is statically raw and unprocessed information. For example – name, class, marks,
etc.
Components of DBMS:
Database: A structured collection of data.
DBMS Software: Manages the database (e.g., MySQL, Oracle, SQL Server).
Users: The people who interact with the system.
Applications: Programs that use the DBMS to fetch or store data.
DBMS A Database Management System (DBMS) is software that enables users to create,
manage, and manipulate databases. It provides an interface for users to interact with the
data, allowing them to perform tasks such as querying, updating, and organizing data
efficiently.
10. Better Recovery and Backups - Backup and recovery are handled automatically by the
DBMS. Users don't need to regularly back up their data because the DBMS handles this for
them. Additionally, it returns the database to its prior state following a crash or system
failure.
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.
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.
9. E-Commerce Websites
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.
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.
The catalog is used by both the DBMS software and administrators to understand the
database layout.
Unlike traditional file systems where data definitions are embedded in files, a general-
purpose DBMS relies on the catalog to access different databases, such as university or
banking systems.
This allows the DBMS to handle various applications by extracting the required definitions
from the catalog.
However, in a DBMS, this is avoided through program-data independence, where the data
structure is stored separately in the DBMS catalog.
This allows programs to access data without needing structural changes. The concept of
data abstraction supports this, providing a conceptual view of the data without exposing
storage details.
A data model represents this abstraction using logical concepts like objects, properties, and
relationships, making it easier for users to understand while hiding unnecessary
implementation complexities from them.
A DBMS supports multiple views, allowing different users to have tailored perspectives of
the database.
A view can be a subset of the database or virtual data derived from it but not stored
explicitly. Users don’t need to know if the data they access is stored or derived.
In multi-user systems with diverse applications, the DBMS defines and manages multiple
views, enhancing flexibility and usability.
This capability is particularly beneficial in large databases, like the Aadhaar database,
where different users or applications require specific data views while maintaining security
and efficiency.
A multi-user DBMS allows multiple users to access and update the database
simultaneously, ensuring data consistency through concurrency control.
This is crucial for applications like WhatsApp's integration with Facebook, where shared
data is maintained.
The DBMS ensures that updates, such as assigning a seat in airline reservations, are
handled correctly so that no two users can access the same data simultaneously.
These applications are called online transaction processing (OLTP)systems. The DBMS
enforces ACID properties—ensuring transactions are isolated (independent of each other)
and atomic (all operations are completed or none), maintaining database integrity.
Database users are categorized based up on their interaction with the data base
There are two categories of people behind DBMS
a) Those who actually use and control the database content, and those who design, develop
and maintain database applications (called-Actors on the Scene)
b) Those who design and develop the DBMS softwarê and related tools, and the computer
systems operators (called -Workers Behind the Scene).
1. Database Administrator (DBA): DBA is a person who is responsible for authorizing access
to the database, coordinating and monitoring its use, and acquiring software and hardware
resources as needed.
2. Database Designers: They are responsible for identifying the data to be stored in the database
and for choosing an appropriate structures to represent and store this data. They also define
views for different categories of users. The final design must be able to support the
requirements of all the user sub-groups.
3. End Users: End users are the people who access the database for querying, updating and
report generation. They are main reason for database's existence!
Casual end users use database occasionally, needing different information each time use
query language to specify their requests, are typically middle- or high-level managers.
Naive or Parametric end users typically the biggest group of users. Constantly querying
and updating the database, using standard types of queries and updates called canned
transactions that have been carefully programmed and tested in advance.
5. Application Programmers: Implement, test, document, and maintain programs that satisfy the
specifications mentioned above.
1) DBMS system designers and implementers are persons who design and implement the
DBMS modules and interfaces as a software package.
2) Tool developers include persons who design and implement software tools facilitating database
system design, performance monitoring, creation of graphical user interfaces, prototyping, etc.
3) Operators and maintenance personnel are the system administration personnel who are
responsible for the actual running and maintenance of the hardware and software environment for
the database system.
Components of ER Model:
1. Entity: An entity is referred to as a real-world object. It can be a name, place, object, class,
etc. These are represented by a rectangle in an ER Diagram.
2. Attributes: An attribute can be defined as the description of the entity. These are represented
by Ellipse in an ER Diagram. It can be Age, Roll Number, or Marks for a Student.
3. Relationship: Relationships are used to define relations among different entities. Diamonds
and Rhombus are used to show Relationships.
3.Semistructured Data Model: This type of data model is different from the other three data
models (explained above). The semi-structured data model allows the data specifications at places
where the individual data items of the same type may have different attributes sets. The Extensible
HKBK DEGREE COLLEGE Prof. PAVAN A V
9
Markup Language, also known as XML, is widely used for representing the semi-structured data.
Although XML was initially designed for including the markup information to the text document,
it gains importance because of its application in the exchange of data.
The overall design of the database is called the database schema. The basic structure of
how the data will be stored in the database is called schema.
Instance changes very frequently whenever data is removed or added in the database. As
against, the changes in schema occurs rarely.
Database schema:
A database schema is a logical representation of data that shows how the data in a
database should be stored logically. It shows how the data is organized and the
relationship between the tables.
Database schema contains table, field, views and relation between different keys
like primary key, foreign key.
Data are stored in the form of files which is unstructured in nature which makes accessing
the data difficult. Thus to resolve the issue the data are organized in structured way with
the help of database schema.
Database schema provides the organization of data and the relationship between the stored
data.
Database schema defines a set of guidelines that control the database along with that it
provides information about the way of accessing and modifying the data.
1. The internal level (physical schema) has an internal schema, which describes the physical
storage structure of the database
The physical level is used to describe complex low level data structures in detail.
The internal schema uses a physical data model an d describes the complete details of
data storage and access paths for the database.
2. The Conceptual level (conceptual schema) 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 operation and constraints.
In the conceptual level, internal details such as an implementation of the data structure
are hidden.
3. The External Level 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.
The view schem a describes the end user interaction with database systems.
Mapping :
Mapping is used to transform the request and response between various database levels
of architecture.
Mapping is not good for small DBMS because it takes more time.
In Conceptual / Internal mapping, DBMS transform the request from the conceptual to
internal level.
Data Independence:
Data independence can be defined as the capacity to change the schema at one level of a
database without having to change the schema at the next higher level.
Database Languages:
In practice, the data definition and data- manipulation languages are not two separate
languages; instead they simply form parts of a single database language, such as the
widely used SQL language.
(a)Procedural DMLs require a user to specify what data are needed and how to get those data.
(b)Declarative DMLs (also referred to as nonprocedural DMLs) require a user to specify what
data are needed without specifying how to get those data.
Declarative DMLs are usually easier to learn and use than are procedural DMLs. However,
since a user does not have to specify how to get the data, the database system has to figure out
an efficient means of accessing data. A query is a statement requesting the retrieval of
information. The portion of a DML that involves information retrieval is called a query
language. Although technically incorrect, it is common practice to use the terms query language
and data-manipulation language synonymously.
Syntax:
SELECT * FROM Table_Name;
EXAMPLE:
The Insert command is used for inserting new data into Table. Now I insert a new
data into ClassMembers Table. Below I provide the example.
Syntax:
INSERT INTO Table_Name (Column 1, Column 2, Column 3, Column 4) VALUES (Value
1, Value 2,Value 3, Value 4);
EXAMPLE:
UPDATE: It is used for update data in the Table based on the requirement.
The Update command is used for update information In the Table. Now I will update name
John Doe to Roman in the ClassMemebers Table. Below I provide that Example you can
update any row or columns data.
Syntax:
UPDATE Table_Name SET Name = 'New_Value' WHERE Name = 'Ola_Value';
EXAMPLE:
Syntax:
DELETE FROM Table_Name WHERE Column = Value;
EXAMPLE:
We specify the storage structure and access methods used by the database system by
a set of statementsin a special type of DDL called a data storage and definition
language.
These statements define the implementation details of the database schemas, which
are usually hidden from the users.
The data valuesstored in the database must satisfy certain consistency constraints.
Below I list out types of database commands that are used in DDL. By using those queries we
can able to perform the DDL on the Database.
Alter It is used for change or alter the structure of the database objects.
CREATE:(Syntax):
ALTER:(Syntax):
DROP:(Syantax):
TRUNCATE : (SYNTAX)
Commit It is used for save the transaction on the Database. And these very useful in
banking sectors.
Rollback It is used for restore the database to original state from last commit. This
command also plays an important role in Banking Sectors.
COMMIT:
ROLLBACK:
Database Architecture:
A database system is partitioned into modules that deal with each of the responsibilities
of the overall system.
The functional components of a database system can be broadly divided into the storage
manager and the query processor components.
The storage manager is important because databases typically require a large amount of
storage space. The query processor is important because it helps the database system
simplify and facilitate access to data.
Query Processor:
DDL interpreter, which interprets DDL statements and records the definitions in the data
dictionary.
DML compiler, which translates DML statements in a query language into an evaluation
plan consisting of low-level instructions that the query evaluation engine understands.
A query can usually be translated into any of a number of alternative evaluation plans
that all give the same result. The DML compiler also performs query optimization, that
is, it picks the lowest cost evaluation plan from among the alternatives.
Query evaluation engine, which executes low-level instructions generated by the DML
compiler.
Storage Manager:
A storage manager is a program module that provides the interface between the lowlevel data
stored in the database and the application programs and queries submitted to the system. The
storage manager is responsible for the interaction with the file manager. The raw data are stored
on the disk using the file system, which is usually provided by a conventional operating system.
The storage manager translates the various DML statements into low-level file-system
commands. Thus, the storage manager is responsible for storing, retrieving, and updating data
in the database.
Authorization and integrity manager, which tests for the satisfaction of integrity
constraints and checks the authority of users to access data.
Transaction manager, which ensures that the database remains in a consistent (correct)
state despite system failures, and that concurrent transaction executions proceed without
conflicting.
File manager, which manages the allocation of space on disk storage and the data
structures used to represent information stored on disk.
Buffer manager, which is responsible for fetching data from disk storage into main
memory, and deciding what data to cache in main memory. The buffer manager is a
critical part of the database system, since it enables the database to handle data sizes that
are much larger than the size of main memory.
Transaction Manager:
That is, if the database was consistent when a transaction started, the database must be
consistent when the transaction successfully terminates.
Transaction - manager ensures that the database remains in a consistent (correct) state
despite system failures (e.g., power failures and operating system crashes) and
transaction failures.
Database interfaces:
A database management system (DBMS) interface is a user interface that allows for the
ability to input queries to a database without using the query language itself. User-friendly
interfaces provided by DBMS may include the following:
Menu-Based Interfaces
Forms-Based Interfaces
Graphical User Interfaces
Natural Language Interfaces
Speech Input and Output Interfaces
Interfaces for Parametric Users
Interfaces for the Database Administrator (DBA)
I. Menu-Based Interfaces
These interfaces present the user with lists of options (called menus) that lead the user
through the formation of a request. The basic advantage of using menus is that they remove
the tension of remembering specific commands and syntax of any query language. The query
is basically composed step by step by collecting or picking options from a menu that is shown
by the system. Pull-down menus are a very popular technique in Web-based interfaces.
Based on data-model
o Network DBMS organizes the data records linked to one another through
pointers, which is an association between records.
Depending on the number of users the DBMS support, it is divided into two categories.
o In single user system, the data resides on one computer and is only accessed by
one user at a time.
o In multi user system, multiple users can access the database at the same time.
Depending on the number of sites over which the database is distributed, it is classified
into two types
centralized database systems run on a single computer system. Both the database and
DBMS software resides at a single computer site.
In distributed databases management system, the database and DBMS software are
distributed over several computers at different sites.
Depending on the purpose the DBMS it can be classified as DBMS is a general purpose
software system.
It DBMS designed for specific purposes such as airline or railway reservations, such
systems cannot be used for other applications.