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

DBMS-UNIT1

The document provides an overview of Database Management Systems (DBMS), explaining the importance of data organization and management in computerized information systems. It discusses the definitions of data, information, files, and the advantages and disadvantages of both file-oriented approaches and DBMS. Additionally, it covers various types of DBMS architectures, data independence, and the roles of users and administrators within a DBMS environment.

Uploaded by

Nishath Ashraf
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

DBMS-UNIT1

The document provides an overview of Database Management Systems (DBMS), explaining the importance of data organization and management in computerized information systems. It discusses the definitions of data, information, files, and the advantages and disadvantages of both file-oriented approaches and DBMS. Additionally, it covers various types of DBMS architectures, data independence, and the roles of users and administrators within a DBMS environment.

Uploaded by

Nishath Ashraf
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

DBMS

Introduction:
In computerized information system data is the basic resource of the organization. So, proper
organization and management for data is required fro organization to run smoothly. Database
management system deals the knowledge of how data stored and managed on a computerized
information system. In any organization, it requires accurate and reliable data for better
decision making, ensuring privacy of data and controlling data efficiently.

What is Data?
Data is a collection of raw, unorganised facts and details like text,number, observations,
figures, symbols and descriptions of things etc.
Information:
Information is the processed data on which decisions and actions are based. Information can
be defined as the organized and classified data to provide meaningful values.

File:
File is a collection of related data stored in secondary memory.

File Oriented approach:

The traditional file oriented approach to information processing has for each application a
separate master file and its own set of personal file.

Disadvantages of file oriented approach:

1) Data redundancy and inconsistency:


The same information may be written in several files. This redundancy leads
to higher storage and access cost. It may lead data inconsistency.

2) Difficulty in accessing data :


The conventional file processing system do not allow data to retrieved in a
convenient and efficient manner according to user choice.

3) Data isolation :
Because data are scattered in various file and files may be in different formats
with new application programs to retrieve the appropriate data is difficult.

4) Integrity Problems:
Developers enforce data validation in the system by adding appropriate code
in the various application program. How ever when new constraints are added,
it is difficult to change the programs to enforce them

1
.
5) Atomicity:
It is difficult to ensure atomicity in a file processing system when transaction
failure occurs due to power failure, networking problems etc.
(atomicity: either all operations of the transaction are reflected properly in the
database or non are)

6) Concurrent access:
In the file processing system it is not possible to access a same file for
transaction at same time

7) Security problems:
There is no security provided in file processing system to secure the data from
unauthorized user access.

Database:
A database is organized collection of related data of an organization stored in formatted way
which is shared by multiple users.

OR

A data base is a collection of logical related data that is organized and recorded in suitable
format.

Database Management System(DBMS)


A DBMS is a software in which helps the user to perform all related operations such as
defining, sorting, retrieving and modifying information from a database.

Function of DBMS:
 Defining database schema: it must give facility for defining the database structure
also specifies access rights to authorized users.
 Manipulation of the database: The dbms must have functions like insertion of
record into database updation of data, deletion of data, retrieval of data
 Sharing of database:The DBMS must share data items for multiple users by
maintaining consistency of data.
 Protection of database: It must protect the database against unauthorized users.
 Database recovery: If for any reason the system fails DBMS must facilitate data base
recovery.

Advantages of DBMS
1. Data sharing and multiple access: Data must be sharable since different users
present at different physical locations, also a large number of operations may be
common to the different user groups.
2. Data consistency: to process data into useful information. A DBMS allows different
class of users to access and manipulate different portions of data in the database.
3. Reliability: The data base in use should be protected from major failures. A possible
solution will be to backup the entire database at regular intervals.
2
4. Data security: Security is a concept used to protect the data base contents from
accidental damage.
5. Flexibility: The addition of new types of data to a data base causes major changes to
the existing applications then the data base is flexible to change.
6. Integration: If the data base is integrated properly then it is possible for us to share
common and important information which can be shared among different application.
7. Data redundancy: Redundancy is a concept where the same data gets repeated in
various portions of the database due to certain inconsistent operations. Control in
redundancy is the basic necessity of any database.

