You are on page 1of 45

DATA BASE MANAGEMENT SYSTEMS

UNIT-I
Agenda:
✓ An Overview of Database Management,
✓ Introduction
✓ What is Database System
✓ What is Database
✓ Why Database
✓ Data Independence
✓ Relation Systems and Others
✓ Database system architecture, Introduction
✓ The Three Levels of Architecture
✓ The External Level
✓ The Conceptual Level
✓ The Internal Level
✓ Mapping
✓ The Database Administrator
✓ Client/Server Architecture.

INTRODUCTION TO BASIC CONCEPTS OF DATABASE SYSTEMS:

What is Data?
The raw facts are called as data. The word “raw” indicates that
they have not been processed.
Ex: For example 89 is the data.

What is information?
The processed data is known as information.
Ex: Marks: 89; then it becomes information.

What is Knowledge?
1. Knowledge refers to the practical use of information.
2. Knowledge necessarily involves a personal experience.
DATA/INFORMATION PROCESSING:
The process of converting the data (raw facts) into meaningful
information is called as data/information processing.

➢ In business processing knowledge is more useful to make decisions


for any organization.

DIFFERENCE BETWEEN DATA AND INFORMATION:


DATA INFORMATION
1.Raw facts 1.Processed data
2. It is in unorganized form 2. It is in organized form
3. Data doesn’t help in 3. Information helps in
decision making process decision making process

WHAT IS A DATABASE SYSTEM?


➢ A database system is basically a computerized record-keeping
System: in other words, it is a computerized system whose overall
purpose is to store information: and to allow users to retrieve and
update that information on demand.
➢ The information is needed to assist in the general process of
running the business of that individual or organization.
➢ Fig. 1 is a simplified picture of a database system. As the figure
shows, such a sys-tem involves four major components: data,
hardware, software, and users. We consider these four components
briefly here.
Data:
The raw facts are called as data. The word “raw” indicates that they
have not been processed.
Ex: For example Name,Age,Hallticket ect.

Data is the most important component of the DBMS. The main


purpose of DBMS is to process the data. In DBMS, databases are
defined, constructed and then data is stored, updated and retrieved to
and from the databases. The database contains both the actual (or
operational) data and the metadata (data about data or description
about data).
Hardware
Hardware consists of a set of physical electronic devices such as
computers (together with associated I/O devices like disk drives),
storage devices, I/O channels, electromechanical devices that make
interface between computers and the real world systems etc, and so
on. It is impossible to implement the DBMS without the hardware
devices, In a network, a powerful computer with high data processing
speed and a storage device with large storage capacity is required
as database server.
Software
The main component of a DBMS is the software. It is the set of
programs used to handle the database and to control and manage
the overall computerized database
1. DBMS software itself, is the most important software component
in the overall system
2. Operating system including network software being used in
network, to share the data of database among multiple users.
3. Application programs developed in programming languages such
as C++, Visual Basic that are used to to access database in database
management system. Each program contains statements that request
the DBMS to perform operation on database. The operations may
include retrieving, updating, deleting data etc . The application program
may be conventional or online workstations or terminals.
Users
The users are the people who manage the databases and perform
different operations on the databases in the database system. There
are three kinds of people who play different roles in database system

1. Application Programmers
2. Database Administrators
3. End-Users
Application Programmers
The people who write application programs in programming languages
(such as Visual Basic, Java, or C++) to interact with databases are
called Application Programmer.
Database Administrators
A person who is responsible for managing the overall database
management system is called database administrator or simply DBA.
End-Users
The end-users are the people who interact with database management
system to perform different operations on database such as retrieving,
updating, inserting, deleting data etc.

WHAT IS DATA BASE


A database is a collection of related data.
or
A database is a collection of information that is organized so that it
can be easily accessed, managed and updated.

History of Database Systems:

1950s and early 1960s:


➢ Magnetic tapes were developed for data storage

➢ Data processing tasks such as payroll were automated, with data


stored on tapes.

➢ Data could also be input from punched card decks, and output to
printers.

➢ Late 1960s and 1970s: The use of hard disks in the late 1960s
changed the scenario for data processing greatly, since hard disks
allowed direct access to data.

➢ With disks, network and hierarchical databases could be created that


allowed data structures such as lists and trees to be stored on disk.
Programmers could construct and manipulate these data structures.

➢ With disks, network and hierarchical databases could be created that


allowed data structures such as lists and trees to be stored on disk.
Programmers could construct and manipulate these data structures.

➢ In the 1970’s the EF CODD defined the Relational Model.

In the 1980’s:

➢ Initial commercial relational database systems, such as IBM DB2,


Oracle, Ingress, played a major role in advancing techniques for
efficient processing of declarative queries.
➢ In the early 1980s, relational databases had become competitive with
network and hierarchical database systems even in the area of
performance.

➢ The 1980s also saw much research on parallel and distributed


databases, as well as initial work on object-oriented databases.

Early 1990s:
➢ The SQL language was designed primarily in the 1990’s.

➢ And this is used for the transaction processing applications.

➢ Decision support and querying re-emerged as a major application area


for databases.

➢ Database vendors also began to add object-relational support to their


databases.

Late 1990s:
➢ The major event was the explosive growth of the World Wide Web.

➢ Databases were deployed much more extensively than ever before.


Database systems now had to support very high transaction processing
rates, as well as very high reliability and 24 * 7 availability (availability
24 hours a day, 7 days a week, meaning no downtime for scheduled
maintenance activities).

➢ Database systems also had to support Web interfaces to data.

The Evolution of Database systems:


