Text Book
1. Ramakrishna R and J Gerke ;
Database Management System, McGrawHill
Reference Book
1. R Elmasri & S B Navate;
Fundamentals of Database Systems
Seema Agarwal
Joint Registrar
Topics:
1.Introduction to Database
Systems
2.File Systems Vs DBMS
3.Advantages of DBMS
Data: raw facts
Being stored and retrieved
Not to be processed to reveal their meaning to
the user
Information: processed data
Key to good decision making
Data constitute building blocks of
information
Information produced by
processing data
Information reveals meaning of
data
Good, timely, relevant information
is key to decision making
Good decision making key to
organizational survival
4
set of information held in a
computer
One
or more large structured sets of
persistent data, usually associated with
software to update and query the data
collection of data arranged for ease
and speed of search and retrieval
Introduction to Database Systems
A very large, integrated collection
of data
A collection of information stored
in a computer in a systematic way
DBMS (= Database Management
System)
- A software used to manage and
query a database
Data: Known facts that can be recorded and
that have implicit meaning
Database: Collection of related data
Ex. the names, telephone numbers and
addresses of all the people you know
Database Management System: A
computerized record-keeping system
Introduction to Database Systems
Introduction to Database Systems
Introduction to Database Systems
Library catalogues
Medical records
Bank accounts
Stock market data
Personnel systems
Product catalogues
Telephone directories
Train timetables
Airline bookings
Credit card details
Student records
Customer histories
Stock market prices
Discussion boards
and so on
Introduction to Database Systems
data
modeling
capacity
Object-oriented
model (mid 90s)
Object-relational
model (late 90s)
Relational model
(late 80s)
Hybrid model
(mid 80s)
File System
(before 70s)
* adapted from the material in http://www.ktdata.co.kr/ktdata/kthome7/zeus_5.htm
data
management
facilities
Linear files
Sequence of records with a fixed format usually stored on a
single file
Limitation: single file
Hierarchical structure
Network structure: similar to the hierarchical database with the
implementation of many-to-many relationships
Relational structure
Object-Oriented structure
Objects (collection of data items and procedures) and interactions
between them.
Is this really a new paradigm, or a special case of network structure?
Separate implementation vs. implementation on top of a RDBMS
Introduction to Database Systems
Create links between these record types; the
hierarchical model uses Parent Child
Relationships.
These are a 1: N mapping between record types.
This is done by using trees,
For example, store information about an
employee, such as name, employee number,
department, salary.
store information about an employee's children,
such as name and date of birth.
Introduction to Database Systems
The employee and children data forms a hierarchy,
where the employee data represents the parent
segment and the children data represents the child
segment.
If an employee has three children, then there would be
three child segments associated with one employee
segment.
In a hierarchical database the parent-child relationship
is one to many.
This restricts a child segment to having only one parent
segment. Hierarchical DBMSs were popular from the
late 1960s, with the introduction of IBM's Information
Management System (IMS) DBMS, through the 1970s
Introduction to Database Systems
Introduction to Database Systems
There are three data types (record types) in the
database: customers, orders, and line items.
For each customer, there may be several
orders, but for each order, there is just one
customer. Likewise, for each order, there may
be many line items, but each line item occurs in
just one order. So, each customer record is the
root of a tree, with the orders as children. The
children of the orders are the line items.
Problem: What if we also want to maintain
Product information in the database, and
keep track of the orders for each product?
Introduction to Database Systems
Advantages:
Simplicity
Data Security and Data Integrity
Efficiency
Disadvantages :
Implementation Complexity
Lack of structural independence
Programming complexity
Introduction to Database Systems
A member record type in the Network Model can have
that role in more than one set; hence the multivalent
concept is supported.
An owner record type can also be a member or owner
in another set.
The data model is a simple network, and link and
intersection record types (called junction records by
IDMS) may exist, as well as sets between them .
Usually, a set defines a 1:M relationship, although
1:1 is permitted.
The CODASYL network model is based on
mathematical set theory.
Introduction to Database Systems
Introduction to Database Systems
Advantages:
Conceptual Simplicity
Ease of data access
Data Integrity and capability to handle more
relationship types
Data independence
Database standards
Disadvantages
1. System complexity
Absence of structural independence
Introduction to Database Systems
IMS
(hierarchical) IBM
IDMS (network) Computer Associates
CODASYL DBMS (network) Oracle
Introduction to Database Systems
A database model that organizes data
logically in tables.
A formal theory of data consisting of three
major components:
(a) A structural aspect, meaning that data in
the database is perceived as tables, and only
tables,
(b) An integrity aspect, meaning that those
tables satisfy certain integrity constraints,
and (c) A manipulative aspect, meaning that
the tables can be operated upon by means of
operators which derive tables from tables.
Introduction to Database Systems
Here each table corresponds to an
application entity and each row represents
an instance of that entity.
(RDBMS - relational database management
system)
A database based on the relational model
was developed by E.F. Codd.
A relational database allows the definition of
data structures, storage and retrieval
operations and integrity constraints.
Introduction to Database Systems
In such a database the data and relations between
them are organized in tables. A table is a collection
of records and each record in a table contains the
same fields.
Properties of Relational Tables
Values Are Atomic
Each Row is Unique
Column Values Are of the Same Kind
The Sequence of Columns is Insignificant
The Sequence of Rows is Insignificant
Each Column Has a Unique Name
Introduction to Database Systems
Advantages:
Structural Independence
Conceptual Simplicity
Ease of design, implementation,
maintenance and usage.
Ad hoc query capability
Disadvantages:
Hardware Overheads
Ease of design can lead to bad design
Introduction to Database Systems
Object DBMSs add database functionality to
object programming languages
Object DBMSs extend the semantics of the C++,
Smalltalk and Java object programming
languages
A major benefit of this approach is the unification
of the application and database development into
a seamless data model and language
environment.
As a result, applications require less code, use
more natural data modeling, and code bases are
easier to maintain.
Introduction to Database Systems
Advantages:
Capability to handle large number of different
data types
Marriage of object-oriented programming and
database technology
Data access
Disadvantages:
Difficult to maintain
Not suited for all applications
Introduction to Database Systems
Database is a collection of data describing objects and their
relationships
However a DBMS is software designed to assist in
maintaining and utilizing large collection of data.
Database Management System = DBMS
A collection of files that store the data
A big C program written by someone else that accesses and
updates those files for you
Relational DBMS = RDBMS
Data files are structured as relations (tables)
A very large, integrated collection of data.
Models real-world enterprise.
Entities (e.g., students, employee)
Attributes (e.g., student-roll,name,age,address,class
etc.)
Relationships (e.g., Teacher is teaching student)
A Database Management System (DBMS) is a
software
package designed to store and manage databases.
Introduction to Database Systems
Database Management System (DBMS): software
system (collect of software) help to manage the data
contents
Manages Database structure
Controls access to data
Contains query language
Application software
DBMS
Introduction to Database Systems
Database
Goals
of a Database Management System:
To provide an efficient as well as a convenient environment for
accessing data in a database
Enforce information security: database security, concurrency
control, crash recovery
It
is a general purpose facility for:
Defining database
Constructing database
Manipulating database
Backend
for traditional database applications
Backend for large Websites
Backend for Web services
Amazon
Introduction to Database Systems
Sure we can! Start by storing the data in
files:
students.txt courses.txt
professors.txt
Now write C or Java programs to implement
specific tasks
34
Enroll Ram in BBA108:
Write a C/Java program to do the following:
Read
Read students.txt
students.txt
Read
Read courses.txt
courses.txt
Find&update
Find&update the
the record
record Ram
Ram
Find&update
Find&update the
the record
record BBA108
BBA108
Write
Write students.txt
students.txt
Write
Write courses.txt
courses.txt
35
System crash:
Read
Readstudents.txt
students.txt
Read
courses.txt
Read courses.txt
Find&update
Find&updatethe
therecord
recordMary
MaryJohnson
Johnson
Find&update
Find&updatethe
therecord
recordCSE444
CSE444
Write
Writestudents.txt
students.txt
Write
courses.txt
Write courses.txt
CRASH !
What is the problem ?
Large data sets (say 50GB)
Why is this a problem ?
Simultaneous access by many users
Lock students.txt what is the problem ?
36
File System approach
Database
DBMS approach
Data
Raw Facts
Field
Group of characters with specific meaning
Record
Logically connected fields that describe a
person, place, or thing
File and file folder
Collection of related records
38
record
field
39
40
Figure 1.5
41
Each application must move large datasets
between main memory and secondary storage
(must deal with, e.g., buffering, page-oriented
access, etc).
Each application must deal with some method
of identifying all data items in case the
available addressing mode is not sufficient
(e.g., 32-bit addressing cannot directly access
more than 4GB).
Need
special code for different
queries
Requires extensive programming in thirdgeneration language (3GL): COBOL, Basic,
and Fortran (what must be done and how
it is to be done)
Time consuming
depends on physically store data
Makes ad hoc queries impossible
Make difficult to modify file system (each
file has its own system)
Leads to islands of information
43
Data
Dependence
Change in files data characteristics
requires modification of data access
programs
Must tell program what to do and how to
do
Makes file systems cumbersome from
programming and data management views
Structural
Dependence
Change in file structure requires
modification of related programs
44
Field
Definitions and Naming
Conventions
Flexible record definition anticipates
reporting requirements
Selection of proper field names
important
Attention to length of field names
Use of unique record identifiers
45
Data
Redundancy
Different and conflicting versions of
same data
Results of uncontrolled data redundancy
Data anomalies
Modification
Insertion
Deletion
Data inconsistency
Lack of data integrity
46
Must protect data from inconsistency
due to multiple concurrent users
changing it.
Must ensure consistent crash recovery.
Must provide more security and access
control than the password mechanism
offered by operating systems.
advantages
FMS
Simpler to use
Less expensive
disadvantages
Typically no multi-user access
Limited to smaller databases
Limited functionality
Decentralization of data
Redundancy and integrity issues
DBMS
Greater flexibility
Greater processing power
Ensures data integrity
Supports simultaneous
access
Provides backup and
recovery controls
Advanced security
Supports Transaction
Crash Recovery
Difficult to learn
Packaged separately from the
OS
Slower processing speeds
Requires skilled administrators
Expensive
Two tier system or client-server
connection
(ODBC, JDBC)
Data files
Database server
(someone elses
C program)
Applications
49
Databases are
useful
Many computing
applications deal
with large amounts
of information
Database systems
give a set of tools for
storing, searching
and managing this
information
Databases for
you
Databases are a core
topic in computer
science and IT
Basic concepts and
skills with database
systems are part of
the skill set you will
be assumed to have
as a BBA graduate
Introduction to Database Systems
A large amount of data,
Concurrent access by many users,
Fast access,
Consistent data update,
Role-based security,
Robust against hardware failures and
OS
crashes.
Introduction to Database Systems
Data independence
*Application programs no details of data representation
& storage
Efficient data access
* High-quality data compression schemes,
* Fast data retrieval and search algorithms.
Data integrity and security
* Programs can prevent invalid queries from
being executed,
* Access control can be enforced.
Introduction to Database Systems
Centralized data administration
* The DBA can optimize the organization
of the data to facilitate its uses.
Concurrent access
Crash recovery
Reduced application development time
Introduction to Database Systems
Advantages of DBMS
Redundancy can be reduced
Inconsistency can be avoided
Data can be shared
Standards can be enforced
Security restrictions can be applied
Integrity can be maintained
Data independence can be provided
Backup and Recovery
High startup cost (time and effort)
Relatively high maintenance
Big central database doesnt work in
practice
- Though still better than file systems
Finish up with dozens/hundreds of little
data bases
- Physically separate
- All incomplete
- Different data formats
- Different concepts of data
Introduction to Database Systems
Slow Response- need to update data in real time.
- Can be slow & complex to extract data for reports
Application may need to manipulate the data in ways
not supported by query Language. Eg flexible analysis
of text data
But still DBMS have become indispensible tool in
today's scenario
Introduction to Database Systems
Open source Databases
MySQL
PostgreSQL
Commercial Databases
MS SQL Server
MS Access
ORACLE
DB2
Informix
58