You are on page 1of 19

CMT 109 Database Systems

Chapter 1: Introduction to Database Systems store multimedia content such pictures, video clips and sound
1.1 Chapter objectives messages. Classical examples include geographical
By the end of this chapter, learners should be able to:
Information System (GIS) used to analyse and store maps,
§ Demonstrate thorough understanding of database
weather data and satellite images. Data warehouses and
related concepts
Online Analytical Processing(OAP) used by companies to
§ Demonstrate thorough understanding of DBMS issues
extract and analyse useful information, Real time active
such as functions and services provided by DBMS
database technology used to control industrial and
§ Exhibit thorough understanding the two categories of
manufacturing processes and lastly search techniques are
database users
being used to www in order to improve search for vital
§ Elucidate impacts of database approach.
information which is needed by users browsing the internet
1.2.1 Introduction and Background
among other emerging concepts.
Database systems have become more indispensable in our day
to day life in this new era of digital divide. Most of us
encounter several activities that require some interaction with
Common examples of database applications in the real world
the database. For example if we make a transaction from a
include:
bank ,use of an automated library to search for an article ,if
1.2.2 Purchase from a supermarket
we access our academic records from our academic systems
Any time we purchase goods or services from a supermarket,
chances are very high that we are accessing ,this information
chances are very high that we are interacting with a database.
from a database.
The checkout assistant uses the scanner or barcode to scan for
Traditional database applications store most information in a
item of your purchase.
textual format or in numeric. Current information systems

4
CMT 109 Database Systems

1.2.4 Accessing library resources


Most libraries has a database containing learning resources
This is integrated with an application program that uses the
such as textbooks, journals e.t.c. the database may sometimes
bar code to find out the exact price of the item from an
contain details of the students, reservations which they have
organization database. Supermarket uses database for other
made and so on. Sometimes these libraries may provide
functions such as to notify them when the stock reorder level
automated indexes to help their learners/users to search for
is below the limit for each item. They also use a database to
the required resources with ease. All these facilities are
search for the availability of an item using an application
provided by database applications. Some library may provide
program.
enhanced features to their learners such as reminding them
1.2.3 Booking a holiday
Any time we make enquiries about a holiday, the travel agent when the books are due or facilities to allow library users to
may have to access several databases that contain holiday and reserve books and be informed of its availability when
flight details. It’s the work of the database system to make all available.
the necessary booking arrangements. The system must for 1.2.5 Studying at university
University keep information their students (the courses they
example ensure that two or more agents do not book the same
are enrolled, their marks and grades, modules/units/courses
holiday or overbook the seats on a flight for example. If for
you have done in the previous year’s e.t.c). All these are
example there is only one seat available for a particular flight
accomplishes using a database system. There may be a
and two passengers or agents are trying to book for this seat
database containing information concerning the staffs who
concurrently, the database should recognize this situation and
works at the university, employee salary e.t.c.
allow on party to book the seat and inform the other that there
1.2.6 Using the internet
are no seats available

5
CMT 109 Database Systems

A number of E-commerce organizations use database The manual system works well if and only if the numbers of
mounted on their organization web server to provide items being stored are minimal. They also work relatively
esteemed customers. The database could be accessed using well even if the numbers of items being stored are large and
web based applications, mobile applications e.t.c we need only to store and retrieve the information in these
files.
Customers can browse through available products, search
their catalogue of product and also use their credit card to The main challenge associated with manual file based
purchase their goods and have them delivered at their door approach is cross reference information across more than one
step by shipping companies. file. For example, we may have a department named registry

1.2 File Based System in a college/university and it keeps information about the
File based system is a collection of application programs that students. At the same university, we have a department
perform services for the end-users such as the production of named accounts which keeps track of student school
reports. Each program defines and manages its own data. It payment. Consider how it will be hard to generate the
was an early attempt to computerize the manual filling following reports.
systems. § Which student has paid the school fees?
§ How many units has the student registered?
Manual filling system used to hold so many files well labelled To implement this you will need the following files
and store in one more cabinets. Sometimes these cabinets used Accounts files
to have locks to enhance and could be located in secure areas Student (RegNo, Stud_Fname, Stud_Mname, Dateofbirth,
of the organization as a security measure Paddress, TelNo)