The Evolution of Database systems are as follows:
1. File Management System
2. Hierarchical database System
3. Network Database System
4. Relational Database System
File Management System:
The file management system also called as FMS in short is one in
which all data is stored on a single large file. The main disadvantage
in this system is searching a record or data takes a long time. This
lead to the introduction of the concept, of indexing in this system.
Then also the FMS system had lot of drawbacks to name a few like
updating or modifications to the data cannot be handled easily, sorting
the records took long time and so on. All these drawbacks led to
the introduction of the Hierarchical Database System.
Hierarchical Database System:
The previous system FMS drawback of accessing records and sorting
records which took a long time was removed in this by the introduction
of parent-child relationship between records in database. The origin of
the data is called the root from which several branches have data at
different levels and the last level is called the leaf. The main drawback
in this was if there is any modification or addition made to the
structure then the whole structure needed alteration which made the
task a tedious one. In order to avoid this next system took its origin
which is called as the Network Database System.

Fig: Hierarchical Database System


Network Database System:
In this the main concept of many-many relationships got introduced.
But this also followed the same technology of pointers to define
relationships with a difference in this made in the introduction if
grouping of data items as sets.
Fig: Network Database System

Relational Database System:


In order to overcome all the drawbacks of the previous systems, the
Relational Database System got introduced in which data get organized
as tables and each record forms a row with many fields or attributes
in it. Relationships between tables are also formed in this system.

Fig: Relational Database System


Examples / Applications of Database Systems:
The following are the various kinds of applications/organizations uses
databases for their business processing activities in their day-to-day
life. They are:
1. Banking: For customer information, accounts, and loans, and
banking transactions.
2. Airlines:For reservations and schedule information. Airlines were
among the first to use databases in ageographically distributed
manner—terminals situated around the world accessed the central
database system through phone lines and other data networks.
3. Universities:For student information, course registrations, and
grades.
4. Credit Card Transactions:For purchases on credit cards and
generation of monthly statements.
5. Telecommunication:For keeping records of calls made, generating
monthly bills, maintaining balances on prepaid calling cards, and
storing information about the communication networks.
6. Finance:For storing information about holdings, sales, and
purchases of financial instruments such as stocks and bonds.
7. Sales:For customer, product, and purchase information.
8. Manufacturing:For management of supply chain and for tracking
production of items in factories, inventories of items in
warehouses/stores, and orders for items.
9. Human resources:For information about employees, salaries,
payroll taxes and benefits, and for generation of paychecks.
10. Railway Reservation Systems:For reservations and schedule
information.
11. Web:For access the Back accounts and to get the balance
amount.
12. E–Commerce:For Buying a book or music CD and browse for
things like watches, mobiles from the Internet.

CHARACTERISTICS OF DATABASE:
The database approach has some very characteristic features which
are discussed in detail below:
1. Structured and Described Data:
Fundamental feature of the database approach is that the
database system does not only contain the data but also the complete
definition and description of these data. These descriptions are basically
details about the extent, the structure, the type and theformat of all
data and, additionally, the relationship between the data. This kind of
stored data is called metadata ("data about data").
2. Separation of Data and Applications:
Application software does not need any knowledge about the
physical data storage like encoding, format, storage place, etc. It only
communicates with the management system of a database (DBMS) via
a standardized interface with the help of a standardized language like
SQL. The access to the data and the metadata is entirely done by
the DBMS. In this way all the applications can be totally separated
from the data.
3. Data Integrity:
Data integrity is a byword for the quality and the reliability of
the data of a database system. In a broader sense data integrity
includes also the protection of the database from unauthorized access
(confidentiality) and unauthorized changes. Data reflect facts of the real
world.
4. Transactions:
A transaction is a bundle of actions which are done within a
database to bring it from one consistent state to a new consistent
state. In between the data are inevitable inconsistent . Atransaction is
atomic what means that it cannot be divided up any further. Within
a transaction all or none of the actions need to be carried out. Doing
only a part of the actions would lead to an inconsistent database
state.
Example: One example of a transaction is the transfer of an amount
of money from one bank accountto another.
5. Data Persistence:
Data persistence means that in a DBMS all data is maintained
as long as it is not deleted explicitly. The life span of data needs
to be determined directly or indirectly be the user and must not be
dependent on system features. Additionally data once stored in a
database must not be lost. Changes of a database which are done
by a transaction are persistent. When a transaction is finished even
a system crash cannot put the data in danger

WHY DATA BASE:


There are some unique problems if we are not using the database:
1. Size of Data:
The small amount of data storing into spreadsheet is fine,
however it might turns into a large amount of data then Spreadsheet
solution will not work. Even if the size of data records goes into
millions then storing data in multiple spreadsheet which will create a
problem of speed. It will take you long time to find a record from
the multiple spreadsheet files.
2. Ease of Updating Data:
Multiple peoples cannot edit the same file on same time. Other
peoples must wait until files are available to update which results into
wastage of time.
3. Accuracy:
When user doing data entry in files then it might be possible
to incorrect data due to no validation present like you can enter
wrong spelling, wrong dates, and wrong amount. So the Data accuracy
is hard to maintain and accuracy is in question.
4. Security:
You cannot secure the data in the text files and spreadsheet.
Anyone can access the file and read any data present in the file.
So storing data will not work with banking, healthcare application,
payroll department where privacy is difficult to maintain.
5. Redundancy:
The duplication of data can be possible using text files or
spreadsheet. Chances of adding multiple copies of data cannot be
limited here. This will leads to accuracy issues. Maintaining and
updating multiple copies is not an easy task.
6. Incomplete Data:
Some of the data is not considered not important, so such data
not entered in the file as no validation in place which leads the data
integrity is in question.
To prevent above problem associated with storing data in the
text file or spreadsheet the database is required

DATA INDEPENDENCE:

Data Independence is defined as a property of DBMS that helps


you to change the Database schema at one level of a database
system without requiring to change the schema at the next higher
level. Data independence helps you to keep data separated from all
programs that make use of it.

You can use this stored data for computing and presentation.
In many systems, data independence is an essential function for
components of the system.

Types of Data Independence

In DBMS there are two types of data independence

1. Physical data independence


2. Logical data independence.

Levels of Database

Before we learn Data Independence, a refresher on Database Levels


is important. The database has 3 levels as shown in the diagram below

