Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

MIS - Chapter 6

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 42

Chapter 6

Introduction to Database
system
Outline

 Database system and File System


 Main Characteristics of the Database Approach
 Actors on the scene function of DBMS
 Database Languages (DDL,DML,DCL)
 Database models
 Advantages of Using DBMS
What is data base?
 It is an organized collection of facts and
information, such as records on employees,
inventory and customers.
 A shared collection of logically related data,
designed to meet the information needs of multiple
users in an organization.
 A collection of information organized and
presented to serve a specific purpose.
DBMS
 A database management system (DBMS) is
a computerized system that enables users to
create ,maintain large amounts of data
efficiently and allowing it to persist for a long
periods of time.
 The DBMS is a general-purpose software
system that facilitates the processes of
defining, constructing, manipulating, and
sharing databases among various users and
applications.
Cont…
 Defining: involves specifying data types, structure and
constraints.
 Constructing: is the process of storing the data into a
storage media.
 Manipulating: is retrieving and updating data from and
into the storage.
 Sharing: allows multiple users to access data.
Cont…
 The goal of a DBMS is to provide an environment
that is both convenient and efficient to use in
– Retrieving information from the database.
– Storing information into the database.
 Databases are usually designed to manage large
bodies of information This involves
– Definition of structures for information storage (data
modeling).
– Provision of mechanisms for the manipulation of
information file and systems structure, query processing).
– Providing for the safety of information in the database
(crash recovery and security).
– Concurrency control if the system is shared by users.
What is a Database System?

 Database System: a database together with database


management system
 A database system is basically a computerized record
keeping system whose overall purpose is to maintain
information and to make that information available on
demand.
 The information concerned can be anything that is
deemed to be of significance to the individual or
organization the system is intended to serve.
 It , needed to assist in the general process of running the
business of individual or organization.
Database System development approach
There are three level of Database System development
approach:

1. Manual Approach
2. Traditional File Based Approach
3. Database Approach
1.Manual Approach

 In the manual approach, data storage and


retrieval follows the primitive and
traditional way of information handling
where cards and paper are used for the
purpose.
 The data storage and retrieval will be
performed using human labour.
Cont…
 Each of the files containing various kinds of
information is labeled and stored in one ore more
cabinets.
 The cabinets could be kept in safe places for
security purpose based on the sensitivity of the
information contained in it.
 Insertion and retrieval is done by searching first
for the right cabinet then for the right file then for
the information.
 One could have an indexing system to facilitate
access to the data
Limitations of the Manual approach
 Prone to error
 Difficult to update, retrieve, integrate
 You have the data but it is difficult to
compile the information
 Limited to small size information
 Cross referencing is difficult
Cont…
 An alternative approach of data handling is a
computerized way of dealing with the
information.
 The computerized approach could also be
either decentralized or centralized base on
where the data resides in the system.
2. Traditional File Based Approach
 File based systems were an early attempt to
computerize the manual filing system.
 The traditional file processing system is file-
directory structure supported by a conventional
operating system.
 A file system organization of data lucks a number
of major features of a database system,
 This approach is decentralized computerized data
handling method.
 A collection of application programs perform
services for the end-users.
Cont…
 In such systems, every application program that
provides service to end users define and manage its
own data
 Since every application defines and manages its own
data, the system is subjected to serious data
duplication problem.
 File, in traditional file based approach, is a collection
of records which contains logically related data.
Limitations of File Based approach
 Data isolation: Related data may be scattered across
files.
 Duplication or redundancy of data
 Data dependency on the application
 Incompatible file formats between different applications
and programs creating inconsistency.
 Fixed query processing which is defined during
application development
Cont…
 The limitations for the traditional file based data
handling approach arise from two basic reasons.

1. Definition of the data is embedded in the


application program which makes it difficult to
modify the database definition easily.

2. No control over the access and manipulation of


the data beyond that imposed by the application
programs.
3. Database Approach
 Database is just a computerized record keeping
system or a kind of electronic filing cabinet.
 Database is a shared collection of logically related
data designed to meet the information needs of an
organization.
 Database is a collection of logically related data
where these logically related data comprises
entities, attributes, relationships, and business
rules of an organization's information.
 In addition to containing data required by an
organization, database also contains a description of
the data which called as “Metadata” or “Data
Dictionary” or “Systems Catalogue” or “Data
about Data”.
Cont.
 The purpose of a database is to store information and to
