0% found this document useful (0 votes)
5 views

RDBMS_UNIT1

Rdbms basics ch1

Uploaded by

yoyo36685
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

RDBMS_UNIT1

Rdbms basics ch1

Uploaded by

yoyo36685
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

UNIT – 1

INTRODUCTION TO DATABASE SYSTEM


BASIC CONCEPT

 DATA

 “DATA is a raw fact, anything can be data”.


 It is not be meaningful.
 It is used analysis and reasoning.
 It is input processing unit.
 Data is basic row material which taken by certain observation, certain
experiment and storing in paper, stored memory, human mind.
 Ex:- marks of student ,account information

 INFORMATION
 This is a processed from of data.
 It is always meaningful.
 “Meaningful data is called information”.
 It is output processing units.
 Whenever we organize the data and process is done on it then we get
proper information.
 Example :-

NO. BRANCH STUDENT


1 CE 60
2 EC 50

 Here their data of student branch and no of student study in student.

1
 DATA vs. INFORMATION

DATA INFORMATION

 Data is a raw fact or material  This is processed from the data


 It may not be meaningful  It is always meaningful
 It is used for analysis and reasoning  The result of analysis and reasoning

 It is input processing unit  It is output processing unit


 It may be accurate but not  It is relevant, timely, accurate,
necessarily passes other reliable, concise, and completes
characteristics of information
 Ex: marks of the student 1 account  NO. BRANCH STUDENT
number 1 CE 60
2 ME 50
Information of student, branch and no of
student study in college

 METADATA
 The data structure of database is specifying by database schema and it
called metadata.
 Data that describe the properties or characteristics of other data
 Properties include data definitions, data structures, and rules or
constraints.
 Metadata describe data but not include that data

 SYSTEM CATALOG / DATA DICTIONARY


 A DBMS needs to maintain data about the relations such as the schema
of the relations. This information is called the data-dictionary or system
catalog.
 Data Dictionary is a centralized Repository which consists of the
following information − Name of the tables in the database.
Constraints of a table i.e. keys, relationships, etc. Columns of the
tables that related to each other.
 The types of information that the system must store are these
2
 Name of the relations
 Name of the attributes of each relation
 Domain and lengths of attributes
 Integrity constraints (for ex :- key constraints)

 DATA ITEMS ( FIELDS, ATTRIBUTES, COLUMNS )

 The characteristics of an entity are called fields or attributes or columns.


 Entity can have a number of characteristics like name, address, phone
no. etc.
 Entity is a group of similar information or data.

RECORD ( ROW, TUPLE )

 Multiple fields placed in a horizontal plane are called a record or row or


TUPLE.
 An organization will deal with many clients and the same information
must be recorded for each client multiple fields placed in a horizontal
plane is called a record or row or TUPLE.

 WHAT IS DATABASE???
 The database is a collection of inter-related data which is used to
retrieve, insert and delete the data efficiently.
 It is also used to organize the data in the form of a table, schema,
views, and reports, etc.
 FOR EXAMPLE: The college Database organizes the data about the
admin, staff, students and faculty etc.
 Using the database, you can easily retrieve, insert, and delete the
information.

 DATABASE MANAGEMENT SYSTEM

3
Database management system is software which is used to manage the database.

FOR EXAMPLE:

MySQL, Oracle, Microsoft SQL Server etc are a very popular commercial
database which is used in different applications.

 DBMS provides an interface to perform various operations like database


creation, storing data in it, updating data, creating a table in the database
and a lot more.
 It provides protection and security to the database. In the case of multiple
users, it also maintains data consistency.

 DBMS ALLOWS USERS THE FOLLOWING TASKS……..

 Data Definition: It is used for creation, modification, and removal of

definition that defines the organization of data in the database.

 Data Updation: It is used for the insertion, modification, and deletion of

the actual data in the database.

 Data Retrieval: It is used to retrieve the data from the database which

can be used by applications for various purposes.

 User Administration: It is used for registering and monitoring users,

maintain data integrity, enforcing data security, dealing with concurrency

control, monitoring performance and recovering information corrupted by

unexpected failure.

4
CHARACTERISTICS OF DATABASE
APPROACH
Characteristics of Database Approach: Database approach has been proved
far better than traditional file management system. Database Approach has
many characteristics that make it more robust in nature. Let us discuss the
main Characteristics of Database Approach.

