Introduction to Databases
Introduction to Databases
What is a Database?
It is a collection of information related to a particular subject or purpose.
A collection of related data or information grouped together under one logical
structure.
A logical collection of related files grouped together by a series of tables as one
entity.
Examples of databases.
You can create a database for;
- Customers’ details. - Library records.
- Personal records. - Flight schedules.
- Employees’ records. - A music collection.
- An Address book (or Telephone directory), where each person has the Name, Address,
City & Telephone no.
DATABASE CONCEPTS.
Definition & Background.
A Database is a common data pool, maintained to support the various activities taking
place within an organization.
The manipulation of database contents to yield information is by the user programs.
The database is an organized set of data items that reduces duplications of the stored files.
Consider a saving bank enterprise that keeps information about all customers and
savings accounts in permanent system files at the bank.
The bank will need a number of applications e.g.
Such a typical filing /processing system has the limitation of more and more files and
application programs being added to the system at any time.
Such a scheme has a number of major disadvantages:
iii. Data isolation - Since data is scattered in various files and files may be in
different formats, it may be difficult to write new applications programs to
retrieve the appropriate data.
iv. Concurrent access anomalies - Interaction of concurrent updates may result
in inconsistent data e.g. if 2 customers withdraw funds say 50/= and 100/=
from an account at about the same time the result of the concurrent execution
may leave the account in an incorrect state.
v. Security problems - Not every user of the database system should be able to
access all the data. Since application programs are added to the system in an
ad-hoc manner, it is difficult to enforce security constraints.
vi. Integrity - The data value stored in the database must satisfy certain types of
consistency constraints e.g. a balance of a bank account may never fall below
a prescribed value e.g. 5,000/=. These constraints are enforced in a system by
adding appropriate code in the various application programs. However, when
new constraints are added there is need to change the other programs to
enforce.
Conclusion.
These difficulties among others have prompted the development of DBMS.
A DBMS is software used to build, maintain and control database systems. It allows a
systematic approach to the storage and retrieval of data in a computer.
Most DBMS(s) have several major components, which include the following:
1. Data Definition Language (DDL) - These are commands used for creating and
altering the structure of the database.
The structures comprise of Field Names, Field sizes, Type of data for each field, File
organizational technique. The DDL commands are used to create new objects, alter
the structure of existing ones or completely remove objects from the system.
2. Data Manipulation language (DML) - This is the user language interface and is
used for executing and modifying the contents of the database. These commands
allow access and manipulation of data for output. They include commands for
adding, inserting, deleting, sorting, displaying, painting etc. These are the most
frequently used commands once the database has been created.
3. Data Control Language (DCL) - These are commands used to control access to the
database in response to DML commands. It acts as an interface between the DML
and the OS. It provides security and control to the data.
5. Form Generator - A form is a screen display version of a paper form, which can be
used for both input and output.
6. Menu Generator - This is used to generate different types of menus to suit user
requirements.
7. Report Generator - This is a tool that gives non- specialized users the capability of
providing reports from one or more files through easily constructed statements. The
reports may be produced either constructed statements. The reports may be produced
either on screen or paper. A report generator has the following features:
Page headings and footings
Page Numbering
Sorting
Combining data from several files
Column headings
Totaling and subtotaling
Grouping of data
Reports titling
8. Business Graphics - Some DBMS may provide means of generating graphical output
e.g. bar charts, pie charts scatter graphics line plots etc. others will allow users to
export data into graphics software.
The term database system refers to an Organisation of components that define and
regulate the collection storage, management and use of data within a database
environment.
The database system is composed of 5 major parts i.e.
a. Hardware
b. Software
c. People
d. Procedures
e. Data
Hardware
This identifies all the systems physical devices e.g. the composition peripherals, storage devices
etc.
Software
These are a collection of programs used by the computers within the database system.
i. O.S - manages all hardware components and makes it possible for all other and
software to run on the composition.
ii. The DBMS - manages the database within the database system e.g. Oracle, DB2, Ms
Access etc.
iii. Applications programs and utilities to access and manipulate data in the DBMS.
People
These are all database systems users:-
1. Systems administrator - Oversees the database systems general operations.
2. Database administrator (DBA) - Manages the DBMS use and ensures that the database is
functioning properly. His functions include:
3. Database designers - These are the database architects who design the database structure.
i. Sophisticated users - These interact with the system without writing programs. They
form their requests in a database query language.
ii. Specialized database applications that do not fit in the traditional data processing
framework e.g. CAD Systems, knowledge based & expect systems.
iii. Application programmers: These interact with the system through the DML &
applications.
iv. Naive – Unsophisticated user who interact with the systems by invoking one of the
permanent application programs that have been written previously.
Procedures
These are instructions and rules that govern the design and use of the database system.
They enforce standards by which business is conducted within the organisation an with
customers.
They also ensure that there is an organized way to monitor and audit both the data that enter
the database and the information that is generated through the use of such data.
6. Data
This covers the collection for facts stored in the database and since data is the raw material from
which information is generated the determination of what data is to be stored into the database
and how the data is to be organized is a vital part of the database designer jobs.
DATABASE MAINTENANCE.
A Database cannot be created fully at once. Its creation and maintenance is a gradual and
continuous procedure. The creation & the maintenance of databases is under the influence of a
set of user programs known as the Database Management Systems (DBMS).
Through the DBMS, users communicate their requirements to the database using Data
Description Languages (DDL’s) & Data Manipulation Languages (DML’s).
In fact, the DBMS provide an interface between the user’s programs and the contents of the
database.
During the creation & subsequent maintenance of the database, the DDL’s & DML’s are used to:
(i). Add new files to the database.
(ii). Incorporate fields onto the existing records in the database.
(iii). Delete the obsolete (outdated) records.
(iv). Carry out adjustments on (or amend) the existing records.
(v). Expand the database capacity, for it to cater for the growth in the volume for enhanced
application requirements.
(vi). Link up all the data items in the database logically.
Data Dictionary.
All definitions of elements in the system are described in detail in a Data dictionary.
The elements of the system that are defined are: Dataflow, Processes, and Data stores.
If a database administrator wants to know the definition of a data item name or the content of a
particular dataflow, the information should be available in the dictionary.
Notes.
Databases are used for several purposes, e.g., in Accounting – used for maintenance of the
customer files within the base.
Database systems are installed & coordinated by a Database Administrator, who has the
overall authority to establish and control data definitions and standards.
Database storage requires a large Direct Access storage (e.g., the disk) maintained on-line.
The database contents should be backed up, after every update or maintenance run, to
supplement the database contents in case of loss. The backup media to be used is chosen by
the organization.
Data Bank.
A Data Bank can be defined as a collection of data, usually for several users, and available to
several organizations.
A Data Bank is therefore, a collection of databases.
Notes.
The Database is organizational, while a Data Bank is multi-organizational in use.
The Database & the Data Bank have similar construction and purpose. The only difference is
that, the term Data Bank is used to describe a larger capacity base, whose contents are mostly
of historical references (i.e., the Data Bank forms the basis for data or information that is
usually generated periodically). On the other hand, the contents of the Database are used
frequently to generate information that influences the decisions of the concerned organization.
TYPES OF DATABASE MODELS.
(1). Relational database model.
A Relational database is a set of data where all the items are related.
The data elements in a Relational database are stored or organized in tables. A Table consists
of rows & columns. Each column represents a Field, while a row represents a Record. The
records are grouped under fields.
~ A Relational database is flexible and easy to understand.
~ A Relational database system, has the ability to quickly find & bring information stored in
separate tables together using queries, forms, & reports. This means that, a data element in
any one table can be related to any piece of data in another table as long as both tables share
common data elements.
Examples of Relational database systems;
(i). Microsoft Access.
(ii). FileMaker Pro.
(iii). Approach.
(2). Hierarchical database model.
It is a data structure where the data is organized like a family tree or an organization chart.
In a Hierarchical database, the records are stored in multiple levels. Units further down the
system are subordinate to the ones above.
In other words, the database has branches made up of parent and child records. Each parent
record can have multiple child records, but each child can have only one parent.
A DBMS performs several functions that guarantee the integrity and consistency of the data in
the database. Most of these functions are transparent to end-users and can be achieved only
through the use of a DBMS. They include:
i. Data Dictionary Management - The DBMS enquires that definitions of the data
element and their relationships (metadata) be stored in a data dictionary. The DBMS
uses the DD to look up the required data component, structures and relationships thus
relieving us from having to code such complex relationships in each program. Any
changes made in the database structure are automatically recorded in the DD thereby
freeing us from having to modify all the programs that access the changed structure.
So, the DBMS provides data obstruction and removes structural or data dependency
of the system.
ii. Data Storage Management - Creation of complex structure required for data storage
is done by DBMS thus relieving us from the difficult task of defining and
programming the physical data characteristics. A modern DBMS system provides
storage for data and related data entry forms or screen definitions, report definition,
data validation rules, procedural code structures to handle video and picture formats
etc.
iv. Security Management - The DBMS creates the systems security that enforces users
security and data privacy within the database. Security rules determine which users
can access database which data item each user can access and which data operations
(read, add, delete, modify) the user may perform. This is important in multi user
database system where many users can access the database simultaneously.
v. Multi User Access Control - The database creates complex structures that allow
multi-user access to the structure. In order to provide data integrity and consistency
the DBMS users sophisticated algorithms to ensure that multiple users can access the
database con-currently and still guarantee integrity of the database.
vi. Back-up and recovery management - To ensure data safety and integrity current
DBMS systems provide special utilities that allow the DBA to perform routing and
special backup and restore procedures. Recovery management deals with recovery of
the database after a failure such as a bad sector in the disk, a power failure etc. Such
capability is critical to the preservation of the database integrity.
vii. Data integrity Management - The DBMS promotes and enforces integrity rules to
eliminate data integrity problems thus minimizing data redundancy and maximizing
data consistency. The relationships stored in the Data Dictionary are used to enforce
data integrity. Data integrity is especially important in transaction oriented database
systems.
viii. Data base Access Language and Application Programming Interfaces - The
DBMS provides data access via a query language. It contains 2 components, DDL
and DML. The DDL defines the structures in which the data are housed and the
DML allows end users to extract the data from the database. It also allows data
access to programmers via procedural languages such as Cobol, C, Pascal, and Visual
Basic etc. It also provides utilities used by the DBA and the Database Designer to
create, implement, monitor and maintain the database.
Query DDL
DML processor compiler
Pre-processor
System
buffers
Database &
System catalog
2. Database Design
3. Implementation
5. Operation
Once the database has passed the evaluation stage it is considered to be operational, the database,
its management, its users and its application programs constitute a complete I.S. The beginning
of the operational phase starts the process of system evaluation.
TASK 1
Read and make notes on Historical Evolution of Database.
Exercise (a).
1. (a). What is a database?
(b). What are Database management system software?
2. Name and explain the THREE types of database models. (6 marks).
3. Explain THREE major concerns in a database system. (6 marks).
4. How are database software generally classified? Give examples of range of products in
each type of classification.
5. State 5 features of an electronic database management system.
6. Explain the importance of using a Database management system for storage of files in an
organization.
Exercise (b).
1. Write short notes on:
(i). Database.
(ii). Database maintenance.
(iii). Data bank.
2. State the components of a data hierarchy.
3. (a). List the TWO classes of database software.
(b). Give FOUR widely used Database management systems today.
4. Identify FIVE functions of a Database management system.
5. Describe the advantages and disadvantages of a database.
Exercise (c).
1. Define the following terms:
(i). Database. (4 marks)
(ii). Database Management System (DBMS). (4 marks).
(iii). Relational database.
(iv). Hierarchical database.
(v). Network database.
2. List and briefly describe THREE advantages of using the electronic database approach in
data storage as compared to the file-based approach.
3. List and briefly describe TWO features found in a typical Database Management System.
4. Identify and describe three major shortcomings of the conventional file structures that are
being addressed by the database approach. (6 marks).
5. Describe the functions of the following tools found in a database management system
(DBMS).
(a). Data Definition Language (DDL) (2 marks).
(b). Data Manipulation Languages (DML) (2 marks).
(c). Data Dictionary (DD) (3 marks).