Database and RDBMS Concepts Session 1
Database and RDBMS Concepts Session 1
Concepts
(Session 1)
Objectives
File Processing System
Data Base Management System
Different types of DBMS
Data Vs Information
What is data?
facts concerning things such as people, objects,
events, etc.
EX : Marks 80 %, 75 %, 65 %, 99%
What is information?
data that has been processed and presented in a
form suitable for human interpretation.
Ex : Marks of a Student No. 1998 is 80% in
RDBMS course.
Data Vs Information
To derive information from data we
need to Store and Process.
Need systems support to easily
Store
Retrieve
and Modify data
Traditional Method of Storage
Files
File Management System (O/S)
Application
Programs
P1
P2 P3
P4
001 Chandu Enr
002 Steve Pdn
003 Hema Enr
Files in an Organization
Data File
Master files
Transaction files
Others
Computer program files
Backup files
Specialized files: Index files & log files.
Other important files
Object File
Library File
Executable File / Load Module
Temporary Files
What is the significance of each type of file ?
Ways of storing data in Files
4176 Aniruddha Sarkar CAPS
4181 Manoj Saha WENA
4183 Moushumi Dharchoudhury CENA
4203 Suryanarayana D.V.S.S. SONA
4204 Vivek Rai CAPS
4176 AniruddhaSarkar CAPS
4181 ManojSaha WENA
4183 MoushumiDharchoudhury CENA
4203 SuryanarayanaD.V.S. SONA
4204 VivekRai CAPS
4176,Aniruddha Sarkar,CAPS,4181,Manoj Saha,WENA,4183,Moushumi
Dharchoudhury,CENA,4203,Suryanarayana D.V.S.,SONA,4204,Vivek Rai,CAPS
Predefined length
Uses space/commas as character
separators
DATA
DEPENDENCY
INCONSISTENCY
REDUNDANCY
LOSS OF
FLEXIBILITY
MULTIPLE
FILES
UPDATE
PROBLEM
Problems with File approach
Introduction To
Data Base Management
System?
Introduction to Database
Management Systems
The most traditional/common way of managing data is to store them in
files.
File processing system
Files can be
Sequential
Indexed
Relative
In this kind of scenario, the files are managed directly by the operating
system services
The primary focus here is to manage the files effectively rather than
the contents of them
Though this mechanism is very good, it has many draw backs
What are the problems in File
Processing
File processing system manages files rather than the data in them.
How does it affect me ?
File Processing System does not provide effective security
Either the entire file is secured or it is not
Some part of the file cannot be secured
record or column level security is not available
Any program which works with files has to know the physical as well as
the logical structure of the file
Any change in either physical or logical structure of the file, makes
it necessary for the program to be rewritten
Physical Data Dependence
Logical Data Dependence
Introduction to DBMS
Data Base Management System
A DBMS is a special set of software which is used
to manage data (information)
Following are some of the important functions
of a DBMS
Data is Accurate (Accuracy)
Data is provided within a timeframe (Timeliness)
Only required data is provided (Relevancy)
The Database
Database is a set of inter-related data
stored centrally on any online medium
with controlled redundancy which can
be shared by multiple application /
users with a practical ease.
A database is a repository of integrated &
shared data
The Database
Computer based record-keeping system
Collection of interrelated (persistent)
data
Records & maintains data
Represents real world objects
DBMS and File Processing
System
A database is a collection of data
All the information is available centrally
A file is a collection of bits and pieces
stored together as a single entity.
A database system internally relies on the
file processing system to manage its data
Externally to the user, he feels that he is
storing data, rather than a file
Advantages of Database
Redundancy can be reduced
Inconsistency can be avoided
Sharing of Data
Standards can be enforced
Security restrictions can be applied
Integrity of data can be maintained
Conflicting requirements can be balanced
Database Management
System
Interface between user & DB
Constructs, expands & maintains the DB
File creation / deletion
Adding, deleting & modifying records
Selecting records (queries)
Manages one or more databases
Higher level of abstraction
Application Programs using
DBMS Services
Application
Programs
DBMS
File System
Storage
A1
A2
A3
App. pgmmer
Interface thro High
level language
OS (File Mgr, Disk Mgr)
End user
App. pgmmer
Interface thruQuery
OS (File Mgr, Disk Mgr)
DBMS
Where does DBMS fit ?
End user
End user
Physical Storage
(Hardware)
Physical Storage
(Hardware)
DBMS Architecture
Conceptual level
Internal level
External
View
External
View
External
View
DBMS interface
DBMS interface
DISK(s)
Emp. Name
Emp. Address
Emp. Name
Emp. SSN
Emp. Address
Emp. Annual_Salary
Emp. Name : string(25)
Emp. SSN : Integer, Primary key
Emp. Address : string(50)
Emp. Skill : String(6)
Emp. Annual_Salary : Dec(9,2)
Name : string, length 25, offset 0
SSN : Integer, length 4, offset 25,
INDX unique index
Address : string, length 50, offset 29
Skill : String, length 6, offset 79
Annual_Salary : dec (9,2),length 5, offset 85
External
view
Conceptual view
Internal view
User1
User2
DBA
Interaction with DBMS
A user issues an access request using some
particular sub-language (typically SQL)
The DBMS intercepts the request & interprets
it
The DBMS inspects, in turn, the external
schema, the external/conceptual mapping,
the conceptual schema, the
conceptual/internal mapping & storage
structure definition
The DBMS performs the necessary operations
on the stored DB
Data sub-language
Generally data sub-language (DSL) is embedded
in a host language like C or COBOL
Data Definition Language (DDL) :
defines & describes the DB objects
Data Manipulation Language (DML) :
supports the manipulation or processing
such objects
Users of a DBMS
Database Administrator(DBA)
Database Designer
Application Programmer & System
Analyst
End users
Characteristics of DBMS
Data independence
Speedy handling of spontaneous
information requests
Non-Redundancy
Versatility in representing relationships
between data items
Security protection
Real Time accessibility
Comparison of different
systems
For better understanding we have broken the different types of data processing
systems into the following four categories
Rudimentary I/O software
Programs working with flat files
COBOL or C language
File Storage with Access Method
Programs working with file managers like
VSAM or ISAM or Btrieve
COBOL or C Language
Database Management System
Programs written in COBOL or C or Java to work with RDBMS like DB2,
Oracle or Sybase
Programs written in COBOL or RPG to work with Hierarchical and
Network DBMS
Lot of efforts in generating reports
Advanced Management Tools
Use of Rapid Application Development Tools like Report Generator or
Forms Generator for creating large applications
Comparison of Different
Systems
Rudimentary I/O
Software
File Storage with Access
method
Database Management Advanced Management
Systems
No independence Storage Independence Physical Data
Independence
Logical Data Independence
Application
programmer designs
the physical data
layout and embeds it
into his program
Storage units can be
changed without
changing program
Physical data structure
can be changed without
changing programs
Global logical data be
changed without changing
the program
Application
programmers view of
the file is same as the
physical structure
Application
programmers view of
the file is converted into
physical file by the
software
Physical database
structures are completely
separated from the
logical structures
Schema, subschema and
physical data is absolutely
separate
Programmer uses
simple files
Application programmer
more concerned with
structures and
addressing
Application programmer
more concerned with
structures and
addressing
Application programs are
completely insulated from
the data structures
Comparison of Different Systems
Rudimentary I/O
Software
File Storage with
Access method
Database
Management
Advanced
Management
Systems
Entirely
sequential files
Sequential files
with some direct
access
Direct access files
for some
applications
Direct access to all
live data
Data accessed
with primary key
Data accessed
with primary as
well as secondary
keys
Generalized
searching facility
Generalized
searching facility
No attention to
data security
Security
procedures
applied to
individual data
files
Security
procedures applied
to individual data
files
Corporate world
wide security
No tele
processing
Simple remote
inquiry
Remote data entry
and inquiry
Complete interactive
processing remotely.
Computer networks
and distributed
databases
Different types of DBMS
Hierarchical Model
P1 Nut Red 12 London
S1 Jones 10 Paris 300
S2 Smith 20 London 300
P2 Bolt Green 17 Paris
S1 Jones 10 Paris 300
S2 Smith 20 London 400
S3 Blake 10 Paris 200
P3 Screw Blue 12 London
S1 Jones 10 Paris 300
P4 Screw Green 17 Paris
Hierarchical Model
In a hierarchical model a tree like
structure is maintained
For each parent record, there can be
many siblings
The record at the top is called the root
The root may have any number of
dependants. Each of which may have
lower level dependants.
Drawbacks of Hierarchical
model
Insert
It is not possible to insert a supplier who is not
supplying a part currently
Delete
Deleting part information will also delete
information about all the suppliers below it
Update
If you need to update any supplier information,
you need to search the entire database for the
same supplier and update all the records for the
same supplier.
Network Model
S1 Smith 20 London S2 Jones 10 Paris S3 Blake 10 Paris
P1 Nut Red 12 London P2 Bolt Green 17 Paris P3 Screw Red 12 Rome P4 Screw Green 10 Paris
300
200 500 100
300
Network Model
In case of network model, data is
represented by records and links
Many to Many relation can be expressed
easily in a network model
This is not possible in hierarchical model
Records are linked to each other using
connectors
Advantages of Network model
Insert
You can simply insert a new part or supplier
without any need to establish any link
Delete
Deleting a supplier or a part does not delete
recursively
Similarly, just by deleting the connector, the link
between supplier and parts can be broken.
Update
Since suppliers and parts occur only once,
updating requires only change to be made to a
single record rather than searching and updating
many records
Relational Model
S# SNAME STATUS CITY
S1 Smith 20 London
S2 Jones 10 Paris .
S3 Blake 30 Paris .
S
P# Pname Color Weight City .
P1 Nut Red 12 London .
P2 Screw Red 17 Paris .
P3 Bolt Blue 17 Rome .
P4 Screw Yellow 14 London .
P
S# P# Qty
S1 P1 200
S1 P2 100
S1 P3 300
S1 P4 230
S2 P2 100
SP
Relational Model
In relational model the data is simply
represented in the form of tables
If you compare, these three tables closely
resemble sequential files
Compared to the other two models, relational
is simple to understand
There are no links or pointers which connect
different tables
The model is called relational because it uses
relational algebra to represent and manage
information
More On Relational Model
Each row is called as a tuple
Each column is called as a attribute
Domain
It is a set of permissible values that can be stored
in an attribute
This feature is not available in the other models
Relational model provides a set of operators
to the user. Using these operators, the user
can perform any operations on the tables.
Advantages of Relational
Model
Insert
Adding a new supplier or a part is not a problem.
They are independent entities
If you want to represent a relation between
supplier and parts, then insert a tuple in SP table.
Delete
Delete operations are independent of other tables
Update
Updating supplier or part information is very
simple
Relational Database
Management Systems
(RDBMS)
The basic functionality of RDBMS was
conceptualized by Dr. E F Codd, when he was
working for IBM
He laid down certain principles which govern the
functioning of any RDBMS
In 1974, the first standard of SQL was also
developed
Also C J Date from IBM also contributed
towards standardization of RDBMS
Commercial Packages
Hierarchical Model : IMS
Network Model : IDMS
Relational Model : DB2, ORACLE,
SYBASE,
ACCESS,
INFORMIX, SQL Server
End of Session 1