allow users to retrieve and update that information on
demand.
 Database is deigned once and used simultaneously
by many users.
 Unlike the traditional file based approach in
database approach there is program data
independence.
 That is the separation of the data definition from
the application. Thus the application is not affected
by changes made in the data structure and file
organization.
Benefits of the database approach
 Data can be shared: two or more users can
access and use same data instead of storing data
in redundant manner for each user.
 Improved accessibility of data: by using
structured query languages, the users can easily
access data without programming experience.
 Redundancy can be reduced: isolated data is
integrated in database to decrease the
redundant data stored at different applications.
Cont…
 Inconsistency can be avoided: controlled data
redundancy will avoid inconsistency of the data in the
database to some extent.
 Integrity can be maintained: data at different applications
will be integrated together with additional constraints to
facilitate shared data resource.
 Security majors can be compulsory: the shared data can
be secured by having different levels of authorization and
other data security mechanisms.
• Centralized information control: since relevant data in the
organization will be stored at one repository, it can be
controlled and managed at the central level.
To ensure data integrity ,
DBMS should maintain the following ACID properties:
To ensure data integrity , DBMS should maintain the following
ACID properties:
• Atomicity: A transaction is an atomic unit of processing; it
is either performed in its entirety or not performed at all.
• Consistency preservation: A correct execution of the
transaction must take the database from one consistent
state to another.
• Isolation: A transaction should not make its updates
visible to other transactions until it is committed; this
property, when enforced strictly, solves the temporary
update problem and makes cascading rollbacks of
transactions unnecessary
• Durability or permanency: Once a transaction changes the
database and the changes are committed, these changes
must never be lost because of subsequent failure.
example
• Suppose that Ti is a transaction that transfer 200 birr from account CA2090( which is
5,000 Birr) to SB2359(which is 3,500 birr) as follows
• Read(CA2090)
• CA2090= CA2090-200
• Write(CA2090)
• Read(SB2359)
• SB2359= SB2359+200
• Write(SB2359)
• Atomicity- either all or none of the above operation will be done – this is materialized
by transaction management component of DBMS
• Consistency-the sum of CA2090 and SB2359 be unchanged by the execution of Ti i.e
8500- this is the responsibility of application programmer who codes the transaction
• Isolation- when several transaction are being processed concurrently on a data item
they may create many inconsistent problems. So handling such case is the
responsibility of Concurrency control component of the DBMS
• Durability - once Ti writes its update this will remain there when the database
restarted from failure . This is the responsibility of recovery management components
of the DBMS
Concurrency Problem
• The Lost Update Problem(Write Write Problem) :-
– A Lost Update Problem occur when two
transactions that access the same database
items have their operations in a way that
makes the value of some database item
incorrect.
– In other words, if transactions T1 and T2 both
read a record and then update it, the effects
of the first update will be overwritten by the
second update.
A=1000 T2 T2 A=1000
T1 T1
Read(A) Read(A)
A:=A+200 A:=A-500
. .
.
. .
500 . .
. . 1300
override . .
Read(A) Read(A) override
1200 this . .
time A:=A-500 A:=A+300 500, this
Write(A) Write(A) time Bank
Customer . .
. lost 500
lost 200 . Write(A) Birr
Birr
The result
Write(A) Must be
800 Birr
must be
700 Birr

Mohammed Tune (Asst. Prof) 24


Transaction and System Concepts
 A transaction is an atomic unit of work that is either completed in
its entirety or not done at all.
 For recovery purposes, the system needs to keep track of when
the transaction starts, terminates, and commits or aborts.
 Transaction states:
 Active state -indicates the beginning of a transaction execution
 Partially committed state shows the end of read/write
operation but this will not ensure permanent modification on
the data base
 Committed state -ensures that all the changes done on a record
by a transition were done persistently
 Failed state happens when a transaction is aborted during its
active state or if one of the rechecking is fails
 Terminated State -corresponds to the transaction leaving the
system
Limitations and risk of Database Approach
 Requires professional and specialized personnel.
 Complexity in designing and managing data
 Too cost during conversion from the old to the
new system
 High cost to be incurred to develop and maintain
the system
 Complex backup and recover services from the
users perspective
 Reduced performance due to centralization and
data independency
 High impact on the system when failure occurs to