1. Physical/Internal
2. Conceptual
3. External
Levels of DBMS Architecture Diagram

Consider an Example of a University Database. At the different


levels this is how the implementation will look like:

Type of Schema Implementation

External Schema View1: Course info(cid:int,cname:string)


View 2: studeninfo(id:int. name:string)

Conceptual Shema Students(id: int, name: string, login: string, age: integer)
Courses(id: int, cname.string, credits:integer)
Enrolled(id: int, grade:string)
Physical Schema • Relations stored as unordered files.
• Index on the first column of Students.

Physical Data Independence

Physical data independence helps you to separate conceptual


levels from the internal/physical levels. It allows you to provide a
logical description of the database without the need to specify physical
structures. Compared to Logical Independence, it is easy to achieve
physical data independence.

With Physical independence, you can easily change the physical


storage structures or devices with an effect on the conceptual schema.
Any change done would be absorbed by the mapping between the
conceptual and internal levels. Physical data independence is achieved
by the presence of the internal level of the database and then the
transformation from the conceptual level of the database to the internal
level.

Examples of changes under Physical Data Independence

Due to Physical independence, any of the below change will not


affect the conceptual layer.

➢ Using a new storage device like Hard Drive or Magnetic Tapes


➢ Modifying the file organization technique in the Database
➢ Switching to different data structures.
➢ Changing the access method.
➢ Modifying indexes.
➢ Changes to compression techniques or hashing algorithms.
➢ Change of Location of Database from say C drive to D Drive

Logical Data Independence

Logical Data Independence is the ability to change the conceptual


scheme without changing

1. External views
2. External API or programs

Any change made will be absorbed by the mapping between


external and conceptual levels.

When compared to Physical Data independence, it is challenging


to achieve logical data independence.
Examples of changes under Logical Data Independence

Due to Logical independence, any of the below change will not


affect the external layer.

1. Add/Modify/Delete a new attribute, entity or relationship is possible


without a rewrite of existing application programs
2. Merging two records into one
3. Breaking an existing record into two or more records

Difference between Physical and Logical Data Independence


Logica Data Independence Physical Data Independence

Logical Data Independence is mainly Mainly concerned with the storage of the
concerned with the structure or data.
changing the data definition.

It is difficult as the retrieving of data It is easy to retrieve.


is mainly dependent on the logical
structure of data.

Compared to Logic Physical Compared to Logical Independence it is


independence it is difficult to achieve easy to achieve physical data
logical data independence. independence.

You need to make changes in the A change in the physical level usually
Application program if new fields are does not need change at the Application
added or deleted from the database. program level.

Modification at the logical levels is Modifications made at the internal levels


significant whenever the logical may or may not be needed to improve
structures of the database are the performance of the structure.
changed.

Concerned with conceptual schema Concerned with internal schema


Example: Add/Modify/Delete a new Example: change in compression
attribute techniques, hashing algorithms, storage
devices, etc

Importance of Data Independence

➢ Helps you to improve the quality of the data


➢ Database system maintenance becomes affordable
➢ Enforcement of standards and improvement in database security
➢ You don't need to alter data structure in application programs
➢ Permit developers to focus on the general structure of the
Database rather than worrying about the internal implementation
➢ It allows you to improve state which is undamaged or undivided
➢ Database incongruity is vastly reduced.
➢ Easily make modifications in the physical level is needed to
improve the performance of the system.

RELATION SYSTEMS AND OTHERS

Types of Database Management Systems

There are several types of database management systems. Here is


a list of seven common database management systems:

1. Hierarchical databases
2. Network databases
3. Relational databases
4. Object-oriented databases
5. Graph databases
6. ER model databases
7. Document databases

Hierarchical Databases

In a hierarchical database management systems (hierarchical


DBMSs) model, data is stored in a parent-children relationship nodes.
In a hierarchical database, besides actual data, records also contain
information about their groups of parent/child relationships.

In a hierarchical database model, data is organized into a tree


like structure. The data is stored in form of collection of fields where
each field contains only one value. The records are linked to each
other via links into a parent-children relationship. In a hierarchical
database model, each child record has only one parent. A parent can
have multiple children.

To retrieve a field’s data, we need to traversed through each


tree until the record is found.

The hierarchical database system structure was developed by


IBM in early 1960s. While hierarchical structure is simple, it is inflexible
due to the parent-child one-to-many relationship. Hierarchical databases
are widely used to build high performance and availability applications
usually in banking and telecommunications industries.

The IBM Information Management System (IMS) and Windows


Registry are two popular examples of hierarchical databases.

Advantage

Hierarchical database can be accessed and updated rapidly


because in this model structure is like as a tree and the relationships
between records are defined in advance. This feature is a two-edged.

Disadvantage
This type of database structure is that each child in the tree
may have only one parent, and relationships or linkages between
children are not permitted, even if they make sense from a logical
standpoint. Hierarchical databases are so in their design. it can adding
a new field or record requires that the entire database be redefined.

Network Databases

Network database management systems (Network DBMSs) use a


network structure to create relationship between entities. Network
databases are mainly used on a large digital computers. Network
databases are hierarchical databases but unlike hierarchical databases
where one node can have one parent only, a network node can have
relationship with multiple entities. A network database looks more like
a cobweb or interconnected network of records.

In network databases, children are called members and parents


are called occupier. The difference between each child or member
can have more than one parent.

The approval of the network data model is similar to a


hierarchical data model. Data in a network database is organized in
many-to-many relationships.

The network database structure was invented by Charles


Bachman. Some of the popular network databases are Integrated Data
Store (IDS), IDMS (Integrated Database Management System), Raima
Database Manager, TurboIMAGE, and Univac DMS-1100.

Relational Databases

In relational database management systems (RDBMS), the


relationship between data is relational and data is stored in tabular
form of columns and rows. Each column if a table represents an
attribute and each row in a table represents a record. Each field in
a table represents a data value.

Structured Query Language (SQL) is a the language used to


query a RDBMS including inserting, updating, deleting, and searching
records.