6
CMT 109 Database Systems

Fee_payment (regno, dateofpayment, balance) To solve this challenge, application developers must
synchronise the processing of the two files to ensure that the

Registry files correct data is extracted from these files. This can become a
Student (regno, stud_Fname, Stud_Mname, Dateofbirth, Paddress, serious challenge if we are dealing with many files.
TelNo) Data redundancy/duplication of data
Because of the decentralized approach adopted by file based
Course (course_code, Course_name, Description)
processing, the approach encouraged untamed redundancy of
Student_course (RegNo, course_code, semester)
data.
Redundancy is undesirable since it wastes money and time to
In this kind of approach, there is a clear indication that there
enter data multiple times as well as consumption of extra
is significant duplication of the same information in these two
storage space.
departments.
In the following section, we shall attempt to discuss some of
Redundancy also leads to loss of data integrity that is leads to
the limitations associated with file based
data that is inconsistent. For example, if the accounts
Separation and isolation of data
Data from the files are isolated from each other making access department alters the postal address of a given student then
of data a daunting task e.g. It’s difficult for accounts the registry department fail to do so, then this may lead to an
department to know which students have been registered for inconsistent record for that student. This could lead to ugly
which courses by the registry department. situations e.g. student’s transcripts or other official documents
being sent to the wrong postal address
Data dependence

7
CMT 109 Database Systems

The physical structures as well as the storage structure of files However, the structure of a file generated by C program may
and records were defined in the application code. This means be different from one generated by Java program. The
if the file structure changed, there was need to rewrite the incompatibility of such files made them difficult to process
entire application that access that file afresh. For example, mutually.
increasing the size of RegNo from 9 to 12 integers means we
have to write a program that converts RegNo to the new Sometimes, it may require application developers to write
format. Consequently, the access program of the file needed customized applications for converting between two or more
to be modified to conform to the new file structure. files to a common format which would facilitate data
Sometimes, there might be numerous programs accessing that processing which is time consuming as well as expensive.
particular file hence it was the programmers work to identify Fixed queries/proliferation of application programs.
Although thee file based approach is a great improvement of
them, modify and retest them afresh to see if they conform to
the manual system, as requirement for new and modified
the new file structure. In a number of occasions, it proved to
queries grew, more challenges started to emerge since file
be time consuming as well as error prone.
based systems were very dependent upon the application
developer who had to write the queries or any reports that the
Incompatible file formats
Since the format of files is usually embedded in the end users required.
application programs, the structure of this file used to be
dependent on the programming language. Two great problems arose i.e. organization producing fixed
types of reports hence there was no facility for
accommodating unplanned queries or unavailable data types.

8
CMT 109 Database Systems

The other problems witnessed was a case of too much worked ii Giving application programs control over access and
being handled by the department manipulation of data
As a result, too much pressure was exerted on the staff 1.4 Definition of key terms
resulting to programs that were inefficient in meeting the Data

demands of the end users and as well as maintenance of the Known words that are recorded and have implicit

files becoming a challenge. became a daunting task leading meaning e.g. contact address

to omission of certain functionalities such as Database

§ Lack of security or integrity. It’s a single collection of structured data stored with

§ Access of files being limited to only one user at a time minimum duplication so as to provide consistent and

hence the files did support multiple views of the data controlled pool of data. A database represents some aspect

§ Recovery in case of hardware of software failure was of real world, sometimes called miniworld.
Database Management Systems (DBMS)
limited or non-existent.
It’s a collection of programs that enables users to create and
The outcomes of file based approach were unacceptable and
maintain a database. DBMS can be termed as a general
hence another solution to solve the maladies of file based was
purpose software system that facilitates the process of
needed.
defining, constructing and manipulating databases for
1.3 Database Approach
The abysmal limitations of file based approach lead to various applications.

database approach which sought to provide the following Miniworld


