Anda di halaman 1dari 95

Introduction

TO
Database Management System
Database Management System

What is a
DataBase
Management
System?
Database Management System
Before Computerization the data/information was
available only in the paper/documents.
The need to store massive data and retrieve it faster
necessitated Computerization.
Thus lot of efforts were put in to automate the manual
working into automation.
Database Management System
Why Computerized Database ?
Manual System is:
- Tedious
- Time Consuming
- Error Prone
- Illegible
Database Management System
Advantages of Computerization
-Minimizations of Errors
- Saving of Time in processing/working
- Availability of data at one place
- Legible -Reports are presentable
Database Management System
Definition:
A collection of information that has been systematically
organized for easy access and analysis. Databases
typically are computerized.
An organized collection of records having a
standardized format and content.
For example, a Telephone Directory is a database of
Telephones with names and Addresses.
Computerized indexes and catalogs are two of the most
common types of databases in libraries.
Database Management System
Some More Definitions:
A collection of electronic records having a standardized
format and using specific software for accessing the
data/record.

A database is a collection of information organized in such a


way that a computer program can quickly select desired
pieces of data.
Database Management System
Some More Definitions:
A collection of information/data, often organized within
tables, within a computer's mass storage system.
Databases are structured in a way to provide for rapid
search and retrieval by computer software.

A collection of information organized in a way that allows


the quick selection, sorting, and reorganization of data.
Database Management System
Before the era of the RDBMS there were a variety of
different species of data file structures. Each were
specific to the application program code which
implicitly defined it.
The organization's intelligence/ logic of the Output
used to reside in the program code used to manipulate
the data files/structures.
Database Management System
The Hardware requirements were for a machine and
its peripherals sufficient for the needs of the
organization.
The requirements were: One Hardware
vendor. Additionally, separate requirements always
existed for some form of database application
software code specific to that organization.
Database Management System
As the Applications did not exist in the
beginning, they had to be written.
Requirement: One or more Software developer.
This could involve literally one or more programmers,
or Consultants depending on scale.
Database Management System
With the passage of time:
- Systems and their environments evolved,
- Complexity increased,
- Data requirements grew year by year.
The IT Problem was dealt with on day-to-day basis.
Database storage technology was under pressure and it
needed to evolve. The task of managing constantly growing
Data and its structures was becoming an occupational
hazard for IT Management and operational staff.
Database Management System
Thus in the mid / late 1960's the Database
Management System (DBMS) came into
existence.
The DBMS became necessary because the data was far more
volatile than had earlier been planned, and because there were
still major limiting factors in the costs associated with data
storage media. Data grew as a collection, and it also needed to
be managed at a detailed transaction by transaction level.
Database Management System
The first DBMS species were thus very much
vendor specific. IBM as usual led the field, but
there were a growing number of competitors
and clones whose database solutions offered
varying entry points into the bandwagon of
computerized record keeping systems.
Database Management System
The Database Applications Software was dependent on the
programmers who encode the processes and rules of the
operations of the organization.
The Program code was dependent upon the Hardware
platform. After the completion of the project, a functional
application would be made available for the IT Management
of the organization to deploy.
Invariably the database application software solution for any
one organization was not immediately responsive to change,
due to its size and because its functionality had to be closely
coordinated with the compatible functionality of the available
hardware, its (proprietary) operating system, and its
(proprietary) DBMS.
Database Management System

Why do we need
Database?
Database Management System
If there is no Database :
1. Data will be scattered
2. Data is not cohesive – may be having different formats
3. Data is duplicated
4. Data Integrity is not possible
5. Data has big risk
Database Management System
To put them together a Database is needed
which will have:
- Database
- Tables
-Records
- Fields
Database Management System
Data Types commonly used:
- Numeric
- Alphanumeric
- Date
- Logical
- Memo
Database Management System
Numeric – This data type specifies that the field can contain
only numbers.The numbers could be:
- Whole Number e.g. 2,55,999 etc.
- Real number e.g. 23.75,49.55 etc.
Alphanumeric- A combination of alphabets, numbers and
special characters like hyphen etc. may be stored in
this field. The data could be of following types:
- Numbers - 0 to 9
- Alphabets – A to Z, a to z
- Special Characters - !@#$%* etc.
Database Management System
Date – In this field only date can be stored. The date may
have different formats. Some databases
provide Time also along with the date format.A
data type that can handle date and time may have
following :
Date – Day
- Month
- Year
Time – Hour
- Minute
- Second
Database Management System
Logical – This field can contain only True/false or Yes/No i.e.
The field can contain only logical value.This data type
is also known as Boolean.