1. Manages Information

 A database always takes care of its information because information is


always helpful for whatever work we do.
 It manages all the information that is required to us. Managing
information by using a database, we become more deliberated user of our
data.

2. Easy Operation Implementation

 All the operations like insert, delete, update, search etc. are carried out in
a flexible and easy way.
 Database makes it very simple to implement these operations.
 A user with little knowledge can perform these operations. This
characteristic of database makes it more powerful.

3. Multiple Views of Database

 Basically, a view is a subset of the database. A view is defined and


devoted for a particular user of the system.
 Different users of the system may have different views of the same
system.
 Every view contains only the data of interest to a user or a group of users.
It is the responsibility of users to be aware of how and where the data of
their interest is stored.
5
4. Data for Specific Purpose

 A database is designed for data of specific purpose.

 FOR EXAMPLE, a database of student management system is designed

to maintain the record of student’s marks, fees and attendance etc. This

data has a specific purpose of maintaining student record.

5. It has Users of Specific Interest

 A database always has some indented group of users and applications in


which these user groups are interested.
 FOR EXAMPLE, in a library system, there are three users, official
administration of the college, the librarian, and the students.

6. Represent Some Aspects of Real World Applications

 A database represents some features of real world applications. Any

change in the real world is reflected in the database.

 If we have some changes in our real applications like railway reservation

system then it will be reflected in database too.

 FOR EXAMPLE, let us take an example of railway reservation system;


we have in our mind some certain applications of maintaining records of
attendance, waiting list, train arrival and departure time, certain day etc.
related to each train.

7. Self Describing nature

 A database is of self describing nature; it always describes and narrates


itself.
 It contains the description of the whole data structure, the constraints and
the variables.
 It makes it different from traditional file management system in which
definition was not the part of application program.
 These definitions are used by the users and DBMS software when
needed.

6
8. Logical Relationship between Records and Data

 A database gives a logical relationship between its records and data.


 So a user can access various records depending upon the logical
conditions by a single query from the database.

7
DATABASE USERS (ACTORS ON SCENE
WORKERS BEHIND THE SCENE)
Based on their interaction with the database, the database users are
divided into two categories:

Actors on the Scene 1. People whose jobs involve the day-to-


(Definition) day use of a large database.

Workers Behind the 1.People whose job involves maintaining


Scene (Definition) the database system environment. i.e.
Database design, Operation,
Development of db system environment
but not interested in database itself .

DATABASE (Actor on the scene)


ADMINISTRATORS
(DBA) 1. In a database environment, the
primary resource is the database itself,
and the secondary resource is the DBMS
and related software.

2. Administering/managing these
resources is the responsibility of the
database administrator (DBA).

3. The DBA is responsible for authorizing


access to the database i.e. they can grant
any permission to the users to access the
database.

4. Coordinating and monitoring its use


and acquiring software and hardware
resources as needed.

8
5. Responsible for Trouble shooting if any
problem arises.
6. To check security issues and so on..

DATABASE DESIGNERS (Actor on the scene)

1. Database designers are responsible for


identifying the data to be stored in the
database and for choosing appropriate
structures to represent and store this
data.

2. These tasks are mostly undertaken


before the database is actually
implemented and populated with data.

3. It is the responsibility of database


designers to communicate with all
prospective database users in order to
understand their requirements and to
create a design that meets these
requirements.

4. Database designers typically interact


with each potential group of users and
develop views of the database that meet
the data and processing requirements of
these groups.

View is a subset of a database and it is


derived from the main database and only
contains data that are required by the
particular user. So database designer
designs view for each group of users
9
then each view is link with other group’s
view so that final database design fulfills
the requirements of all the user groups.

END USERS (Actor on the scene)

People whose job requires access to the


database (querying, updating, generating
reports).

(i).Casual End Users (Actors on the scene)

1. Occasionally access the database,


means they access database not on daily
basis.

2. They access the db only when they


want to querying the data, update the
data or generate the report.

(ii). Naive/Parametric (Actors on the scene)


End Users

1. Most of the end users come under this


category.

2. They Do not know in detail the DBMS


facilities.

3. Their main job function revolves