It refers to some part of the real word about which data is
i Separate the definition of the data from application
stored E.g. student’s grade at a university.
program

9
CMT 109 Database Systems

File/Entity/table
A file is an ordered arrangement of records in which each
record is stored in a unique indefinable location
We can also define it as an object in the real world about
which we would like to capture data about e.g. patients,
wards, doctors e.t.c.
Record/Row/Tuple
It’s a complete set of related fields. We can also refer to it as
an instance of the database
SNo Fname Mname DOB
1 Kariuki Jane 22-05-1982 Record
Field/attribute/column
A property/characteristic that holds a piece of information
about an entity E.g. name, contact address can be a
property of entity student.

10
CMT 109 Database Systems

1.6 Characteristics of database approach


Database systems have unique characteristics which
1.5 Database Environment
distinguish it from conventional approach of programming
using file. Database approach aims at eliminating the
Users/programmers
limitations of file based approach using the following
characteristics.
Application program/Queries
Database system 1.6.1 Self-describing nature of database systems
Database systems not only contain the database itself but also

DBMS contain a complete definition/description of the data


Software to process queries/programs
structure and constraints which are stored in the system
catalogue. This information includes structure of each file, the
Software to access stored data
type and storage format of each data item and various
constraints on the data. We collectively call this information
as meta-data.
1.6.2 Insulation between programs and data and Data
abstraction
Stored database Stored
definition database While in Traditional file system change in file structure means
(metadata)
we have to change the application structure and vice versa,
the opposite is the case for dataset systems.

11
CMT 109 Database Systems

In database approach, access programs do not require such With Multiple DBMS, we can have multiple users should
kind of changes since the structure of the data files is stored in being allowed to access the database of the same time. This is
the DBMS catalogue separately from the access program. We vital if multiple applications are to be integrated.
refer to this as program-data independence.
However concurrency control software are essential to ensure
The characteristic that allows program-data independence is that the multiple users trying to update the same data do so in
called data abstraction. DBMS usually provide users with a a controlled manner to ensure updates are done correctly.
conceptual representation of data that does not include how 1.7 Database Application Programs
the data is stored/operations implemented. It’s a computer program that interacts with the database by

1.6.3 Support multiple views of the data issuing an appropriate request (usually an SQL statement) to
Database systems are usually accessed by a number of users the DBMS. This programs could be mobile based, web based,
concurrently. These users may require different perspective PC based e.t.c
view of the database. For instance, one user may be interested
only in printing his/her bank statement. A second user may The applications could be conventional batch applications or,
be interested in only checking his bank balance. Though the more typically nowadays, they will be online applications
two are interrogating the same database, they may be written using some programming language or in some
represented with a different view of the same database. higher- level fourth- generation language.
1.6.4 Sharing and multiple user transaction processing

12
CMT 109 Database Systems

Database application programs can be written in a third- DBMS and applications require hardware to run. This
generation programming language (3GL), such as C,C++, java hardware can range from a single personal computer, to a
e.t.c or using a fourth- generation language (4GL) such as single mainframe, to a network of computers. The choice of
SQL, embedded in a third-generation language. Sometimes, hardware shall depend on the needs of the organization’s
the DBMS may have its own 4GL tools that allow rapid requirements and the DBMS used.
development of applications. Those tools could include Some DBMSs run only on particular hardware or operating
reports generators, forms generators, graphics generators and systems, while others run on a wide variety of hardware and
application generators. operating systems.
1.9.2 Software
Software comprises of the DBMS software, application
1.8 Database Managemenst System (DBMS)
A DBMS is computer software that facilitates the process of programs, together with the operating system, including
defining, constructing and manipulating database for various network software if the DBMS is being used over a network.
applications based on a variety of data models.
1.9.3 Data
It’s the most important component more so from the end-
1.9 Components of The DBMS Environment
DBMS environment is characterised by five major users’ point of view acting as a bridge between technology
components in the DBMS environment i.e. hardware, and users. The database contains the operational data and the
software, data, procedures and people metadata i.e. Data about data.
1.9.1 Hardware 1.9.4 Procedures

13
CMT 109 Database Systems