Memo – This field can contain large amount of data e.g. 100/
200/500 words. It can have alphanumeric data, but this
can be used only for comment purposes.No manipulation
on this field is possible.
Database Management System
Specifying the Field Size:
Along with the Data type for a field, we also
need to specify the field size.Specifying the
size means that the maximum data of a
particular data type that can be stored in the
field.
Database Management System
Size Description Actual Size
Indicator (in Bytes)

Byte Can Store only positive numbers in the 1


range of 0 to 255

Integer Can handle whole numbers in the range of 2


-32,768 to 32,767
Can handle whole numbers in the wide range
Long of -2,147,483,648 to 2,147,483,647. This data
4
type cannot handle real numbers.
Can handle real numbers in the range of:
Double -1.79769313486232E308 to 1.79769312486232E308
Database Management System
Similarly ,some common alphanumeric data types are:
Data Type Description Actual Size(in Bytes)
Char Can store a single 1 Byte
character
String Can be used to store There is no pre-determined
Alphanumeric data of size.The size is determined
varying length by the number of characters
stored.Generally it is from
1023 bytes to 2 million
bytes.
Database Management System
What is a Table?
A table consists of :
-Rows
- Columns
- Data Elements
Database Management System
Tables are used for Data Manipulation such as :

-Adding records
- Querying
- Modifying Records
- Deleting Records
Database Management System
Data Manipulation:
Creating a table involves the following:
- Specifying field names for different fields
- Specifying data types for the different fields
- Specifying field sizes for the different fields

S_No Item-Code Ord_no Ord_Date Qty


Database Management System
Adding Records to a table:
When the table is created, it does not contain any data.
On adding data, the table will look like:

S_No Item-Code Ord_no Ord_Date Qty

111 RKSK-T 001/05 08/08/05 100


Database Management System
After entering the data in the table, if
required the data can be:
- Added
- Modified
- Deleted
Database Management System
So we have seen the use of Data being stored.
Let us take A typical example of a College ,
where we need to store/Maintain data /details
of:
 Teachers
Students
Subjects
Examination
Database Management System
All these will be independent data files/tables having
details like:
Teacher:
- Staff No.
- Name
- Address
- Qualifications
- Salary
Student:
-Roll No.
- Name
- Address
- Attendance
- Year
Database Management System
Subject:
- Subject No.
- Subject Name
- Year at Which the Subject is taught
- Teacher who teaches the subject
Examination:
- Exam No.
- Subject for Which the Exam was conducted
- Teacher responsible for the exam
- Student (appearing for exam)
- marks Obtained
Database Management System
Thus we can see there is no relation between the tables;
Therefore if we want to refer to another table we cannot
as we do not find any link between the tables.

If we want to refer another table, which is often required,


A relation need to be developed so that tables can be referred
and data can be picked up.
Thus we need to have database where we can have relations
Between the tables. Such databases are known as RDBMS
(Relational Database Management System)
Database Management System
Thus following need to be kept in mind:
1. The data to be stored in a single database since it
pertains to a single subject.
2. The distinction between the various groups should
be
maintained since different types of details are stored
for each group.
3. We must have atleast one common field through
which relation between tables can be established.
Database Management System
Thus in the College Database discussed earlier, we can
Establish following relationship:
-Relationship between Roll No. from the Student table
and Roll No. from the Exam table
- Relationship between Staff No. from the Teacher table
and Staff No.from the Exam table
- Relationship between Subject No. from the Student
table and Subject no.from the Exam table
- Relationship between Staff No. from the Teacher table
and Staff no. from the Subject table
Database Management System

Thus you can establish relations using fields in each table.


Database Management System
COMPONENTS OF DBMS:
DATA DEFINITION LANGUAGE:
oDefines Data Elements in Database
 DATA MANIPULATION LANGUAGE:
oManipulates Data for Applications
oSQL
 DATA DICTIONARY:
oFormal Definitions of all Variables in Database;
Controls Variety of Database Contents
Database Management System
ADVANTAGES OF RDBMS:
 Reduces Complexity       
  Reduces Data Redundancy
 Central Control of Data
 Reduces Program/ Data Dependence
 Reduces Development/maintenance Costs
 Enhances System Flexibility
  Increases Access/Availability of Information    
Database Management System
Emergence of the RDBMS
The Relational Database concept was thought about by folks
who on a day-to-day basis had to manage large production
data structures in the 1960's and 1970's and 1980's and 1990's
and today. But it was probably Codd (Dr. E.F.) who first
published (in an IBM Research Report of August 1969) some
form of specification (set) of rules by which such a species of
database would be known ...
Database Management System
CODD's TWELVE RULES
Rule 1: The Information Rule: All information in a
relational database is represented clearly at the logical level in
exactly one way by values in tables.