Relational databases work on each table has a key field that


uniquely indicates each row, and that these key fields can be used
to connect one table of data to another.

Relational databases are the most popular and widely used


databases. Some of the popular DDBMS are Oracle, SQL Server,
MySQL, SQLite, and IBM DB2.

The relational database has two major reasons

1. Relational databases can be used with little or no training.


2. Database entries can be modified without specify the entire body.
Properties of Relational Tables

In the relational database we have to follow some properties which


are given below.

• It's Values are Atomic


• In Each Row is alone.
• Column Values are of the Same thing.
• Columns is undistinguished.
• Sequence of Rows is Insignificant.
• Each Column has a common Name.

RDBMs are the most popular databases.

Object-Oriented Model

In this Model we have to discuss the functionality of the object


oriented Programming. It takes more than storage of programming
language objects. Object DBMS's increase the semantics of the C++
and Java.I t provides full-featured database programming capability,
while containing native language compatibility. It adds the database
functionality to object programming languages. This approach is the
analogical of the application and database development into a constant
data model and language environment. Applications require less code,
use more natural data modeling, and code bases are easier to
maintain. Object developers can write complete database applications
with a decent amount of additional effort.

The object-oriented database derivation is the integrity of object-


oriented programming language systems and consistent systems. The
power of the object-oriented databases comes from the cyclical
treatment of both consistent data, as found in databases, and transient
data, as found in executing programs.
Object-oriented databases use small, recyclable separated of
software called objects. The objects themselves are stored in the
object-oriented database. Each object contains of two elements:

1. Piece of data (e.g., sound, video, text, or graphics).


2. Instructions, or software programs called methods, for what to do with
the data.

Object-oriented database management systems (OODBMs) were


created in early 1980s. Some OODBMs were designed to work with
OOP languages such as Delphi, Ruby, C++, Java, and Python. Some
popular OODBMs are TORNADO, Gemstone, ObjectStore, GBase,
VBase, InterSystems Cache, Versant Object Database, ODABA, ZODB,
Poet. JADE, and Informix.

Disadvantage of Object-oriented databases

1. Object-oriented databases have these disadvantages.


2. Object-oriented database are more expensive to develop.
3. In the Most organizations are unwilling to abandon and convert
from those databases.

Benefits of Object-oriented databases


The benefits to object-oriented databases are compelling. The ability
to mix and match reusable objects provides incredible multimedia
capability.

Graph Databases

Graph Databases are NoSQL databases and use a graph


structure for sematic queries. The data is stored in form of nodes,
edges, and properties. In a graph database, a Node represent an
entity or instance such as customer, person, or a car. A node is
equivalent to a record in a relational database system. An Edge in
a graph database represents a relationship that connects nodes.
Properties are additional information added to the nodes.

The Neo4j, Azure Cosmos DB, SAP HANA, Sparksee, Oracle


Spatial and Graph, OrientDB, ArrangoDB, and MarkLogic are some of
the popular graph databases. Graph database structure is also
supported by some RDBMs including Oracle and SQL Server 2017
and later versions.

ER Model Databases

An ER model is typically implemented as a database. In a


simple relational database implementation, each row of a table
represents one instance of an entity type, and each field in a table
represents an attribute type. In a relational database a relationship
between entities is implemented by storing the primary key of one
entity as a pointer or "foreign key" in the table of another entity.

Entity-relationship model was developed by Peter Chen 1976.

Document Databases

Document databases (Document DB) are also NoSQL database


that store data in form of documents. Each document represents the
data, its relationship between other data elements, and attributes of
data. Document database store data in a key value form.
Document DB has become popular recently due to their document
storage and NoSQL properties. NoSQL data storage provide faster
mechanism to store and search documents.

Popular NoSQL databases are Hadoop/Hbase, Cassandra,


Hypertable, MapR, Hortonworks, Cloudera, Amazon SimpleDB, Apache
Flink, IBM Informix, Elastic, MongoDB, and Azure DocumentDB.

What is DBMS?

A DBMS is a software used to store and manage data. The


DBMS was introduced during 1960's to store any data. It also offers
manipulation of the data like insertion, deletion, and updating of the
data.

DBMS system also performs the functions like defining, creating,


revising and controlling the database. It is specially designed to create
and maintain data and enable the individual business application to
extract the desired data.

What is RDBMS?

Relational Database Management System (RDBMS) is an


advanced version of a DBMS system. It came into existence during
1970's. RDBMS system also allows the organization to access data
more efficiently then DBMS.

RDBMS is a software system which is used to store only data


which need to be stored in the form of tables. In this kind of system,
data is managed and stored in rows and columns which is known
as tuples and attributes. RDBMS is a powerful data management
system and is widely used across the world.

Difference between DBMS vs RDBMS


Parameter DBMS RDBMS

Storage DBMS stores data as a file. Data is stored in the form of


tables.
Database DBMS system, stores data in RDBMS uses a tabular structure
structure either a navigational or where the headers are the column
hierarchical form. names, and the rows contain
corresponding values

Number of DBMS supports single user It supports multiple users.


Users only.

ACID In a regular database, the Relational databases are harder to


data may not be stored construct, but they are consistent
following the ACID model. and well structured. They obey
This can develop ACID (Atomicity, Consistency,
inconsistencies in the Isolation, Durability).
database.

Type of It is the program for It is the database systems which


program managing the databases on are used for maintaining the
the computer networks and relationships among the tables.
the system hard disks.

Hardware Low software and hardware Higher hardware and software


and software needs. need.
needs.

Integrity DBMS does not support the RDBMS supports the integrity
constraints integrity constants. The constraints at the schema level.
integrity constants are not Values beyond a defined range
imposed at the file level. cannot be stored into the particular
RDMS column.

Normalization DBMS does not support RDBMS can be Normalized.


Normalization

Distributed DBMS does not support RBMS offers support for distributed
Databases distributed database. databases.
Ideally suited DBMS system mainly deals RDMS is designed to handle a
for with small quantity of data. large amount of data.