around constantly querying and updating
the database, using standard types of
queries and updates (called canned
10
transactions) that have been carefully
programmed and tested.
4. For example in Reservation agent of
any Airline or Hotel or Train as per
customer’s request they check the
availability and make the reservations.
On daily basis they use similar set of
functions to make reservations so they
have predefined set of standard queries
to query data they want and update the
database for changes.

5. Many of these tasks are now available


as mobile apps for use with mobile
devices.

(iii). Sophisticated End (Actors on the scene)


Users 1. They are experts and know much
about DBMS facilities to satisfy their
requirements.

2. It includes engineers, scientists,


business analysts, and others who
thoroughly familiarize themselves with
the facilities of the DBMS provide in
order to implement their own
applications to meet their complex
requirements.

(iv). Standalone Users (Actors on the scene)


1.Category of end users
2. They are Expert to Maintain personal
databases by using ready-made program

11
packages.

3. For example. A Person running his


own business keeps the record of his
personal financial data using financial
software for TAX purpose so that he can
maintain own personal db using
readymade package which can be in the
form of menu-based or graphics-based
interfaces.

SYSTEM ANALYSTS AND (Actors on the scene)


APPLICATION
PROGRAMMERS 1. System analysts determine the
(SOFTWARE ENGINEERS) requirements of end users, especially
naive and parametric end users, and
develop specifications for standard
canned transactions that meet these
requirements.

2. Application programmers implement


these specifications as programs; then
they test, debug, document, and
maintain these canned transactions.

3. Such analysts and programmers


(commonly referred to as software
developers or software engineers)
should be familiar with the full range of
capabilities provided by the DBMS to
accomplish their tasks.

DBMS SYSTEM (Workers behind the scene)

12
DESIGNERS AND
IMPLEMENTERS 1. DBMS system designers and
implementers design and implement the
DBMS modules and interfaces as a one
software package.

2. A DBMS is a very complex software


system that consists of many
components, or modules, query
language processing, accessing and
buffering data, controlling concurrency,
and handling data recovery and security
etc.

3. The DBMS must interface with other


system software, such as the operating
system and compilers for various
programming languages
TOOL DEVELOPERS (Workers behind the scene)

1. Person who Design and implement


tools: the software packages (these
packages are optional and can be
purchased separately to improve the
performance of a database system).

OPERATORS AND (workers behind the scene)


MAINTENANCE
PERSONNEL/SYSTEM 1. Are responsible for the actual running
ADMINISTRATION and maintenance of the hardware and
PERSONNEL software for the database system
environment.

13
ADVANTAGES OF USING THE DBMS
APPROACH
Database Management System has many advantages. Some of these advantages
are given below

1. Reducing Data Redundancy

The file based data management systems contained multiple files that were
stored in many different locations in a system or even across multiple systems.

Because of this, there were sometimes multiple copies of the same file which
lead to data redundancy.

This is prevented in a database as there is a single database and any change in it


is reflected immediately. Because of this, there is no chance of encountering
duplicate data.

2. Sharing of Data

In a database, the users of the database can share the data among themselves.

There are various levels of authorisation to access the data, and consequently
the data can only be shared based on the correct authorisation protocols being
followed.

Many remote users can also access the database simultaneously and share the
data between themselves.

3. Data Integrity

Data integrity means that the data is accurate and consistent in the database.

Data Integrity is very important as there are multiple databases in a DBMS.

All of these databases contain data that is visible to multiple users.

So it is necessary to ensure that the data is correct and consistent in all the
databases and for all the users.

14
4. Data Security

Data Security is vital concept in a database. Only authorised users should be


allowed to access the database and their identity should be authenticated using a
username and password.

Unauthorized users should not be allowed to access the database under any
circumstances as it violates the integrity constraints.

5. Privacy

The privacy rule in a database means only the authorized users can access a
database according to its privacy constraints.

There are levels of database access and a user can only view the data he is
allowed to.

For example - In social networking sites, access constraints are different for
different accounts a user may want to access.

6. Backup and Recovery

Database Management System automatically takes care of backup and recovery.

The users don't need to backup data periodically because this is taken care of by
the DBMS.

Moreover, it also restores the database after a crash or system failure to its
previous condition.

7. Data Consistency

Data consistency is ensured in a database because there is no data redundancy.

All data appears consistently across the database and the data is same for all the
users viewing the database.