Rule 2: Guaranteed Access Rule: Each and every datum


(atomic value) in a relational database is guaranteed to be logically
accessible by resorting to a table name, primary key value, and
column name.
Database Management System
CODD's TWELVE RULES
Rule 3: Systematic Treatment of Null Values: Null values
(distinct from empty character string or a string of blank characters
and distinct from zero or any other number) are supported in the fully
relational DBMS for representing missing information in a systematic
way, independent of data type.

Rule 4: Dynamic On-line Catalog Based on the


Relational Model: The database description is represented at the
logical level in the same way as ordinary data, so authorized users can
apply the same relational language to its interrogation as they apply to
regular data.
Database Management System
CODD's TWELVE RULES
Rule 5: Comprehensive Data Sublanguage Rule: A
relational system may support several languages and various modes
of terminal use (for example, the fill-in-blanks mode). However,
there must be at least one language whose statements are expressible,
as per some well-defined syntax, as character strings and whose
ability to support all of the following is comprehensible: data
definition, view definition, data manipulation (interactive and by
program), integrity constraints, and transaction boundaries (begin,
commit, and rollback).

Rule 6: View Updating Rule: All views that are theoretically


updateable are also updateable by the system.
Database Management System
CODD's TWELVE RULES

Rule 7: High-level Insert, Update, and Delete: The


capability of handling a base relation or a derived relation as a
single operand applies not only to the retrieval of data but also to
the insertion, update, and deletion of data.

Rule 8: Physical Data Independence: Application


programs and terminal activities remain logically unimpaired
whenever any changes are made in either storage representation or
access methods.
Database Management System
CODD's TWELVE RULES
Rule 9: Logical Data Independence: Application programs
and terminal activities remain logically in excellent condition when
information preserving changes of any kind that theoretically permit
unimpairment are made to the base tables.

Rule 10: Integrity Independence: Integrity constraints specific


to a particular relational database must be definable in the relational
data sublanguage and storable in the catalog, not in the application
programs.
Database Management System
CODD's TWELVE RULES
Rule 11: Distribution Independence: A relational DBMS
has distribution independence. Distribution independence implies
that users need not have to be aware of whether a database is
distributed.

Rule 12: Non-subversion Rule: If a relational system has a


low-level (single-record-at-a-time) language, that low-level
language cannot be used to subvert or bypass the integrity rules or
constraints expressed in the higher-level (multiple-records-at-a-
time) relational language.
Database Management System
Important: There is a rider to these 12 rules known as Rule
Zero: "For any system that is claimed to be a relational
database management system, that system must be able to
manage data entirely through its relational capabilities."
On the basis of the above rules, there is no fully relational
DBMS available today.
Database Management System
A database ,therefore typically has two main parts:
1.The files holding the physical database and
2. The database management system (DBMS)
software that applications use to access data.
The DBMS is responsible for enforcing the database
structure, including:
      -  Maintaining relationships between data in the
database.
               -  Ensuring that data is stored correctly, and that the rules
defining data relationships are not violated.
- Recovering all data to a point of known consistency in
case of system failures.
Database Management System
Types of Databases
There are different types of RDBMSs, ranging from small
Systems that run on Personal Computers to huge systems
that run on Mainframes. The following are examples of
Database Applications:
 Computerized Library Systems
 Railway/ Flight Reservation Systems
 Computerized Inventory systems
Database Management System
Let us try to understand how the
databases are built. The database
Design has following stages –
     - Analysis
- Design
- Implementation
Database Management System
Analysis
Before designing the Database, it is important to understand/
analyze the data that will be stored in the database. This may
be done by studying the documents /reports available. After
the study, the analysis is to be done to decide how many
tables are required to store the data, which data is going to be
stored in various tables and how these tables will be linked to
each other. The tables, their fields, and their relationships
between one another are the key elements of the structure of
a database: which is known as ‘Relational Data
Model’. 
Database Management System
Design
Once the analysis is complete, the design of
database is to be taken up. This of course has to
be done keeping in view the Database that is going
to be used for storing the data in the tables.
Different databases have different facilities, so the
database design has to be done keeping in mind
the architecture of the database.
Database Management System
Implementation
Once the Database is designed by the Database
administrator, it is to be created.
All the tables, the fields, their attributes must be specified
properly.
Linkage of tables i.e. how the tables are going to be
linked with each other must be defined.
The Primary, secondary and the foreign key must be
defined.
Any weakness or ambiguity at this stage may jeopardize
the entire data capturing /retrieval.
The other considerations that the designer has to take
into account are:
Database Management System
Some Important Considerations:
1. Capacity Planning – This is important, as
the growth of data has to be kept in mind so that
handling of Database does not pose any problem.

 2. Easy-to-use interface – In case the database