the central system.
DBMS and Components of DBMS
Environment
 A DBMS is software package used to design, manage,
and maintain databases.
 Each DBMS should have facilities to define the
database, manipulate the content of the database and
control the database.
 These facilities will help the designer, the user as well
as the database administrator to discharge their
responsibility in designing, using and managing the
database. It contain the following facilities:
 Data Definition Language (DDL):
 Data Manipulation Language (DML):
 Data Control Language (DCL):
Data Definition Language (DDL):
 Language used to define each data element
required by the organization.
 Commands for setting up schema or the
intension of database
 These commands are used to setup a
database, create, delete and alter table with
the facility of handling constraints
Data Manipulation Language (DML):
 Is a core command used by end-users and
programmers for the:
retrieval of information from the database
insertion of new information into the database
deletion of information in the database
modification of information in the database
e.g. SQL
 Since the required data or Query by the user will be
extracted using this type of language, it is also called
"Query Language"
Data Dictionary:

 Due to the fact that a database is a self


describing system, this tool, Data
Dictionary, is used to store and organize
information about the data stored in the
database.
DCL (Data Control Language:
 DCL mostly concerned with rights, permissions and other controls of
the database system includes commands such as GRANT &
REVOKE privilege . DCL statements control the level of access that
users have on database objects.
 Data Control Languages are commands that will help the Database
Administrator to control the database.

 GRANT – allows users to read/write on certain database


objects
 REVOKE – keeps users from read/write permission on
database objects
Roles in Database Design and Use
 As people are one of the components in DBMS
environment, there are group of roles played by different
stakeholders of the designing and operation of a database
system.
Data Base Administrator (DBA):
 Administering the resources in a database environment
 Authorizing access to the database, coordinating and
monitoring its use.
 Acquiring software and hardware resources as needed.
 Accountable for problems like poor security, poor
performance of the system
 Involves in all steps of database development
Database Designers

 Identifies the data to be stored and choose the


appropriate structures to represent and store the data.
 Should understand the user requirement and should
choose how the user views the database.
 Involve on the design phase before the implementation
of the database system.
Systems Analyst and Application
programmer
 System analyst determines the user requirement and
how the user wants to view the database.
 The application programmer implements these
specifications as programs; code, test, debug,
document and maintain the application program.
 Determines the interface on how to retrieve, insert,
update and delete data in the database.
 The application could use any high level
programming language according to the
availability, the facility and the required service.
End users

End users are the people whose jobs require access to the
database for querying, updating, and generating reports; the
database primarily exists for their use. There are several
categories of end users:
Native Users
Sizable/large proportion of users
Unaware of the DBMS
Only access the database based on their access
level and demand
Use standard and pre-specified types of queries.
Cont.
 Casual users:
users who access the database occasionally.
Need different information from the database each time.
Use sophisticated database queries to satisfy their needs.
Are most of the time middle to high level managers.
 Sophisticated Users:
Are users familiar with the structure of the Database and
facilities of the DBMS.
Are most of the time engineers, scientists, business
analysts, etc
Have higher level queries
Database models
• Database Model is a set of concepts to describe the
structure of a database, and certain constraints that the
database should obey.
• It is a description of the way that data is stored in a
database.
• Data model helps to understand the relationship
between entities and to create the most effective
structure to hold data.
• The main purpose of Data Model is to represent the
data in an understandable way.
Relational Database Model
• The term is originates from the branch of mathematics called
set theory and relation
• Can define more flexible and complex relationship
• Viewed as a collection of tables called “Relations” equivalent to
collection of record types
• Stores information or data in the form of tables  rows and
columns
• A row of the table is called tuple equivalent to record
• A column of a table is called attribute  equivalent to fields
• Data value is the value of the Attribute
It facilitates multiple views of the same database
for different users.
Advantages of using DBMS
 Controlling Redundancy in data storage, development and
maintenance efforts.
 Restricting Unauthorized Access (security and
authorization)
 Providing persistent storage for program objects and data
structure Providing Multiple User Interfaces
 Representing Complex Relationships Among data
 Enforcing Integrity Constraints
Con..
 Providing Backup and Recovery
 Centralized control – Data quality and integrity
maintained
 Data easily shared, but still controlled by DBMS
 Database searches and analysis faster through DBMS
through “user-friendly” interfaces
 Efficient Data Access
D! ! !
E N

You might also like