Dr. E.F. Dbms satisfy less than seven Dbms satisfy 8 to 10 Dr. E.F.
Codd Rules of Dr. E.F. Codd Rules Codd Rules

Client Server DBMS does not support RDBMS supports client-server


client-server architecture architecture.

Data Data fetching is slower for Data fetching is rapid because of


Fetching the complex and large its relational approach.
amount of data.

Data Data redundancy is common Keys and indexes do not allow


Redundancy in this model. Data redundancy.

Data No relationship between data Data is stored in the form of tables


Relationship which are related to each other
with the help of foreign keys.

Security There is no security. Multiple levels of security. Log files


are created at OS, Command, and
object level.

Data Access Data elements need to Data can be easily accessed using
access individually. SQL query. Multiple data elements
can be accessed at the same time.

Examples Examples of DBMS are a Example of RDBMS is MySQL,


file system, XML, Windows Oracle, SQL Server, etc.
Registry, etc.

MAPPINGS
Process of transforming request and results between three level it's
called mapping.

There are the two types of mappings:

1. Conceptual/Internal Mapping
2. External/Conceptual Mapping

1. Conceptual/Internal Mapping:

➢ The conceptual/internal mapping defines the correspondence


between the conceptual view and the store database.
➢ It specifies how conceptual record and fields are represented at
the internal level.
➢ It relates conceptual schema with internal schema.
➢ If structure of the store database is changed.
➢ If changed is made to the storage structure definition-then the
conceptual/internal mapping must be changed accordingly, so that
the conceptual schema can remain invariant.
➢ There could be one mapping between conceptual and internal
levels.

2. External/Conceptual Mapping:

➢ The external/conceptual mapping defines the correspondence


between a particular external view and conceptual view.
➢ It relates each external schema with conceptual schema.
➢ The differences that can exist between these two levels are
analogous to those that can exist between the conceptual view
and the stored database.
➢ Example: fields can have different data types; fields and record
name can be changed; several conceptual fields can be combined
into a single external field.
➢ Any number of external views can exist at the same time; any
number of users can share a given external view: different
external views can overlap.
➢ There could be several mapping between external and conceptual
levels.
THE DATABASE ADMINISTRATOR
A Database Administrator is a person or a group of person
who are responsible for managing all the activities related to database
system. This job requires a high level of expertise by a person or
group of person. There are very rare chances that only a single
person can manage all the database system activities so companies
always have a group of people who take care of database system.

DBA Responsibilities

Deciding the hardware device

Depending upon the cost, performance and efficiency of the


hardware, it is DBA who have the duty of deciding which hardware
devise will suit the company requirement. It is hardware that is an
interface between end users and database so it needed to be of
best quality.

Managing Data Integrity

Data integrity should be managed accurately because it protects


the data from unauthorized use. DBA manages relationship between
the data to maintain data consistency.

Decides Data Recovery and Back up method

If any company is having a big database, then it is likely to


happen that database may fail at any instance. It is require that a
DBA takes backup of entire database in regular time span. DBA has
to decide that how much data should be backed up and how
frequently the back should be taken. Also the recovery of data base
is done by DBA if they have lost the database.

Tuning Database Performance

Database performance plays an important role for any business.


If user is not able to fetch data speedily then it may loss company
business. So by tuning an modifying sql commands a DBA can
improves the performance of database.
Capacity Issues

All the databases have their limits of storing data in it and the
physical memory also has some limitations. DBA has to decide the
limit and capacity of database and all the issues related to it.

Database design

The logical design of the database is designed by the DBA.


Also a DBA is responsible for physical design, external model design,
and integrity control.

Database accessibility

DBA writes subschema to decide the accessibility of database.


He decides the users of the database and also which data is to be
used by which user. No user has to power to access the entire
database without the permission of DBA.

Decides validation checks on data

DBA has to decide which data should be used and what kind
of data is accurate for the company. So he always puts validation
checks on data to make it more accurate and consistence.

Monitoring performance

If database is working properly then it doesn’t mean that there


is no task for the DBA. Yes f course, he has to monitor the
performance of the database. A DBA monitors the CPU and memory
usage.

Decides content of the database

A database system has many kind of content information in it.


DBA decides fields, types of fields, and range of values of the content
in the database system. One can say that DBA decides the structure
of database files.
Provides help and support to user

If any user needs help at any time then it is the duty of DBA
to help him. Complete support is given to the users who are new
to database by the DBA.

Database implementation

Database has to be implemented before anyone can start using


it. So DBA implements the database system. DBA has to supervise
the database loading at the time of its implementation.

Improve query processing performance

Queries made by the users should be performed speedily. As


we have discussed that users need fast retrieval of answers so DBA
improves query processing by improving their performance.

CLIENT SERVER ARCHITECTURE

Client server database consists of two logical components. One


is “Client” and the other one is “Server”. Clients are those who send
the request to perform a specific task to the server. Servers are
normally receive the command sent by the clients, perform the task
and send the appropriate result back to the client.

What is a Client?

client is PC where as the server is a large work station. The


Client machine runs own copy of an operating system. It runs one
or more applications through client’s CPU and memory.

What is a Server?

Servers are powerful computers or processes dedicated to


managing disk drives (fileservers), printers (print servers), or network
traffic (network servers ).
server runs a database management system which manages the
whole database.

Client Server Architecture

➢ A Database Management system is not always directly available for


users and applications to access and store data in it. A Database
Management system can be centralised(all the data stored at one
location), decentralised(multiple copies of database at different locations)
or hierarchical, depending upon its architecture.

➢ The application is modeled as a set of services that are provided by


servers and a set of clients that use these services.

➢ Clients know of servers but servers need not know of clients.

➢ Clients and servers are logical processes

Types of client server architecture

Normally, there are three types of client server architecture available


in database management system. These are listed below.
(a) Single tier client server
(b) Two tier client server
(c) Three tier client server
Single tier client server architecture.