Procedures refer to the instructions and rules that govern and The final component is the people involved with the system.
design and use of the database. The users of the system and We shall discuss more on this component later in this chapter.
the staff that manage the database require documented 1.10 Uses of DBMS
procedures on how to use or run the system. There are four major uses of DBMS:-
1.10.1 Database development
Some of the procedures include on how to: Database packages e.g. Ms Access, Lotus usually allow end
§ Log on to the DBMS; users to develop database they need. For large organizations

§ Use a particular DBMS facility or application program; using client server’s mainframe system, it is the integrity of
§ Start and stop the DBMS; the organization database Database developers usually use

§ Make backup copies of the database; Data Definition Languages (DDL) in DBMS like Oracle to
§ Handle hardware or software failures. This may develop and specify data contents relationships and structure
include procedures on how to identify the failed each databases

component, how to fix the failed component (for 1.10.2 Database Interrogation

example, telephone the appropriate hardware Database interrogation refers to the process of querying for

engineer) and , following the repair of the fault, how to information from a database using a query language or a

recover the database; report generator .Users can retrieve an immediate response in

§ Change the structure of a table, reorganize the database printed reports /video display

across multiple disks, improve performance, or archive 1.10.3 Database maintenance

data to secondary storage.


1.9.5 People

14
CMT 109 Database Systems

We need to maintain the database frequently to reflect new executing DDL statements, we get a set of tables which
transactions .Other changes must be made to ensure accuracy collectively make the database
and integrity of the data in the database § Allow users to manipulate the database
1.10.4 Application development § DBMS should allow users to manipulate the data in the
DBMS packages play an important role in apps development database using Data Manipulation Language (DML)
.End user’s system analysts as well as other apps developers Some of the DML operations include insertion,
can use 4GL programming languages and built in slow modification, deletion and retrieval.
development tools provided by many DBMS to develop § A user accessible catalog
custom applications.E.g, you can use oracle DBMS to easily DBMS provides a catalog which is a repository of
develop entry screens, forms, reports, web pages. information describing the data in the database. This
information include the following
1.11 Functions/Services of DBMS
A DBMS provides different types of functions and services as § Names, types and sizes of data items
we are going to discuss in the following section § Names of relationships
§ Data storage, retrieval and update: § Integrity constraints on the data
DBMS must provide its users with the ability to store § Name of authorized users who have access to
retrieve and modify data in the database. the data e.t.c.
§ Allows users to define the database structure § Transaction support
Using Data Definition Language (DDL), database users DBMS ensures that either that all updates corresponding
can specify the data types and structures and the to a given transaction are made or none is made.
constraints on the data to be stored in the database. After § Support of data communication

15
CMT 109 Database Systems

DBMS must integrate with communication software if the DBMS should provide a set of number facilities as
database is hosted over the network outlined below to help the Database Administrator to
§ Services to promote data independence administer the database effectively.
DBMS should provide facilities to support the § Import facilities: to facilitate loading of the
independence of programs from actual structure of the database from flat files
database. § Export facilities: - to facilitate unloading a database
§ Controlled access to the database. to flat files.
DBMS should provide the following to its end user § Monitoring facilities: - which monitor the database
§ A security system, which prevents unauthorized usage and operations.
users accessing the database; § Statistical analysis programs: - to monitor
§ An integrity system, which maintains the performance and usage statistics.
reliability and truthfulness of the data in the § Garbage collection and reallocation to remove deleted
database records physically from storage collection, to consolidate
§ A concurrency control system, which allows the space released and allocate it where it is needed.

shared access of the database; 1.12 Postive impacts of database approach


§ A recovery control system, which restores the Database approach has a number of positive impacts as

database to a previous consistent state following a discussed in the following section

hardware or software failure; 1.12.1 Reduced application development time


Designing and implementing a new database from scratch
§ Utility programs
may take more time than writing a single specialized file

16
CMT 109 Database Systems