Disadvantages of Database Management Systems:


1. Cost: The cost basically includes cost for development, cost to upgrade the hardware & the
cost to maintain the system.
2. Additional processing: Additional processing is involved to implement concepts such as
data integrity, data security, and data sharing and so on.
3. Complexity processor: Centralization eliminates the concept of data redundancy, complex
procedures have to be used to incorporate concepts of backup and recovery.

Why Database:
In order to overcome the limitation of a file system, a new approach was required. Hence a
database approach emerged. A database is a persistent collection of logically related data.
The initial attempts were to provide a centralized collection of data. A database has a self
describing nature. It contains not only the data sharing and integration of data of an
organization in a single database.

A small database can be handled manually but for a large database and having multiple users
it is difficult to maintain it, In that case a computerized database is useful.

Data Independence:

Data independence is usually considered from two points of views; physically data
independence and logical data independence.

Physical data Independence allows changes in the physical storage devices or organization
of the files to be made without requiring changes in the conceptual view or any of the xternal
views and hence in the application programs using the data base.

Logical data independence indicates that the conceptual schema can be changed without
affecting the existing external schema or any application program

The database approach.

3
The database approach is an improvement on the shared file solution as the use of a database
management system (DBMS) provides facilities for querying, data security and integrity,
and allows simultaneous access to data by a number of different users.

Characteristics of database approach :


Some of the most important characteristics of the database approach to the file processing
approach are the following as follows.
Self-Describing Nature of a Database System :
 This definition is stored within the DBMS catalog, which contains information like
the structure of every file, the sort and storage format of every data item, and
various constraints/rules on the information.

Isolation between Programs and Data, and Data Abstraction :


 In a traditional file processing system, the structure of database knowledge files is
embedded within the application programs, so any changes to the structure of a
file may require changing all programs that access that file.

 The characteristic that allows program-data independence and program-operation


independence is known as data abstraction.

Support for Multiple Views of the Data :


 A database sometimes has many users, each of whom may require a special
perspective or view of the database.

Sharing of knowledge and Multi-user Transaction Processing :


 A multi-user DBMS, as its name implies, must allow multiple users to access the
database at an equivalent time or concurrently.

People associated with Database system.(Users in DBMS)


There are four distinct types of people that participate in the DBMS environment:
data and database administrators(DBA), database designers(System Analyst),
application developers(Application programmers), and the end-users.

 End user :- The users who deal with the database at the terminal end they can be
casual users or native database user.
 Application programmers- The users who develop the applications in different
languages (Java, .net, Cobol, php etc.) to interact with database.
 System Analyst- – System Analyst is responsible for overall technical, economical
and feasibility aspects of the DBMS.
 Database administrators- everything related to DBMS like policies and strategies is
handled by the DBA. DBA can be a single person or group of many persons.
 Sophisticated Users- They are the SQL programmers, who deal directly with the
database. They write queries to delete/select/insert and update the database.
4
Database Administration :
A person who has central control over the system is called database administrator .

The function of DBA are :


1. creation and modification of conceptual Schema definition
2. Implementation of storage structure and access method.
3. schema and physical organization modifications .
4. granting of authorization for data access.
5. Integrity constraints specification.
6. Execute immediate recovery procedure in case of failures
7. ensure physical security to database

Examples of DBMS
DBMS is widely used by approximately all the companies and there are loads of examples
present there. According to their requirements, large as well as small companies use DBMS
to manage their data. Here are some of the examples of DBMS:

 MySQL Database: It was founded in the year 1995. MySQL was acquired by Sun
Microsystems in 2008 and the sun Microsystems was acquired by Oracle after two
years. MySQL is one of the largest open-source companies in the world and is
popular due to its high level of efficiency, reliability and cost.
 MS-Access: It was developed by Microsoft and this computer-based application is
used to form as well as create the databases on the desktop of the computers. It can be
used for personal work and for small scale business that required a database. It is easy
as it uses the graphical user interface.
 Oracle database: It is the fourth relational database management system which is