need to be interfaced with some other process e.g. real
time data is to be captured.Integration of such
processes must be taken into account before finalising
the database.
Database Management System
 3. Customer and solution-oriented procedure –
Procedures must be solution oriented.

4. Plan for growth and change –


Since the data is bound to grow , it is advisable
to keep provision of expected growth. Most of
the Databases allow growth , but there are some
which do not, therefore ample care should be taken
for this aspect.
Database Management System
Some of the Common Databases are:
- MS-Access
- Oracle
- MS-Sql Server 2000
- Sybase
etc.
Database Management System
All the databases provide the facility to
work with:
Tables – Containing Data
Queries – Selected information is displayed
on the screen
Reports – Formatted Printed information
Forms – Screen Created to add,modify and delete records
Database Management System
Tasks that involved with Tables are:
Creating a Table
- Specify field names
- Specify data types
- Specify field sizes
etc.
Database Management System
Tasks that involved with Queries are:
Creating Queries to obtain information by:
- Specifying conditions on the basis of which
data is fetched from one or more tables
- Specifying fields on the basis of which the
data is to be sorted
Database Management System
Creating queries to update the data by:
- Specifying conditions to determine which
records are to be updated

Creating Queries to delete the data by:


- Specifying conditions to determine
which records are to be deleted
Database Management System
Report – This is the final presentation of the data captured.
The report is easy-to-understand and good-to-look at.
The report may generated from one or more tables
depending on the requirement.
The tasks involved are:
Creating a Report by:
- Specifying the table or query from which the
report is to be created.
- Specifying the fields from the above that are to
included in the report
- Formatting the Report
Database Management System
Forms – These are used of entering/modifying and
deleting the data.

The tasks involved are:


Creating the Forms by:
- Specifying the table or query from which the
form is to be created.
- Specifying the fields from the above that are to
be displayed in the form
- Formatting the form
Database Management System
RDBMS –make things easier for the user, if it provides
the facility of some basic functions like:
-Adding records
- Querying
- Modifying Records
- Deleting Records
Database Management System
Thus the benefits of RDBMS are:
- the system is simple,
- it is flexible,
- it is productive

This is possible. because the tables are simple, data is


easier to understand and communicate with others.
RDBMS are flexible because users do not have to use
predefined keys to input information.
Database Management System

Classification
and
Types of Databases
Database Management System
The Databases may be classified as:

-Data /Text stored in an ASCII File


- Data stored in a Binary File (Cobol,Basic etc.)
- Data stored in a Database
- Data stored in RDBMS
- Data stored in Web Server
Database Management System
Data /Text stored in an ASCII File

Data stored in an ASCII file cannot be manipulated.


This Can only be used for Comments purposes.
Therefore this is used for Document storage or
such activities where manipulation is required.
Database Management System
Data Stored in a Binary File
In the Cobol and basic days , the data used to get
stored in Binary files.In that case to view the data ,
the programmer has to write a program to check
whether data stored in the file are as per the
requirements.

This method is quite cumbersome.


Database Management System
Data Stored in a Database
After the advent of Database e.g. DBaseII,
Foxbase, Foxpro etc. the data after storing
could easily be viewed .
This is very handy to the Programmers, but
had some problems because relations could not
be established.
Database Management System
Data Stored in a Relational Database
Relational Database have become popular because
one can establish relations between tables through a
Field. This being a common field enables the
developer to fetch data from other tables based on
this field.
Likewise relations may established based on the
requirements and of course the common field.The
common Databases in use today are: Access, Sql
Server, Oracle, Sybase etc.
Database Management System

Advantages
of
Databases
Database Management System
The main Advantages of a Database
are:
• Reduction in data redundancy 
• Maintenance of data integrity and quality 
• Data are self-documented or self-
descriptive 
• Avoidance of inconsistency 
• Reduced cost of software development
• Security restrictions 
Database Management System
Database Management System
View of the Database
• The database can present different views of itself to
users, programmers and the database administrator.
• The internal data representation (internal view) is
normally not seen by the user or applications programmer.
• The conceptual view or conceptual schema is the primary
means by which the DBA builds and manages the data
base.
• The DBMS can present multiple views of the conceptual
schema (external views) to programmers and users,
depending on the application. 
Database Management System
Advantages of RDBMS
• Accessibility:
Ad hoc Data access using query languages (such as SQL)
means that queries can be automatically compiled,
executed, and optimised without resorting to programming