applications .However once the database is up and running, during database design by ensuring views of different user
less time is required to create new apps using DBMS facilities. groups are integrated during design.
Development time using a DBMS is estimated to be a sixth to Flexibility
a quarter of that of a traditional file system. DBMS approach ensures database is adaptable to change.
1.12.2 Minimizing redundancy Sometimes, it may be necessary to change the structure of a
Using database keys e.g. primary key and integrity rules such database. Consequently in response it may be necessary to
as unique, DBMS ensures that record don’t duplicate in the add a file to the database or to extent the extent the data
database at any one point. DBMS usually takes care of this elements in a file. Modern DBMS allow certain types of
1.12.3 Availability of up-to-date information 1.12.5 Ease of auditing
Using database approach, As soon as one users updates the With the data and controlled, it makes it makes it easy to
database, the update is available to all the other users. audit the system for its efficiency and effectiveness.
1.12.4 Economic sale 1.12.6 Potential for enforcing standards
The approach usually supports consolidation of data and With the centralized approach of storing data, database
application hence reducing the amount of wasteful overlap administrator can define and enforce standards database for
between activities of data processing personnel in different the entire community. The standards can be defined for
projects / depths. Through this, the organization can avoid names and format of data elements, display formats, report
more powerful processors, and hardware therefore reducing structures and so on.
the overall costs of operations and management. 1.12.7 Rule enforcement
DBMS provides facility for enforcing rules within the
database environment. The rules are meant to make

17
CMT 109 Database Systems

attributes clean and reliable e.g. If we have a rule that says 1.12.11 Provide backup and recovery facilities
that each classroom can hold a given class at a time; it’s DBMS provides facilities for recovering from hardware and
possible to use DBMS to achieve that. software failures performed by the backup and recovery
1.12.8 Restricting unauthorized access subsystem e.g. if a computer fails in the middle of a complex
Since users in the database environment can have different update operation, the recovery subsystem should make sure
roles, DBMS provides facilities for ensuring that only the database is reverted back to state it was in before the
authorized users can view the data and can only program started the execution. Or else the recovery
view/information they are supposed to. Security can be subsystem could ensure that the program is resumed from the
individual based or group based. point at which it was interrupted so that its full effect is
1.12.9 Provide multiple user interfaces recorded in the database.
As a result of different varying levels of technical knowledge
of database users, DBMS provides variety of user interfaces. A good number of DBMS provide facilities for creating
This may include query languages for casual users, periodic copies of attributes. This could be used whenever the
programming language interfaces for application primary disk fails or equipment fails. The DBMS usually
programmers and menu-driven interfaces and natural provides facilities for extracting activities that facilitates the
languages interfaces for standalone users. process of extracting and disseminating attribute set.
1.12.10 Representing complex relationship among data NB: Whenever data is replicated between database servers, so
Database approach enables designers to represent a variety of that the information remains consistent throughout the
complex relationships among data as well to retrieve and database system and users cannot tell you or even know
update related data easily and efficiently.

18
CMT 109 Database Systems

which server in the DBMS they are using, the system can be If there are frequently occurring usage patterns or requests,
said to exhibit some replication transparency. some DBMS can adjust themselves to improve the speed of
in a relation must be related to records in other relation(s). those operations. In some cases, the DBMS may have tools to
1.12.12 Permitting inference and actions using rules monitor performance hence allowing a human expert to make
Some databases provide capabilities for defining deductive the necessary adjustments after viewing the statistics
rules for inference new information from stored database collected.
facts. There may be for example complex rules in the
1.13 Disadvantages of database approach
miniworld for determining when staffs are on leave. This can Despite the numerous advantages of database approach, there

be specified declaratively as rules which when compiled by are a number of disadvantages of using the database

the DBMS can determine all staff on leave. approach compared to the conventional file system.

1.12.13 Computation 1.13.1 Complex conceptual


DBMS usually perform common computations such as Developing a conceptual database for an entire organization

counting, summing, and sorting, grouping e.t.c. Rather than is usually for complex task. As a result a number of

have each computer application implement from scratch. organization end up designing a number of functional

1.12.14 Change and access logging databases e.g. financial database, marketing database e.t.c

DBMS usually provide powerful tools that enable DBA know 1.13.2 Potential catastrophic

