1
CST 204 Database
Syste
Management
ms
MODULE 1
Introduction & Entity Relationship (ER) Model
2
Syllabus
• Introduction & Entity Relationship (ER)
Model
▫ Concept & Overview of Database Management
Systems (DBMS).
Characteristics of Database system, Database
Users, structured, semi-structured and
unstructured data. Data Models and Schema - Three
Schema architecture.
Database Languages, Database architectures and
classification.
▫ ER model - Basic concepts, entity set & attributes,
notations, Relationships and constraints, ▫
cardinality, participation, notations, weak entities,
relationships of degree 3.
3
1.Data, Database & DBMS
Data
▫ Known facts that can be recorded and have implicit meaning
Database
▫ The collection of related data
Database-management system (DBMS)
▫ is a collection of interrelated data and a set of programs to
access those data.
▫ General purpose software system that facilitates process of
defining, constructing, manipulating, and sharing database
4
The primary goal of a DBMS is to provide a
way to store and retrieve database
information that is both convenient and
efficient.
5
Database systems are designed to manage large
bodies of information.
Management of data involves both storage of
information and mechanisms for manipulation
of information.
The database system must ensure the safety of
the information stored
If data are to be shared among several users,
the system must avoid possible anomalous
results.
6
Database implicit properties
Universe of discourse(UoD) or Miniworld
▫ Database represent some aspects of real world
▫ Changes to miniworld affects database
A database is a logically coherent collection of data with
some inherent meaning
A database is designed, built and populated with data for
specific purpose
7
DBMS is a general purpose software
system that facilitates process of
defining, constructing, manipulating,
and sharing database.
8
Database System Environment
8
Database-An Example
8
Database-An Example
9
2. Characteristics of the Database
Approach
1. Self describing nature of a database system
2. Insulation between programs and data, and
data abstraction
3. Support of multiple views of the data
4. Sharing of data and multiuser transaction
processing
1
0
2.1 Self-Describing Nature of a Database
System
Database system contains not only the database itself
but also a complete definition or description of the
database structure and constraints.
This definition is stored in the DBMS catalog
(structure, type, storage, constraints)
Information stored in the catalog is called meta- data
and it describes the structure of the primary
database.
The DB software must work equally well with any
number of applications
1
2.2 Insulation between Programs and 1
Data, and Data Abstraction
The structure of data files is stored in the DBMS catalog
separately from the access programs.
This property is called program-data independence
An operation (also called a function or method) is specified in
two parts.
Interface
▫ The interface (or signature) of an operation includes the
operation name and the data types of its arguments (or
parameters).
Implementation
▫ The implementation (or method) of the operation is
specified separately and can be changed without affecting the
interface.
1
2
The characteristic that allows
program-data independence and
program operation independence is
called data abstraction.
1
2.3 Support of Multiple Views of the 3
Data
A database has many users, each user may require a
different perspective or view of the database.
A view may be a subset of the database or it may
contain virtual data that is derived from the database
files but is not explicitly stored.
A multiuser DBMS must provide facilities for
defining multiple views.
1
4
2.4 Sharing of Data and Multiuser
Transaction Processing
DBMS must include concurrency control software
▫ to ensure that several users trying to update the same data do so
in a controlled manner so that the result of the updates is
correct
Transaction is an executing program or process that includes one
or more database accesses( reading or writing records)
DBMS must enforce several transaction properties
▫ Isolation property
▫ Atomicity property
1
5
Isolation Property
Ensures that each transaction appears to execute in isolation
from other transactions
Even though hundreds of transactions may be executing
concurrently.
1
6
Atomicity Property
Ensures that either all the database operations in a transaction are
executed or none are.
Any mechanical or electrical device is subject to failure, and so is
the computer system.
In this case we have to ensure that data should be restored to a
consistent state.
For example an amount of Rs 50 has to be transferred from
Account A to Account B.
Let the amount has been debited from account A but have not been
credited to Account B and in the meantime, some failure occurred.
▫ So, it will lead to an inconsistent state.
▫ So, we have to adopt a mechanism which ensures that either full
transaction should be executed or no transaction should be executed i.e.
the fund transfer should be atomic.
1
7
Concurrent access Problems
Many systems allows multiple users to update the
data simultaneously.
It can also lead the data in an inconsistent state.
Suppose a bank account contains a balance of Rs
500 & two customers want to withdraw Rs100 & Rs
50 simultaneously.
Both the transaction reads the old balance &
withdraw from that old balance which will result in
Rs 450, Rs 400 which is incorrect.
1
8
Security Problems
All the user of database should not be able to access
all the data.
For example a payroll Personnel needs to access
only that part of data which has information about
various employees & are not needed to access
information about customer accounts.
1
3. Advantages of DBMS 9
Controlling Redundancy
Restricting Unauthorized Access
Providing Persistent Storage for Program objects
Providing storage structures and search techniques
for efficient Query Processing
Providing Backup and Recovery
Providing Multiple User Interfaces
Representing Complex Relationship among Data
Enforcing Integrity Constraints
Permitting Inferencing and Actions using Rules
2
0
4. Disadvantages of DBMS
Cost of Hardware & Software
Cost of Data Conversion
Cost of Staff Training
Appointing Technical Staff
Database Damage
2
9
5. ACTORS ON THE SCENE
The people whose jobs involve the day-to-day use of
a large database are called as the actors on the scene.
1. Database Administrators
2. Database Designers
3. End Users
4. System Analyst and Application Programmers
(Software engineers)
2
7
5.1 Database Administrator
A person who has such central control over the
system is called a database administrator (DBA).
The functions of a DBA include:
▫ Schema definition.
The DBA creates the original database schema by
executing a set of data definition statements in the DDL.
▫ Storage structure and access-method definition.
The DBA may specify some parameters pertaining to the
physical organization of the data and the indices to be
created.
2
7
Database Administrator
Administrating the database and the related software
is the responsibility of database administrator (DBA).
He is responsible for authorizing access to the
database, coordinating and monitoring its use,
acquiring software and hardware resources as
needed.
DBA is accountable for security and poor response
time
2
7
5.2 Database Designers
He is responsible for identifying the data
to be stored in the DB and for choosing
appropriate structure to represent and
store data.
DB designer communicate with all DB
users and understand their
requirements , finally create a design that
meets the requirement.
2
3
5.3 Different types of End users
Casual end users – occasionally access the db;
they need different information each time
Na¨ıve users/ parametric end users
Standalone users – maintains personal databases
using readymade program packages
Sophisticated users –includes engineers,
scientists, business analysts, who thoroughly
familiarize with the facilities of DB and implement
their own applications
2
4
Naïve Users
They constanly query and update the DB, uses
standard type of queries and updates called
canned transactions
Eg: bank teller check account balances and post
withdrawal and deposits.
Reservation agents for airlines, hotels.
2
5
5.4 Application programmers
System analysts determine the requirements of end
users and develop specifications for canned
transactions.
Application Programmers: implements these
specification as programs, then test, debug,
document and maintain it.
they can choose from many tools to develop user
interfaces
2
1
DBMS Structure
3
0
WORKERS BEHIND THE SCENE
The people who work to maintain the database system
environment but who are not actively interested in the
database contents as part of their daily job are called as
the workers behind the scene
1. DBMS system designers and implementers
2. Tool developers
3. Operators and maintenance personnel (system
administration personnel)
3
1
Structured, Semi-structured and
Unstructured data
3
2
Structured Data
Represented in a strict format
It has been organized into a formatted repository that
is typically a database.
It concerns all data which can be stored in database
SQL in a table with rows and columns
. Example: Relational data
3
3
Semi-Structured data
Information that does not reside in a relational
database but that have some organizational
properties that make it easier to analyze
With some process, you can store them in the
relation database
But Semi-structured exist to ease space.
• Example: XML data
3
4
Unstructured data
Data which is not organized in a predefined manner or
does not have a predefined data model
It is not a good fit for a mainstream relational database
There are alternative platforms for storing and
managing, it is increasingly prevalent in IT systems and
is used by organizations in a variety of business
intelligence and analytics applications.
• Example: Word, PDF, Text, Media logs.
3
5