Single tier architecture is the first type of client server


computing model.In single tire client server computing model, the
client server database system used on a personal computer. In
single tire system, the database is centralized, where the Client,
Server, and Database all reside on the same machine. But such
architecture is rarely used in production

Single tier client server architecture.


2-tier Architecture

A two-tier architecture is a database architecture where

1. Presentation layer runs on a client (PC, Mobile, Tablet, etc)


2. Data is stored on a Server.

➢ The 2-Tier architecture is same as basic client-server. In the two-


tier architecture, applications on the client end can directly
communicate with the database at the server side. For this
interaction, API's like: ODBC, JDBC are used.
➢ The user interfaces and application programs are run on the client-
side.
➢ The server side is responsible to provide the functionalities like:
query processing and transaction management.
➢ To communicate with the DBMS, client-side application establishes
a connection with the server side.

2-tier Architecture

3-Tier Architecture
➢ The 3-Tier architecture contains another layer between the client and
server. In this architecture, client can't directly communicate with the
server.
➢ The application on the client-end interacts with an application server
which further communicates with the database system.
➢ End user has no idea about the existence of the database beyond
the application server. The database also has no idea about any
other user beyond the application.
➢ The 3-Tier architecture is used in case of large web application

3-Tier Architecture
UNIT - 1
INTRODUCTION TO DBMS

Database is a collection of related data and data is a collection of facts and figures that can be
processed to produce information.

Mostly data represents recordable facts. Data aids in producing information, which is based on
facts. For example, if we have data about marks obtained by all students, we can then conclude
about toppers and average marks.

A database management system stores data in such a way that it becomes easier to retrieve,
manipulate, and produce information.

CHARACTERISTICS OF DBMS
Traditionally, data was organized in file formats. DBMS was a new concept then, and all the
research was done to make it overcome the deficiencies in traditional style of data management.
A modern DBMS has the following characteristics −

• Real-world entity − A modern DBMS is more realistic and uses real-world entities to
design its architecture. It uses the behavior and attributes too. For example, a school
database may use students as an entity and their age as an attribute. Relation-
based tables − DBMS allows entities and relations among them to form tables. A user
can understand the architecture of a database just by looking at the table names.
Isolation of data and application − A database system is entirely different than
its data. A database is an active entity, whereas data is said to be passive, on which the
database works and organizes. DBMS also stores metadata, which is data about data, to
ease its own process.
• Less redundancy − DBMS follows the rules of normalization, which splits a relation
when any of its attributes is having redundancy in values. Normalization is a
mathematically rich and scientific process that reduces data redundancy. Consistency
− Consistency is a state where every relation in a database remains consistent. There
exist methods and techniques, which can detect attempt of leaving database in
inconsistent state. A DBMS can provide greater consistency as compared to earlier forms
of data storing applications like file-processing systems.
• Query Language − DBMS is equipped with query language, which makes it more
efficient to retrieve and manipulate data. A user can apply as many and as different
filtering options as required to retrieve a set of data. Traditionally it was not possible
where file-processing system was used.
• ACID Properties − DBMS follows the concepts of Atomicity, Consistency, Isolation,
and Durability (normally shortened as ACID). These concepts are applied on
transactions, which manipulate data in a database. ACID properties help the database
stay healthy in multi-transactional environments and in case of failure.

WWW.JNTUKNOTES.COM 1
• Multiuser and Concurrent Access − DBMS supports multi-user environment and
allows them to access and manipulate data in parallel. Though there are restrictions on
transactions when users attempt to handle the same data item, but users are always
unaware of them.
• Multiple views − DBMS offers multiple views for different users. A user who is in the
Sales department will have a different view of database than a person working in the
Production department. This feature enables the users to have a concentrate view of the
database according to their requirements.
• Security − Features like multiple views offer security to some extent where users are
unable to access data of other users and departments. DBMS offers methods to impose
constraints while entering data into the database and retrieving the same at a later stage.
DBMS offers many different levels of security features, which enables multiple users to
have different views with different features. For example, a user in the Sales department
cannot see the data that belongs to the Purchase department. Additionally, it can also be
managed how much data of the Sales department should be displayed to the user. Since a
DBMS is not saved on the disk as traditional file systems, it is very hard for miscreants to
break the code.

DATA BASE USERS


A typical DBMS has users with different rights and permissions who use it for different
purposes. Some users retrieve data and some back it up. The users of a DBMS can be broadly
categorized as follows −

• Administrators − Administrators maintain the DBMS and are responsible for


administrating the database. They are responsible to look after its usage and by whom it
should be used. They create access profiles for users and apply limitations to maintain
isolation and force security. Administrators also look after DBMS resources like system
license, required tools, and other software and hardware related maintenance.
• Designers − Designers are the group of people who actually work on the designing part
of the database. They keep a close watch on what data should be kept and in what format.
They identify and design the whole set of entities, relations, constraints, and views.
End Users − End users are those who actually reap the benefits of having a

WWW.JNTUKNOTES.COM 2
DBMS. End users can range from simple viewers who pay attention to the logs or market
rates to sophisticated users such as business analysts.

DBMS ARCHITECTURE
The design of a DBMS depends on its architecture. It can be centralized or decentralized or
hierarchical. The architecture of a DBMS can be seen as either single tier or multi-tier. An n-tier
architecture divides the whole system into related but independent n modules, which can be
independently modified, altered, changed, or replaced.

In 1-tier architecture, the DBMS is the only entity where the user directly sits on the DBMS and
uses it. Any changes done here will directly be done on the DBMS itself. It does not provide
handy tools for end-users. Database designers and programmers normally prefer to use singletier
architecture.

If the architecture of DBMS is 2-tier, then it must have an application through which the DBMS
can be accessed. Programmers use 2-tier architecture where they access the DBMS by means of
an application. Here the application tier is entirely independent of the database in terms of
operation, design, and programming.