Moreover, any changes made to the database are immediately reflected to all
the users and there is no data inconsistency.

15
DATABASE SYSTEM CONCEPTS AND
ARCHITECTURE

DATA MODELS
Database systems can be based on different data models or database models
respectively.

 A data model—a collection of concepts that can be used to


describe the structure of a database—provides the necessary
means to achieve this abstraction. By structure of a database
we mean the data types, relationships, and constraints that
apply to the data.
 Most data models also include a set of basic operations for specifying
retrievals and updates on the database.
 Generic operations to insert, delete, modify, or retrieve any kind of object
are often included in the basic data model operations..

 The primary goal of using data model are:

 Ensures that all data objects required by the database are accurately
represented. Omission of data will lead to creation of faulty reports and
produce incorrect results.
 A data model helps design the database at the conceptual, physical and
logical levels.
 Data Model structure helps to define the relational tables, primary and
foreign keys and stored procedures.
 It provides a clear picture of the base data and can be used by database
developers to create a physical database.
 It is also helpful to identify missing and redundant data.

16
 CATEGORIES / TYPES OF DATA MODELS

There are mainly three different types of data models: conceptual data
models, logical data models, and physical data models, and each one have
a specific purpose.

The data models are used to represent the data and how it is stored in the
database and to set the relationship between data items.

1. Conceptual Data Model: This Data Model defines WHAT the


system contains. This model is typically created by Business stakeholders
and Data Architects. The purpose is to organize scope and define business
concepts and rules.

 Conceptual data models use concepts such as entities, attributes, and


relationships.
 An entity represents a real-world object or concept, such as an employee
or a project from the miniworld that is described in the database.
 An attribute represents some property of interest that further describes
an entity, such as the employee’s name or salary.
 A relationship among two or more entities represents an association
among the entities, for example, a works-on relationship between an
employee and a project.
 The entity–relationship model—a popular high-level conceptual data
model.

2. Logical Data Model: Defines HOW the system should be


implemented irrespective of DBMS. This model is typically created by
Data Architects and Business Analysts. The purpose is to developed
technical map of rules and data structures.

17
3. Physical Data Model: This Data Model describes HOW the system
will be implemented using a specific DBMS system. This model is
typically created by DBA and developers. The purpose is actual
implementation of the database for E.g Create Schemas.

18
19
SCHEMAS, INSTANCES, AND DATABASE STATE
SCHEMAS: https://www.youtube.com/watch?v=R6-zHd5-eoI
 The description of a database is called the database schema, which is
specified during database design.
 Includes descriptions of the database structure, data types, and the
constraints on the database.
 Schema Construct:
o A component of the schema or an object within the schema, e.g.,
STUDENT, COURSE is called Schema Construct.

DATABASE STATE / SNAPSHOT / INSTANCE:


 The data in the database at a particular moment in time is called
instance/database state.

1. Empty state: the database state with no data


2. Initial state: the database is first populated or loaded with the initial
data
3. Current state: every time an update operation is applied to the
database, we get another database state
4. valid state: a state that satisfies the structure and constraints specified
in the schema

 The schema is sometimes called the intension, and a database state is


called an extension of the schema.
 Schema evolution: changes occasionally need to be applied to the
schema as the application requirements change
 For example, the STUDENT construct will contain the set of individual
student entities (records) as its instances.
 Every time we insert or delete a record or change the value of a data item
in a record, we change one state of the database into another state.

20
 Example of a Database Schema diagram

 Example of a database state

21
THREE-SCHEMA ARCHITECTURE
The Goal of Three Schema Architecture is to separate the user application and
physical database. User applications resides at the top level and physical
database is at the lowest level.

In this architecture, schemas can be defined at the following three levels:

1. Internal Level – Uses Internal schema at the internal level.


 It Describe physical storage structure of the database.
 Describe complete details of the data storage and access
 Typically uses a physical data model.

2. Conceptual Level – Uses Conceptual schema at the conceptual level.


 It uses a conceptual or an implementation data model.
 The conceptual schema hides the details of physical storage
structures and concentrates on describing entities, data types,
relationships, user operations, and constraints.
3. External Level – Uses External schemas (or User Views) at the
external level.
 It describes the various user views.
 Usually uses the same data model as the conceptual schema.
 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.