developed by Oracle Corporation. Oracle database is useful for storing a large amount
of data, especially by large organizations. Moreover, it is very flexible and very
beneficial for shared SQL and locking.
 DB2: It was founded by IBM Corporation and is lucrative to store data for big
industries. It is also a relational database management system and the extended
version of DB2 supports object-oriented features. However, this one is very expensive
that is a big problem.
 Microsoft SQL Server: As the name indicates, it is an RDBMS from Microsoft
company which creates computer databases for MS- Windows. Based on customer’s
requirements, Microsoft has developed various versions of SQL Server.

Data Models in DBMS


Concepts Relational Network Model Hierarchic
Model Model
Meaning Data is stored in Data is arranged Data is arranged
rows and in graphical in a tree- like
columns in the manner with structure.
table. child and parent
graph.
5
Item Role name or Data item type Item or Field
Domain
Item Value Component Data item Value
occurrence
Group Not Allowed Group Group
Type of entity Relation Record type Entry or
Segment type
Entity Instance Tuple Record Entry or
occurrence Segment
occurrence
Relationship Foreign key Set type Hierarchic
comparable
underlying
domains
Relationship Set Occurrence Assembly
instance
Data Data model Logical structure Logical structure
Administrator
view
Definition of data Data Model Schema Schema
administrator definition
view
User View Data sub model
Definition of user Data sub model Sub Schema Sub Schema
view definition
Data-base Area
subdivision
Entry points Primary Key Singular sets Root Group
CALC records
Single unique or Candidate Key Key Root segment
Identifier sequence
(unique)

Database Basics:

Data item:
The data item is also called as field in data processing and is the smallest unit of data
that has meaning to its users. Eg: “e101”,”sumit”

Entities and attributes:


An entity is a thing or object in the real world that is distinguishable from all other
Objects. Eg:Bank,employee,student

Attributes are properties are properties of an entity. Eg:Empcode,ename,rolno,name

6
Data independence

Data independence is usually considered from two points of views;


Physically data independence and
logical data independence.

Physical data Independence allows changes in the physical storage devices or organization
of the files to be made without requiring changes in the conceptual view or any of the
external views and hence in the application programs using the data base.

Logical data independence indicates that the conceptual schema can be changed without
affecting the existing external schema or any application program.

Logical data and physical data :


Logical data are the data for the table created by user in primary memory.
Physical data refers to the data stored in the secondary memory.

What is Database Architecture?


A Database Architecture is a representation of DBMS design. It helps to design, develop,
implement, and maintain the database management system. A DBMS architecture allows
dividing the database system into individual components that can be independently modified,
changed, replaced, and altered. It also helps to understand the components of a database.

A Database stores critical information and helps access data quickly and securely. Therefore,
selecting the correct Architecture of DBMS helps in easy and efficient data management.

Types of DBMS Architecture

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

Types of DBMS Architecture(Client/Server Architecture)


A Client is requesting machine and the Server is supplying(serve the request) the machine . both are
connected through network is referred as Client Server 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. 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.

7
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.

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.

3-Tier Architecture
A 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. Three 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

8
The Application layer resides between the user and the DBMS, which is responsible for
communicating the user’s request to the DBMS system and send the response from the DBMS to the
user. The application layer(business logic layer) also processes functional logic, constraint, and rules
before passing data to the user or down to the DBMS.

The goal of Three 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

Schema and sub-schema

A schema is a logical data base description(structure of data) and is drawn as a chart of the
types of data that are used . It gives the names of the entities and attributes and specify the
relationships between them.

A database schema includes such information as :


 Characteristics of data items such as entities and attributes .
 Logical structures and relationships among these data items .
 Format for storage representation.
 Integrity parameters such as physical authorization and back up policies.

A subschema is derived schema derived from existing schema as per the user requirement.
There may be more then one subschema create for a single conceptual schema.

Three level architecture of DBMS :


A database management system that provides three level of data is said to follow threelevel
architecture .
 External level
 Conceptual level
 Internal level

The external level is at the highest level of database abstraction . At this level, there will
be many views define for different users requirement. A view will describe only a subset
of the database. Any number of user views may exist for a given global or subschema.

