DBMS Unit 1
DBMS Unit 1
Changes at the internal level may or may not be When the database's logical structure needs to be
required to increase the overall performance of modified, the changes made at the logical level are
the database. crucial.
In most cases, a change at the physical level If new fields are added or removed from the
does not necessitate a change at the application database, then updates are required to be made in
program level. the application software.
The below diagram shows the typical structure of a database management system. A
Database Management System has three major components:
• Query Processor
• Storage Manager
• Disk Storage.
Query Processor
The Query Processor receives the queries (requests) from the user and interprets
them in the form of instructions. It also executes the instructions received from the
DML Compiler. It has the following four components:
1. DML Compiler: It converts the DML (Data Manipulation Language)
Instructions into Machine Language (low-level language).
2. DDL Interpreter: It interprets the DDL (Data Definition Language)
Instructions and stores the record in a data dictionary (in a table containing
meta-data)
3. Query Optimizer: It executes the DML Instructions and picks the lowest cost
evaluation plan out of all the alternatives present.
4. Embedded DML Pre-compiler: It translates the DML statements embedded
in Application Programs into procedural function calls.
Storage Manager
Storage manager acts as the interface between the data stored in the database and the
queries received from the end-user. This component in the Structure of DBMS is
responsible for the constraints applied to the data so that it remains consistent. It also
executes the DCL (Data Control Language). It encapsulates the following modules:
1. Authorization and Integrity Manager: It checks the authority of various
users who access data and the Integrity Constraints of the database.
Disk Storage
The Disk Storage in the Structure of DBMS represents the space where data is
stored. It has the following components:
1. Files: These are responsible for storing the data.
2. Data Dictionary: It is the repository that maintains the information of the
database object and maintains the metadata.
3. Indices: These are the keys that are used for faster retrieval of data.
Thus, the Structure of DBMS represents the functional modules that are employed to
process the queries received from the user, retrieve the data, maintain the changes in
the database and optimize the data retrieval.
For example, If there are n-tier architecture, then it will contain n-layers in it to
represent the database. Like, a 1-tier architecture splits the DBMS into a single layer,
a 2-tier architecture divides the DBMS into two layers, a 3-tier architecture into three
layers, and so on. Consequently, an n-tier DBMS Architecture separates the entire
DBMS into related but n-independent layers or levels. The complexity of the DBMS
structure and its level of security rise as the layers in the architecture go higher because
of the rising level of abstraction.
Let’s now discuss the three tiers of architecture used in the current systems of the
databases:
The client, server, and database are all located on the same system in a 1-tier
architecture, where the user can access the database directly on the DBMS without
any method or access.
Features:
• The simplest form of architecture.
• The database application logic and the user interface are all located on a single
machine.
• The client can directly access the database without any access restrictions.
• It is suitable for small applications but not for large-scale applications.
• It provides the best performance in small applications.
Disadvantages:
• As the user can directly access the database any unauthorised user can modify
the database.
• The 1-tier architecture is not scalable for multi-user or large-scale applications.
In a two-tier architecture, the client can communicate with the server to process user
queries and access the data from the database. A 2-tier architecture is also known as a
connection-oriented architecture because the client has to first establish a connection
to communicate with the server and then the transfer of data to a database is
performed.
Features:
• It consists of a client and server that interact with the database systems.
Advantages:
• It is useful for small and medium applications where there are a limited number
of users.
• It provides scalability.
• It is the simplest form of architecture compared to three-tier architecture.
• It uses less cost as compared to a 3-tier or another-tier architecture.
• It is very simple to implement.
Disadvantages:
• The two-tier architecture is not useful for large-scale applications and has a very
large number of users.
• It requires connection, and it is dependent on the network.
• Adding more clients requires more server performance, thereby representing
limited scalability.
Disadvantages of ER Model
Entity set
It is a collection of entities of the same type which share similar
properties. For example, a group of students in a college and
students are an entity set
a. Strong entity set: The entity types which consist of key attributes
or if there are enough attributes for forming a primary key attribute
are called a strong entity set. It is represented by a single rectangle.
b. Weak entity set: An entity does not have a primary key attribute
and depends on another strong entity via foreign key attribute. It is
represented by a double rectangle.
Types of attributes
The types of attributes in the Entity Relationship (ER) model are as
follows:
1. Single value attribute − these attributes contain a single value. For
example, age, salary etc.
2. Key Attributes- The key attribute is used to represent the main
characteristics of an entity. It represents a primary key. The key
attribute is represented by an ellipse with the text underlined
3. Relationships
A relationship is used to describe the relation between entities.
Diamond or rhombus is used to represent the relationship.
3.Ternary Relationship:
• A ternary relationship exists when exactly three entity type
participates. When such a relationship is present we say
that the degree is 3.
• As the number of entity increases in the relationship, it
becomes complex to convert them into relational tables.
Mapping Constraints:
Specialization
• Itis a top-down approach, and it is opposite to Generalization. In
specialization, one higher level entity can be broken down into two lower
level entities.
• Specialization is used to identify the subset of an entity set that shares some
distinguishing characteristics.
• Normally, the superclass is defined first, the subclass and its related attributes
are defined next, and relationship set are then added.