3-tier Architecture
A 3-tier architecture separates its tiers from each other based on the complexity of the users and
how they use the data present in the database. It is the most widely used architecture to design a
DBMS.

• Database (Data) Tier − At this tier, the database resides along with its query processing
languages. We also have the relations that define the data and their constraints at this
level.

WWW.JNTUKNOTES.COM 3
• Application (Middle) Tier − At this tier reside the application server and the programs
that access the database. For a user, this application tier presents an abstracted view of
the database. End-users are unaware of any existence of the database beyond the
application. At the other end, the database tier is not aware of any other user beyond the
application tier. Hence, the application layer sits in the middle and acts as a mediator
between the end-user and the database.

• User (Presentation) Tier − End-users operate on this tier and they know nothing about
any existence of the database beyond this layer. At this layer, multiple views of the
database can be provided by the application. All views are generated by applications that
reside in the application tier.

Multiple-tier database architecture is highly modifiable, as almost all its components are
independent and can be changed independently.

DATA MODELS
Data models define how the logical structure of a database is modeled. Data Models are
fundamental entities to introduce abstraction in a DBMS. Data models define how data is
connected to each other and how they are processed and stored inside the system.

The very first data model could be flat data-models, where all the data used are to be kept in the
same plane. Earlier data models were not so scientific, hence they were prone to introduce lots of
duplication and update anomalies.

Entity-Relationship Model
Entity-Relationship (ER) Model is based on the notion of real-world entities and relationships
among them. While formulating real-world scenario into the database model, the ER Model
creates entity set, relationship set, general attributes and constraints.

ER Model is best used for the conceptual design of a database.

ER Model is based on –

• Entities and their attributes.


• Relationships among entities.

These concepts are explained below.

WWW.JNTUKNOTES.COM 4
• Entity − An entity in an ER Model is a real-world entity having properties called
attributes. Every attribute is defined by its set of values called domain. For example, in
a school database, a student is considered as an entity. Student has various attributes like
name, age, class, etc.
• Relationship − The logical association among entities is called relationship.
Relationships are mapped with entities in various ways. Mapping cardinalities define the
number of association between two entities.

Mapping cardinalities −

• one to one
• one to many
• many to one many to many

Relational Model
The most popular data model in DBMS is the Relational Model. It is more scientific a model
than others. This model is based on first-order predicate logic and defines a table as an n-ary
relation.

The main highlights of this model are −

Data is stored in tables called

relations.

• Relations can be normalized.


• In normalized relations, values saved are atomic values.
• Each row in a relation contains a unique value.
• Each column in a relation contains values from a same domain.

WWW.JNTUKNOTES.COM 5
Database Schema
A database schema is the skeleton structure that represents the logical view of the entire
database. It defines how the data is organized and how the relations among them are associated.
It formulates all the constraints that are to be applied on the data.

A database schema defines its entities and the relationship among them. It contains a descriptive
detail of the database, which can be depicted by means of schema diagrams. It’s the database
designers who design the schema to help programmers understand the database and make it
useful.

A database schema can be divided broadly into two categories −

• Physical Database Schema − This schema pertains to the actual storage of data and its
form of storage like files, indices, etc. It defines how the data will be stored in a
secondary storage.
• Logical Database Schema − This schema defines all the logical constraints that need to
be applied on the data stored. It defines tables, views, and integrity constraints.

Database Instance
It is important that we distinguish these two terms individually. Database schema is the skeleton
of database. It is designed when the database doesn't exist at all. Once the database is
operational, it is very difficult to make any changes to it. A database schema does not contain
any data or information.

A database instance is a state of operational database with data at any given time. It contains a
snapshot of the database. Database instances tend to change with time. A DBMS ensures that its
every instance (state) is in a valid state, by diligently following all the validations, constraints,
and conditions that the database designers have imposed.

WWW.JNTUKNOTES.COM 6
DBMS - Data Independence

If a database system is not multi-layered, then it becomes difficult to make any changes in the
database system. Database systems are designed in multi-layers as we learnt earlier.

Data Independence
A database system normally contains a lot of data in addition to users’ data. For example, it
stores data about data, known as metadata, to locate and retrieve data easily. It is rather difficult
to modify or update a set of metadata once it is stored in the database. But as a DBMS expands,
it needs to change over time to satisfy the requirements of the users. If the entire data is
dependent, it would become a tedious and highly complex job.

Metadata itself follows a layered architecture, so that when we change data at one layer, it does
not affect the data at another level. This data is independent but mapped to each other.

Logical Data Independence


Logical data is data about database, that is, it stores information about how data is managed
inside. For example, a table (relation) stored in the database and all its constraints, applied on
that relation.

Logical data independence is a kind of mechanism, which liberalizes itself from actual data
stored on the disk. If we do some changes on table format, it should not change the data residing
on the disk.

WWW.JNTUKNOTES.COM 7
Physical Data Independence
All the schemas are logical, and the actual data is stored in bit format on the disk. Physical data
independence is the power to change the physical data without impacting the schema or logical
data.

For example, in case we want to change or upgrade the storage system itself − suppose we want
to replace hard-disks with SSD − it should not have any impact on the logical data or schemas.

Advantages of DBMS
The database management system has a number of advantages as compared to traditional computer
file-based processing approach. The DBA must keep in mind these benefits or capabilities during
databases and monitoring the DBMS.
The Main advantages of DBMS are described below.

• Controlling Data Redundancy

In non-database systems each application program has its own private files. In this case, the duplicated
copies of the same data is created in many places. In DBMS, all data of an organization is integrated into
a single database file. The data is recorded in only one place in the database and it is not duplicated.

• Sharing of Data

In DBMS, data can be shared by authorized users of the organization. The database administrator
manages the data and gives rights to users to access the data. Many users can be authorized to access
the same piece of information simultaneously. The remote users can also share same data. Similarly, the
data of same database can be shared between different application programs.

• Data Consistency