who accessed the database, what they changed, and when it The centralization of the resources increases the vulnerability

was changed. Logging services of the DBMS usually keep a and availability of the DBMS. If the database or a component

record of the access occurrences and changes. of the database fails the entire organization will be greatly

Automated optimization affected.

19
CMT 109 Database Systems

1.13.3 Size very good. However, since DBMS is written to be more


The complexity and the breadth functionality provided by generic i.e. to cater for many applications, the end result
DBMS makes its extremely large piece of software therefore maybe some applications not running fast they are supposed
requires substantial memory space to run efficiently. to.
1.13.4 Cost of conversion 1.13.7 High DBMS costs
Sometimes the cost of the DBMS and extra hardware maybe The cost of a DBMS will always vary significantly based on
insignificant compared with the cost of converting the the environment and the functionality provided. E.g. a single
existing applications to run on the new DBMS and hardware. user end DBMS for a PC would retail at 100 us dollars while
The cost also includes training staff to use the new system and for a mainframe multiple users can be between US $ 100,000
subsequent deployment of specialists to assist in conversion and US $ 1,000,000. Apart from the sticker price, other cost
of the application. would include
1.13.5 Additional Hardware costs § Licences costs
The memory requirements of the DBMS may necessitate § User training to maintain the database
procurement of additional storage space. In order to achieve § Annual maintenance costs among other
optimal performance, you may have to purchase a large 1.13.8 Longer running time for applications
machine or a machine dedicated purposely for the DBMS As program complexity increases, so does the amount of time
hence incurring more expenses. required to run this program .Therefore applications using
1.13.6 Performance DBMS may take longer time to run unless installed on very
File based systems are written for specific application domain fast CPUs or disk drives and remain memory resident.
such as payroll, receipting e.t.c hence the end result is always

20
CMT 109 Database Systems

1.14 Database Users all the requirements are captured during the design of
For small personal databases, one personnel can handle the
the overall database.
role of defining, constructing and manipulating the database.
§ End users: - these are the people whose job requires
However, for large database environment, many persons are
access to the database for querying, updating and
involved in performing these tasks.
generating reports. The database exists primary for
their use.
There are two main categories of database users i.e. actor on
§ System analysts and Application programmers
scène and workers behind scene
(Software Engineers):- system analysts usually
1.14.1 Actors on scene
determine the requirements of the end users then
These are categories of users who are involved in day-to-day
develop specifications that meet user requirements. On
use of the database.
the other hand, application programmers implement
§ Database administrator: - this is the chief these specifications as actual programs (test, debug and
administrator who usually oversees and manages the maintain the programs)
database and DBMS and related software. 1.14.2 Workers behind the scene
These are users who maintain the database environment but
§ Database designers: - they are responsible for
are not actively interested in the database itself. They are
identifying the data to be stored in the as well as
instrumental in making the database system available to the
choose appropriate structures to represent and store
users. They are associated with the design, development and
the data. It’s always the task of the database designer to
operation of the DBMS software and system environment..
communicate with all possible database users to ensure
The category includes the following users:

21
CMT 109 Database Systems

§ DBMS designers and implementers: these are users 1.15 Chapter summary
who design and implement the DBMS modules and
1.16 Chapter Excercise
interface as software package. § Define the following database terms
§ Tool developers :these are personnel who design and i. Database
implement tools i.e. software package that facilitate ii. Database management systems (DMBS)
database iii. Entity

design and use .Tools are optional packages that can be iv. Tuple
v. Attribute
commercially bought and include packages for database
§ Discuss four characteristics of database approach.
design ,performance monitoring ,natural language or
§ Clearly explain some of limitations associated with file
graphical interface ,prototyping ,simulation and test
based approach.
generation .
§ Clearly explain why you would advise an organisation to
§ Operation and maintenance personnel: These are
adopt database approach to store their organizational data.
system administrator personnel who are responsible
§ Clearly discuss the two categories of database users
for the actual running and maintenance of the
hardware and software environment database system.

1.17 Further reading suggestions

22

You might also like