• Correctness:
The semantics of the relational algebra are sound and
complete
Database Management System
• Flexibility:
The relational model separates the logical from the
physical model and this decoupling increases
flexibility .

• Integrity:
Constraints helpful in ensuring that structural changes
did not adversely effect the meaning of the database
Database Management System
• Predictability:
The consistent semantics enables users to easily
anticipate the result of a given query

• Multiple views:
It is straightforward to present different user
groups different views of the same database
• Concurrency Control and Transaction
Management
• Backup and Recovery
• Security
Database Management System
There are three main features of a database
management system that make it attractive to
use a DBMS in preference to other systems.
These features are:
• Centralised data management,
• Data independence
• Systems integration.
Database Management System
A word about SQL(Structured Query Language)
SQL allows users to access data in relational database
management systems, such as Oracle, Sybase,
Informix, Microsoft SQL Server, Access etc.
SQL also allows users to define the data in a database,
and manipulate that data.
Database Management System
SQL consists of a number of keywords and a number of key
concepts. Each of the following sections focuses on one keyword
or concept:
• Select …. From
• Where
• Functions
• Count
• Group by
• Having
• Alias
• Joins
Database Management System

Disadvantages
of
Databases
Database Management System
While database gives lot of benefits/ advantages,
there are always some weaknesses because of
which there are are some possible disadvantages:
Confidentiality, Privacy and Security
When information is centralized and is made available to users
from remote locations, the possibilities of abuse are often more
than in a conventional system. To reduce the chances of
unauthorized users accessing sensitive information, it is
necessary to take technical, administrative and, possibly, legal
measures. Databases store valuable information that must be
protected against deliberate trespass and destruction.
Database Management System
Data Quality
Since the database is accessible to users remotely, adequate
controls are needed to control users updating data and to control
data quality. With increased number of users accessing data
directly, there are chances for users to damage the data. Unless
there are suitable controls, the data quality may be compromised.
Database Management System
Data Integrity
Since a large number of users would be using a database
concurrently, technical safeguards are necessary to ensure that
the data remain correct during operation. The main threat to data
integrity comes from several different users attempting to update
the same data at the same time. The database therefore needs to
be protected against inadvertent changes by the users.
Database Management System
Enterprise Vulnerability
Centralizing all data of an enterprise in one database may
mean that the database becomes an indispensable resource.
The survival of the enterprise may depend on reliable
information being available from its database. The enterprise
therefore becomes vulnerable to the destruction of the
database or to unauthorized modification of the database.
Database Management System
The Cost of using a DBMS
Conventional data processing systems are typically designed to
run a number of well-defined, preplanned processes. Such
systems are often "tuned" to run efficiently for the processes that
they were designed for. Although the conventional systems are
usually fairly inflexible in that new applications may be difficult to
implement and/or expensive to run, they are usually very efficient
for the applications they are designed for.
Database Management System

Limitations
of
Databases
Database Management System
There are some limitations to the Relational
database management system.
1. RDBMS do not have enough storage area to handle
data such as images, digital and audio/video.
The system was originally created to handle the
integration of media, traditional fielded data, and
templates.
2. RDBMS does not support any other language except
SQL.
Database Management System
3. The new Programming languages e.g. C++, java
Script etc. do not work very efficiently with the
RDBMS.

4. The RDBMS works under strict discipline ,


where relationships between entities are
defined by values.
Database Management System

What
is
Data
Warehousing?
Database Management System
Data Warehousing
Definition
•A data warehouse can be defined as any centralised data
repository which can be queried for business benefit
•warehousing makes it possible to
- Extract archived operational data
- Overcome inconsistencies between different legacy
data formats
- Integrate data throughout an enterprise, regardless of
location, format, or communication requirements
- Incorporate additional or expert information
Database Management System
Characteristics of a data warehouse as
defined by Bill Inmon (IS guru)
• Subject-oriented - data organized by subject instead of
application e.g.
- an insurance company would organize their data by
customer, premium, and claim, instead of by different
products (auto, life, etc.)
- contains only the information necessary for decision support
processing
Database Management System

• Integrated - encoding of data is often inconsistent e.g.


- Gender might be coded as “M" and “F" or 0 and 1 but
when data are moved from the operational
environment into the data warehouse they assume a
consistent coding convention
Database Management System
-Time-variant - the data warehouse contains a place for
storing data that are 5 to 10 years old, or older e.g.
- this data is used for comparisons, trends, and
forecasting
- these data are not updated
- Non-volatile - data are not updated or changed in any
way once they enter the data warehouse data are only
loaded and accessed
Database Management System

Thank You

Anda mungkin juga menyukai