By controlling the data redundancy, the data consistency is obtained. If a data item appears only once,
any update to its value has to be performed only once and the updated value is immediately available to
all users. If the DBMS has controlled redundancy, the database system enforces consistency.

• Integration of Data

In Database management system, data in database is stored in tables. A single database contains
multiple tables and relationships can be created between tables (or associated data entities). This makes
easy to retrieve and update data.

• Integration Constraints

Integrity constraints or consistency rules can be applied to database so that the correct data can be
entered into database. The constraints may be applied to data item within a single record or the may be
applied to relationships between records.

WWW.JNTUKNOTES.COM 8
• Data Security

Form is very important object of DBMS. You can create forms very easily and quickly in DBMS. Once a
form is created, it can be used many times and it can be modified very easily. The created forms are also
saved along with database and behave like a software component. A form provides very easy way
(userfriendly) to enter data into database, edit data and display data from database. The non-technical
users can also perform various operations on database through forms without going into technical
details of a fatabase.

• Report Writers

Most of the DBMSs provide the report writer tools used to create reports. The users can create very
easily and quickly. Once a report is created, it can be used may times and it can be modified very easily.
The created reports are also saved along with database and behave like a software component.

• Control Over Concurrency

In a computer file-based system, if two users are allowed to access data simultaneously, it is possible
that they will interfere with each other. For example, if both users attempt to perform update operation
on the same record, then one may overwrite the values recorded by the other. Most database
management systems have sub-systems to control the concurrency so that transactions are always
recorded with accuracy.

• Backup and Recovery Procedures

In a computer file-based system, the user creates the backup of data regularly to protect the valuable
data from damage due to failures to the computer system or application program. It is very time
consuming method, if amount of data is large. Most of the DBMSs provide the 'backup and recovery'
sub-systems that automatically create the backup of data and restore data if required.

• Data Independence

The separation of data structure of database from the application program that uses the data is called
data independence. In DBMS, you can easily change the structure of database without modifying the
application program.

Advantages of DBMS
One of the main advantages of using a database system is that the organization can exert,via
theDBA, centralized management and control over the data. The database Administrator is the
focus of the centralized control.
Any application requiring a change in the structure
Of a data record requires an arrangement with the DBA, who makes the necessary modifications
.

WWW.JNTUKNOTES.COM 9
Such modifications do not affect other applications or Users of the record in question.

Reduction of Redundancies:
Centralized control of data by the DBA avoids unnecessary duplication of data and effectively
reduces the total amount of data storage required.
It also eliminates the extra processing necessary to trace the required data in a large mass of data.

Elimination of Inconsistencies:
The main advantage of avoiding duplication is the elimination of inconsistencies that tend to be
present in redundant data files.
Any redundancies that exist in the DBMS are controlled and the system ensures that these
multiple copies are consistent.
SharedData:
A database allows the sharing of data under its control by any number of application programs or
users.
For example, the applications for the public relations And
payroll departments can share the same data.
Integrity:
Centralized control can also ensure that adequate checks are incorporated in the DBMS to
provide data integrity.
Data integrity means that the data contained in the database is both accurate and consistent.
Therefore, data values being entered for the storage could be checked to ensure that they fall
within a specified range and are of the correct format.

Security:
Data is of vital importance to an organization and may be confidential . Such confidential data
must not be accessed by unauthorized persons . The DBA who has the ultimate responsibility for
the data in the DBMS can ensure that proper access procedures are followed, including proper
authentication schemes for access to the DBMS and additional checks before permitting access
to sensitive data .Different levels of security could be implemented for various types of data and
operations.

Disadvantages of DBMS

Cost of software/hardware and migration:


A significant disadvantage of the DBMS system is cost .In addition to the cost of purchasing or
developing the software, the hardware has to be upgraded to allow for the extensive programs
and work spaces required for their execution and storage .
The processing overhead introduced by DBMS to implement security, integrity, and sharing of
the data causes a degradation of the response and through – put times .
An additional cost is that of migration from a traditionally separate application environment to
an integrated one.

WWW.JNTUKNOTES.COM 10
Problem associated with centralization :
While centralization reduces duplication, the lack of duplication requires that the database be
adequately backed up so that in the case of failure the data can be recovered. Centralization also
means that the data is accessible from a single source .
This increases the potential severity of security breaches and disruption of the operation of the
organization because of downtimes and failures .
The replacement of a monolithic centralized database by a federation of independent and
cooperating distributed databases resolves some of the problems resulting from failures and
downtimes.
Complexity of Backup and Recovery:
Backup and recovery operations are fairly complex in a DBMS environment, and this is
exacerbated in a concurrent multi user database system .
Furthermore, a database system requires a certain amount of controlled redundancies and
duplication to enable access to related data items .

APPLICATION OF DBMS:
Databases are used to support internal operations of organizations and to underpin online
interactions with customers and suppliers (see Enterprise software).

Databases are used to hold administrative information and more specialized data, such as
engineering data or economic models. Examples of database applications include computerized
library systems, flight reservation systems and computerized parts inventory systems.

Application areas of DBMS

1. Banking: For customer information, accounts, and loans, and banking transactions.

2. Airlines: For reservations and schedule information. Airlines were among the first to use
databases in a geographically distributed manner - terminals situated around the world
accessed the central database system through phone lines and other data networks.

3. Universities: For student information, course registrations, and grades.

4. Credit card transactions: For purchases on credit cards and generation of monthly statements.

5. Telecommunication: For keeping records of calls made, generating monthly bills, maintaining
balances on prepaid calling cards, and storing information about the communication networks.

6. Finance: For storing information about holdings, sales, and purchases of financial instruments
such as stocks and bonds.

7. Sales: For customer, product, and purchase information.

WWW.JNTUKNOTES.COM 11
8. Manufacturing: For management of supply chain and for tracking production of items in
factories, inventories of items in warehouses / stores, and orders for items.

9. Human resources: For information about employees, salaries, payroll taxes and benefits, and
for generation of paychecks

WWW.JNTUKNOTES.COM 12

You might also like