Conceptual level :
At this level of database abstraction all the database entities and the relationships among them
are included . One conceptual view represents the entire database . This conceptual view is
defined by the conceptual schema. The conceptual schema hides the details of physical
storage structures and concentrate on describing entities , data types, relationships, user
operations and constraints.

9
Internal level :
It is the lowest level of abstraction closest to the physical storage method used .
It indicates how the data will be stored and describes the data structures and access
methods to be used by the database . The internal view is expressed by internal schema.

The following aspects are considered at this level:


1. Storage allocation e.g: B-tree,hashing
2. access paths eg. specification of primary and secondary keys,indexes etc
3. Miscellaneous eg. Data compression and encryption techniques,optimization of
the internal structures.

Three schema Architecture


o The three schema architecture is also called ANSI/SPARC architecture or three-level
architecture.
o This framework is used to describe the structure of a specific database system.
o The three schema architecture is also used to separate the user applications and
physical database.
o The three schema architecture contains three-levels. It breaks the database down into
three different categories.

The three-schema architecture is as follows:

In the above diagram:

o It shows the DBMS architecture.

10
o Mapping is used to transform the request and response between various database
levels of architecture.
o Mapping is not good for small DBMS because it takes more time.
o In External / Conceptual mapping, it is necessary to transform the request from
external level to conceptual schema.
o In Conceptual / Internal mapping, DBMS transform the request from the conceptual
to internal level.

Objectives of Three schema Architecture

The main objective of three level architecture is to enable multiple users to access the same
data with a personalized view while storing the underlying data only once. Thus it separates
the user's view from the physical structure of the database. This separation is desirable for the
following reasons:

o Different users need different views of the same data.


o The approach in which a particular user needs to see the data may change over time.
o The users of the database should not worry about the physical implementation and
internal workings of the database such as data compression and encryption
techniques, hashing, optimization of the internal structures etc.
o All users should be able to access the same data according to their requirements.
o DBA should be able to change the conceptual structure of the database without
affecting the user's
o Internal structure of the database should be unaffected by changes to physical aspects
of the storage.

1. Internal Level

o The internal level has an internal schema which describes the physical storage
structure of the database.
o The internal schema is also known as a physical schema.
o It uses the physical data model. It is used to define that how the data will be stored in
a block.
o The physical level is used to describe complex low-level data structures in detail.

The internal level is generally is concerned with the following activities:

 Storage space allocations.


 Access paths.
 sequencing.
 Data compression and encryption techniques.
 Optimization of internal structures.
 Representation of stored fields.

11
2. Conceptual Level

o The conceptual schema describes the design of a database at the conceptual level.
Conceptual level is also known as logical level.
o The conceptual schema describes the structure of the whole database.
o The conceptual level describes what data are to be stored in the database and also
describes what relationship exists among those data.
o In the conceptual level, internal details such as an implementation of the data structure
are hidden.
o Programmers and database administrators work at this level.

3. External Level

o At the external level, a database contains several schemas that sometimes called as
subschema. The subschema is used to describe the different view of the database.
o An external schema is also known as view schema.
o Each view schema describes the database part that a particular user group is interested
and hides the remaining database from that user group.
o The view schema describes the end user interaction with database systems.

Mapping between Views

The three levels of DBMS architecture don't exist independently of each other. There must be
correspondence between the three levels i.e. how they actually correspond with each other.
DBMS is responsible for correspondence between the three types of schema. This
correspondence is called Mapping.

There are basically two types of mapping in the database architecture:

o Conceptual/ Internal Mapping


o External / Conceptual Mapping

Conceptual/ Internal Mapping

The Conceptual/ Internal Mapping lies between the conceptual level and the internal level. Its
role is to define the correspondence between the records and fields of the conceptual level
and files and data structures of the internal level.

External/ Conceptual Mapping

The external/Conceptual Mapping lies between the external level and the Conceptual level.
Its role is to define the correspondence between a particular external and the conceptual view.

12
Database Languages in DBMS
o A DBMS has appropriate languages and interfaces to express database queries and updates.
o Database languages can be used to read, store and update the data in the database.

Types of Database Languages