22
So this is about three levels and because of three levels it refers to as Three-
schema Architecture.

In the three-schema architecture, each user group refers to its own external
schema.

Hence, the DBMS must transform a request specified on an external schema


into a request against the conceptual schema, and then into a request on
the internal schema for processing over the stored database.

Programs refer to an external schema, and are mapped by the DBMS to the
internal schema for execution.

Data extracted from the internal DBMS level is reformatted to match the
user’s external view (e.g. formatting the results of an SQL query display in a
Web page

If the request is database retrieval, the data extracted from the stored
database must be reformatted to match the user’s external view.

The processes of transforming requests and results between three levels


are called mappings.

23
DATA INDEPENDENCE

Data independence, which can be defined as the capacity to change


the schema at one level of a database system without having to change
the schema at the next higher level.

There are two types of data independence:

1. Logical Data Independence:


 The capacity to change the conceptual schema without having to
change the external schemas and their associated application
programs.
 We may change the conceptual schema to expand the database
(by adding a record type or data item), to change constraints, or
to reduce the database (by removing a record type or data item).

2. Physical Data Independence:


 The capacity to change the internal schema without having to
change the conceptual schema.
 For example, the internal schema may be changed when certain
file structures are reorganized or to change in file location or
access path etc.

When a schema at a lower level is changed, only the mappings between


this schema and higher-level schemas need to be changed in a DBMS that
fully support data independence.

The higher-level schemas themselves are unchanged. Hence, the


application programs need not be changed since they refer to the external
schemas.

24
 DATABASE LANGUAGES AND DATABASE
INTERFACES

DATABASE LANGUAGES

DDL (Data Definition Language)

For describing data and data structures a suitable description tool, a data
definition language (DDL), is needed. With this help a data scheme can be
defined and also changed later.

Typical DDL operations (with their respective keywords in the structured


query language SQL):
• Creation of tables and definition of attributes (CREATE TABLE ...)
• Change of tables by adding or deleting attributes (ALTER TABLE ...)
• Deletion of whole table including content (!) (DROP TABLE ...)

DML (Data Manipulation Language)


Additionally a language for the descriptions of the operations with data like
store, search, read, change, etc. the so-called data manipulation, is
needed. Such operations can be done with a data manipulation language
(DML). Within such languages keywords like insert, modify, update, delete,
select, etc. are common.

Typical DML operations (with their respective keywords in the structured


query language SQL):
• Add data (INSERT)
• Change data (UPDATE)
• Delete data (DELETE)
• Query data (SELECT)

25
Often these two languages for the definition and manipulation of databases
are combined in one comprehensive language.

A good example is the structured query language SQL which is discussed in


detail in lesson Structured Query Language (SQL).

DBMS INTERFACES
User-friendly interfaces provided by a DBMS may include the following:

 Menu-based Interfaces for Web Clients or Browsing


 Apps for Mobile Devices.
 Forms-based Interfaces.
 Graphical User Interfaces
 Natural Language Interfaces.
 Speech Input and Output.
 Interfaces for Parametric Users
 Interfaces for the DBA

Menu-based Interfaces for Web Clients or Browsing

 These interfaces present the user with lists of options (called menus)
that lead the user through the formulation of a request.

Apps for Mobile Devices

 These interfaces present mobile users with access to their data. For
example, banking, reservations, and insurance companies, among
many others, provide apps that allow users to access their data
through a mobile phone or mobile device.
 The apps have built-in programmed interfaces that typically allow
users to login using their account name and password; the apps then
provide a limited menu of options for mobile access to the user data,

26
as well as options such as paying bills (for banks) or making
reservations (for reservation Web sites).

Forms-based Interfaces

 A forms-based interface displays a form to each user.


 Users can fill out all of the form entries to insert new data, or they can
fill out only certain entries, in which case the DBMS will retrieve
matching data for the remaining entries.
 Forms are usually designed and programmed for naive users as
interfaces to canned transactions.

Graphical User Interfaces

 A GUI typically displays a schema to the user in diagrammatic form.


 The user then can specify a query by manipulating the diagram.
 In many cases, GUIs utilize both menus and forms.

Natural Language Interfaces

 These interfaces accept requests written in English or some other


language and attempt to understand them.
 A natural language interface usually has its own schema, which is
similar to the database conceptual schema, as well as a dictionary of
important words.
 The natural language interface refers to the words in its schema, as
well as to the set of standard words in its dictionary, that are used to
interpret the request.

Speech Input and Output

 Limited use of speech as an input query and speech as an answer to a


question or result of a request is becoming common place.

27
 Applications with limited vocabularies, such as inquiries for
telephone directory, flight arrival/departure, and credit card account
information, are allowing speech for input and output to enable
customers to access this information.
 The speech input is detected using a library of predefined words and
used to set up the parameters that are supplied to the queries.
 For output, a similar conversion from text or numbers into speech
takes place.

Interfaces for Parametric Users

 Parametric users, such as bank tellers, often have a small set of


operations that they must perform repeatedly.
 For example, a teller is able to use single function keys to invoke
routine and repetitive transactions such as account deposits or
withdrawals, or balance inquiries.

Interfaces for the DBA

 Most database systems contain privileged commands that can be


used only by the DBA staff.
 These include commands for creating accounts, setting system
parameters, granting account authorization, changing a schema, and
reorganizing the storage structures of a database.

28
DATABASE SYSTEM
ENVIRONMENT
The database system environment is comprised of the components that are
meant for defining and managing the data that we collect, store, manage and
use in the database environment.

DBMS Component Modules

29
The figure is divided into two parts.

 The top part of the figure refers to the various users of the database
environment and their interfaces.

 The lower part shows the internal modules of the DBMS responsible
for storage of data and processing of transactions.

We will discuss in detail the types of DBMS components/ modules as shown


in the diagram…

Once the database design is completed, the schema has to be defined by the
Database Administrator/the Database designers.

So the DBA staff uses database definition Language (DDL) to specify these
schemas.

The DBA staff works on defining the database and tuning it by making
changes to its definition using the DDL and other privileged
commands.

Casual users who work with interactive interfaces to formulate queries.

Application programmers who create/ write programs using some host


programming languages like C,C++,Java etc.

Parametric users who do data entry work by supplying parameters to


predefined transactions.

DDL compiler -
It Processes the schema definition (which is specified in DDL) - Store the
schema definition/description in the catalog (Catalog contains the details of file
size, data type, Storage of files, Constraints etc).

Modules at the top of the diagram access this catalog whenever required.

30
Query Compiler -
It handles the high level queries, this query compiler analyzes and interprets
the queries by creating the database access code then it calls the runtime
database processor to executing that code.

 The query optimizer is concerned with the rearrangement and


possible reordering of operations, elimination of redundancies,
and use of efficient search algorithms during execution.

Pre-Compiler -
It Extracts the DML commands from an application program written in a host
programming languages like C, C++ and Java etc.

These Extracted DML commands are sent to the DML Compiler.

DML Compiler -
The Compilation of DML Commands into an Object Code for access to the
database. So here the DML Compiler Extract the DML commands in object
code and other than the DML commands the rest of the program send to the
Host Language Compiler.

Host-Language Compiler -
Then the Object code and rest of the program are linked together to form the
compiled or the Canned Transactions (Canned transitions are used by the
parametric or naïve End-users).

Compiled Transactions -
This compiled or the Canned Transition then generates a call to the Runtime
database Processor.

Runtime Database Processor -


31
It handles any kind of database accesses at the runtime. It receives Retrieval
or Update requests and it carries them on the store database. Finally we have
the store data Manager.

Store Data Manager -


This module of DBMS controls access to the information that is stored on the
disk and this module carry out data transfer between the disk and the main
memory. Once the data is in main memory it can be processed by other DBMS
modules and also it can be processed by the application programs.

This is all about the different Component Modules of DBMS.

In addition to these modules most DBMS have Database System Utilities that
help the DBA to manage the database system.

32
DATABASE UTILITIES

1. Loading Utility

 Used to load Existing data file into the database.


 The Source File Format and Target data file structure are mentioned
in to the utility. And based on that the utility reformats the data and
stores it into the database.

2. Backup Utility

 Creates the backup copy of the database and with this back up copy
we can restore the database in case of any kind of system failure.
 Incremental backups are often used. In incremental backups only
changes since the previous backup are recorded.

3. File Reorganization Utility

 Used to reorganize database file into a different file organization. It is


required to improve performance.

4. Performance Monitoring

 As the name suggest monitors the database usage and provides


statistics to the DBA.
 Based on this Statistics the DBA decides whether or not to
reorganizes a files to improve performance

33
DBMS ARCHITECTURE

 A Database Architecture is a representation of DBMS design. It


helps to design, develop, implement, and maintain the database
management system.
 DBMS architecture allows dividing the database system into
individual components.

 The DBMS design depends upon its architecture. The basic


client/server architecture is used to deal with a large number of PCs,
web servers, database servers and other components that are
connected with networks.
 DBMS architecture depends upon how users are connected to the
database to get their request done.
 A client in this framework is typically a user machine that provides
user interface capabilities and local processing.
 A Server is a system which contains both Hardware and Software
which provides services to client Machines like file access, printing
and database access.

Types of DBMS Architecture


 1-Tier Architecture
 2-Tier Architecture
 3-Tier Architecture

1-Tier Architecture
 1 Tier Architecture in DBMS is the simplest architecture of
Database in which the client, server, and Database all reside on the
same machine.

34
 A simple one tier architecture example would be anytime you install
a Database in your system and access it to practice SQL queries. But
such architecture is rarely used in production.

2-Tier Architecture

 A 2 Tier Architecture in DBMS is a Database architecture where the


presentation layer runs on a client (PC, Mobile, Tablet, etc.), and data
is stored on a server called the second tier.
 Two tier architecture provides added security to the DBMS as it is not
exposed to the end-user directly.
 It also provides direct and faster communication.

35
 In the above 2 Tier client-server architecture of database
management system, we can see that one server is connected with
clients 1, 2, and 3.

Two Tier Architecture Examples:

 A Contact Management System created using MS- Access

3-Tier Architecture

 3 Tier Architecture in DBMS is the most popular client server


architecture in DBMS in which the development and maintenance of
functional processes, logic, data access, data storage, and user
interface is done independently as separate modules.
 3 Tier architecture contains a presentation layer, an application
layer, and a database server.
 3-Tier database Architecture design is an extension of the 2-tier
client-server architecture.
 A 3-tier architecture has the following layers:

1. Presentation layer (your PC, Tablet, Mobile, etc.)


2. Application layer (server)
3. Database Server

36

user
client Presentation Tier

application client

Application Tier
network

application server

Database Tier
database system
Server

Database(Data) Tier

 At this tier, only database resides.


 Database along with its query processing languages sits in layer-3 of
3-tier architecture.
 It also contains all relations and their constraints.

Application (Middle) Tier


 At this tier, the application server and program, which access
database, resides.
 For a user this application tier works as abstracted view of database.
 Users are unaware of any existence of database beyond application.
 For database-tier, application tier is the user of it.
 Database tier is not aware of any other user beyond application tier.
 This tier works as mediator between the two.

User (Presentation) Tier

 An end user sits on this tier.


 From a user’s aspect, this tier is everything.
 He/she doesn't know about any existence or form of database beyond
37
this layer.
 At this layer multiple views of database can be provided by the
application.
 All views which are generated by an application, resides in
application tier.

The goal of 3- Tier client-server architecture is:

 To separate the user applications and physical database


 To support DBMS characteristics
 Program-data independence
 Supporting multiple views of the data

Three Tier Architecture Examples:

Any large website on the internet, including guru99.com.

Summary

 An Architecture of DBMS helps in design, development,


implementation, and maintenance of a database
 The simplest database system architecture is 1 tier where the Client,
Server, and Database all reside on the same machine
 A two-tier architecture is a database architecture in DBMS where
presentation layer runs on a client and data is stored on a server
 Three-tier client-server architecture consists of the Presentation
layer (PC, Tablet, Mobile, etc.), Application layer (server) and
Database Server

38
TYPES OF DATABASES/ CLASSIFICATION OF
DBMS

Classification of DBMS Based on the data model used


 Traditional: Relational, Network, Hierarchical.

 Emerging: Object-oriented, Object-relational.

 Other classifications based on the number of users supported by the


system.

 Single-user systems support only one user at a time and are


mostly used with PCs.

 Multiuser systems, which include the majority of DBMSs,


support concurrent multiple users.

 The third criterion is the number of sites over which the


database is distributed.

 DBMS is centralized if the data is stored at a single computer


site. A centralized DBMS can support multiple users, but the
DBMS and the database reside totally at a single computer site.

 A distributed DBMS (DDBMS) can have the actual database


and DBMS software distributed over many sites connected by a
computer network. Big data systems are often massively
distributed, with hundreds of sites. The data is often replicated

39
on multiple sites so that failure of a site will not make some
data unavailable.

 Homogeneous DDBMSs use the same DBMS software at


all the sites, whereas

 Heterogeneous DDBMSs can use different DBMS


software at each site.

1) Relational Database

 This database is based on the relational data model, which stores