1. Data Definition Language (DDL)


o DDL stands for Data Definition Language. It is used to define database structure or pattern.
o It is used to create schema, tables, indexes, constraints, etc. in the database.
o Using the DDL statements, you can create the skeleton of the database.
o Data definition language is used to store the information of metadata like the number of tables
and schemas, their names, indexes, columns in each table, constraints, etc.

Here are some tasks that come under DDL:

o Create: It is used to create objects in the database.


o Alter: It is used to alter the structure of the database.
o Drop: It is used to delete objects from the database.
o Truncate: It is used to remove all records from a table.
o Rename: It is used to rename an object.
o Comment: It is used to comment on the data dictionary.

These commands are used to update the database schema that's why they come under Data definition
language.

2. Data Manipulation Language (DML)

DML stands for Data Manipulation Language. It is used for accessing and manipulating data in a
database. It handles user requests.

Here are some tasks that come under DML:

o Select: It is used to retrieve data from a database.


o Insert: It is used to insert data into a table.
o Update: It is used to update existing data within a table.
o Delete: It is used to delete all records from a table.
o Merge: It performs UPSERT operation, i.e., insert or update operations.
o Call: It is used to call a structured query language or a Java subprogram.
o Explain Plan: It has the parameter of explaining data.
o Lock Table: It controls concurrency.

3. Data Control Language (DCL)


This language enables user to grant authorization and canceling authorization of database
objects.
 The Grant: It is used to give user access privileges to a database.
 Revoke: It is used to take back permissions from the user.
13
There are the following operations which have the authorization of Revoke:

CONNECT, INSERT, USAGE, EXECUTE, DELETE, UPDATE and SELECT.

5. Transaction Control Language (TCL)

TCL is used to run the changes made by the DML statement. TCL can be grouped into a logical
transaction.

Here are some tasks that come under TCL:

o Commit: It is used to save the transaction on the database.


o Rollback: It is used to restore the database to original since the last Commit.

o Select: It is used to retrieve data from a database.


o Insert: It is used to insert data into a table.
o Update: It is used to update existing data within a table.
o Delete: It is used to delete all records from a table.
o Merge: It performs UPSERT operation, i.e., insert or update operations.
o Call: It is used to call a structured query language or a Java subprogram.
o Explain Plan: It has the parameter of explaining data.
o Lock Table: It controls concurrency.

Meta Data
It is a data about data, it includes data of the data types and size etc.,
Meta data stores in a file that is repository OR data dictionary

Classification of Database Management Systems

Database management systems can be classified based on several criteria, such as the data model, user
numbers and database distribution, all described below.

Classification Based on Data Model

The most popular data model in use today is the relational data model. Well-known DBMSs like
Oracle, MS SQL Server, DB2 and MySQL support this model. Other traditional models, such as
hierarchical data models and network data models, are still used in industry mainly on mainframe
platforms.

In recent years, the newer object-oriented data models were introduced.

14
Classification Based on User Numbers

A DBMS can be classification based on the number of users it supports. It can be a single-user
database system, which supports one user at a time, or a multiuser database system, which supports
multiple users concurrently.

Classification Based on Database Distribution

There are four main distribution systems for database systems and these, in turn, can be used to
classify the DBMS.

Centralized systems

With a centralized database system, the DBMS and database are stored at a single site that is used by
several other systems too.

This is illustrated in Figure

Figure . Example of a centralized database system.

Distributed database system

In a distributed database system, the actual database and the DBMS software are distributed from
various sites that are connected by a computer network, as shown in Figure.

Figure 6.2. Example of a distributed database system.


15
Homogeneous distributed database systems

Homogeneous distributed database systems use the same DBMS software from multiple sites. Data
exchange between these various sites can be handled easily. For example, library information systems
by the same vendor, use the same DBMS software which allows easy data exchange between the
various library sites.

Heterogeneous distributed database systems

In a heterogeneous distributed database system, different sites might use different DBMS software,
but there is additional common software to support data exchange between these sites. For example,
the various library database systems use the same machine-readable cataloguing (MARC) format to
support library record data exchange.

16

You might also like