data in the form of rows(tuple) and columns(attributes), and
together forms a table(relation).
 A relational database uses SQL for storing, manipulating, as well as
maintaining the data.
 E.F. Codd invented the database in 1970.
 Each table in the database carries a key that makes the data unique
from others.
 Examples of Relational databases are MySQL, Microsoft SQL Server,
Oracle, etc.

In the above student table Std ID, Name and city are called as attributes and their values.
Std ID is a primary key attribute which uniquely identifies each record in the student
table.

40
 ACID Properties of Relational Database
There are following four commonly known properties of a relational model
known as ACID properties, where:

A means Atomicity:

This ensures the data operation will complete either with success or with
failure.

It follows the 'all or nothing' strategy. For example, a transaction will either
be committed or will abort.

C means Consistency:

If we perform any operation over the data, its value before and after the
operation should be preserved.

For example, the account balances before and after the transaction should
be correct, i.e., it should remain conserved.

I means Isolation:

There can be concurrent users for accessing data at the same time from the
database.

Thus, isolation between the data should remain isolated. For example,
when multiple transactions occur at the same time, one transaction effects
should not be visible to the other transactions in the database.

D means Durability: It ensures that once it completes the operation


and commits the data, data changes should remain permanent.

41
 Entity-Relational model

 Models an enterprise as a collection of entities and relationships


 Entity: a “thing” or “object” in the enterprise that is
distinguishable from other objects
E.g. each person is an entity, bank account is an entity.

 Attribute: Described by a set of attributes


E.g. the attributes account-number and balance describes one
particular account

 Relationship: an association among several entities


E.g. Depositor relationship associates a customer with each
account

 Entity set and Relationship: The set of all entities of the same type
are called entity set and the set of relationship of the same type
are called the relationship set.
 Represented diagrammatically by an entity-relationship diagram:

(A sample E-R diagram)

 Rectangles, which represent entity sets


 Ellipses, which represent attributes
 Diamonds, which represent relationships among entity sets
 Lines, which link attributes to entity sets and entity sets to
relationships

Each component is labelled with the entity or the relationship that it


represents.

42
2) Object Oriented Database
It is a system where information or data is represented in the form of
objects which is used in object-oriented programming.

 It is a combination of relational database concepts and object-


oriented principles.
 Relational database concepts are concurrency control, transactions,
etc.
 OOPs principles are data encapsulation, inheritance, and
polymorphism.
 It requires less code and is easy to maintain.
 For example − Object DB software.

The object oriented database is represented in diagram format below –

3) Hierarchical Databases
 It is the type of database that stores data in the form of parent-
children relationship nodes. Here, it organizes data in a tree-like
structure.

43
 It is a system where the data elements have a one to many
relationship (1: N). Here data is organized like a tree which is similar
to a folder structure in your computer system.
 The hierarchy starts from the root node, connecting all the child
nodes to the parent node.
 It is used in industry on mainframe platforms.

Data get stored in the form of records that are connected via links. Each
child record in the tree will contain only one parent. On the other hand,
each parent record can have multiple child records.

44
FOR EXAMPLE:

4) Network Databases
 It is the database that typically follows the network data model. Here,
the representation of data is in the form of nodes connected via links
between them.
 Unlike the hierarchical database, it allows each record to have
multiple children and parent nodes to form a generalized graph
structure.
 A Network database management system is a system where the data
elements maintain one to one relationship (1: 1) or many to many
relationship (N: N).
 It also has a hierarchical structure, but the data is organized like a
graph and it is allowed to have more than one parent for one child
record.
45
FOR EXAMPLE

Teachers can teach in multiple departments. This is shown below −

46

You might also like