6.
1 Databases
A database is a collection of records stored in a uniform way to allow for the
storage, processing and manipulation of such data. A database like list of all
subscribers on Econet, records in Pastel etc. A database system comprises of four
components; data, users, hardware and software.
6.1.1 Data
Data relates to a subject e.g. data about music collections, books in a library,
voters in a particular area. Such data is stored on a separate database.
The smallest element of a database is a character. A set of characters
together form a data field. A data field can store one aspect of the database
for example the genre, year of release, name of artist, price in CD database.
A set of data fields given under column headings, is a record. Records taken
together make up the database.
6.1.2 Users
These are the people that interact with the database system. Users can be
classified into three main categories:
(a) Application programmers – these are responsible for writing the
application used by end users. They need to understand the database
thoroughly in order to respond to end-user needs more appropriately.
(b) End-users – these access data and extract information from the database
for decision making.
(c) Database administrators – database administrators are the people in
charge of the database. They control access to data and ensure the
database and data are secure and correct.
6.1.3 Hardware
Data and the database need the physical components of computer system in
terms of inputting, processing and storage. Often databases are so large that
extra hardware is needed to support processing and storage.
6.1.4 Software
Software refers to programmes designed to interact with the hardware in
converting data into information. A special form of software called a
database management system links the physical storage of data on
secondary storage and the users. The database management system provides
a user-interface allowing users access to data and to extract information out
of the data.
1
6.1.5 Advantages and disadvantages of databases
Reasons for the use of databases
(a) Easier data sharing leading to economies of scale
(b) Reduced data redundancy
(c) Improved data consistency
(d) Improved data independence
(e) Increased application programmer productivity
(f) Improved data administration and control
(g) Increased emphasis on data as a resource
Drawbacks of databases
a) Concurrence problems - where more than one user access and
attempt to update the same record at the same time - there is file edit
locking to prevent this.
b) Ownership problems - sometimes some individuals tend to own the
data and thus refuse access by other individuals or departments in
the organisation.
c) Resources problem - with database extra resources are needed e.g.
more workstations and other devices.
d) Security problems - there is increased exposure to unauthorized
entry into the data this could be reduced by the use of regularly
changed passwords and by physically denying access to
unauthorized users.
6.1.6 Architecture
A database system consists of three levels; internal, conceptual and external
levels.
Internal level – this represents the physical storage of the data items either
in main memory or secondary storage.
External level – this is the closest level to the end-user of the database. This
represents the view each user has of the data. Users may be restricted to
certain areas of the data and the database depending on their information
needs and role in data processing.
Conceptual level – this lies between internal and external levels
representing the whole database. All end-users are at the external level, only
the database administrator’s external level is the same as the conceptual
level in that the administrator has full access to the whole database.
6.1.7 Terminology
In the language of databases some terms have unique and specific meanings.
2
[Link] Primary fields
All database files (records) have a primary field. This is a unique
key that identifies the database file. Inventory categories may have
stock numbers or codes, students in a university database are
identified with their registration or student numbers. A primary field
(sometimes called a primary key) should identify only one database
file.
[Link] Sorting of database files
To enable faster access to database files, the primary fields can be
sorted. A new database of the primary fields may be created only for
the purposes of allowing quicker access to the records.
[Link] Indexing of database files
Indexing creates an index file similar to a book index. This enables
even faster access to database files.
6.1.8 Types of databases
Different database systems have been developed to accommodate different
types of data structures. The database system required for a tree variable
would not be the same as the one for table variable.
[Link] Relational structure
A relational database consists of tables. Each table represents a data
file. Data records can be uniquely identified by a specific column
(the primary field). The various tables are linked by means of
common fields thus the database files are related through common
fields.
Common examples of relational databases are financial and business
databases.
Benefits of relational databases
(a) They a more flexible than other types of databases.
(b) They have simple designs so they are easy to maintain.
(c) Can combine information from different sources and files.
(d) Good ability to add new data files and records without disturbing
existing programmes and applications.
Weakness of relational databases
3
These databases have a lower processing efficiency; they require
many accesses to data during processing.
[Link] Hierarchical structure
The hierarchical structure relies on organizing data in a tree variable.
Within each record, data elements are organised into segments. The
records are organised like an organisational chart in which the top
level segment is the root. The upper level segment is connected
logically to the lower level segment in a parent child relationship.
Parent segments may have one or more children segments but a child
segment can only have one parent.
1st Child
2nd child
The user works from the root, level by level to the required
information.
Advantage of hierarchical structure
There is processing efficiency in dealing with structured
routine requests
Disadvantages of hierarchical structure
It is complicated to set up.
Qualified programmers are required.
[Link] Network structure
The network database structure depicts various forms of
relationships between the segments. Unlike the hierarchical
structure, the network structure allows for many-to-one or many-to-
many relationships.
AC108 BAC101 CSCM101 MM102
BComm BComm BComm
Accounting 4 Economics Marketing
Charity Kuda Rejoice Kenny Tendai Clever
Advantage of network structure
Reduction in data redundancy
Increased speed of retrieving information
Disadvantages of network structure
Maintenance and operation is more expensive.
Detection and correction of errors difficult
[Link] Multidimensional structure
The multidimensional structure has three or more dimensions. The
relational structure has only two dimensions (rows and columns). In
the illustration below sales have been visualized in terms of product,
time and geographical area.
Product
Time
Advantages of multidimensional structure
The structure is user friendly
Suitable for analytical databases
[Link] Object oriented structure
Data can be extracted by way of query language. The structure and
query language are independent. The structure and query language
to manipulate the data is organised as an integrated object. An object
consists of data values and operations that can be performed on the
data. This allows the model to handle more complex types of data
like music, pictures or graphics. These are mostly used in web-based
applications.
[Link] Data warehousing
A data warehouse stores data from current and previous periods that
has been extracted from an organisation’s databases. The data can
assist in providing a clear picture of the business conditions at a
single point in time. A related concept is data mining which is
5
software that looks for hidden patterns in the data contained in a data
warehouse.
6.1.9 Databases in a distributed environment
Organisations can connect computers to process their transactions in a
distributed way. Two options are available; centralised or distributed
databases.
[Link] Centralised databases
The database is located at a single point. Users input, process and
extract data from their computers from remote points. Database
programmes and database hardware are centrally located. User
computers do not store data but have access to data on the main
database through the network.
The major advantage of centralised database is that data is always
up to date (data currency).
[Link] Distributed databases
Distributed databases are partitioned or replicated and the different
parts installed at various sites. The database is split into segments
(partitions) that are installed close to their primary users.
Advantages of distributed databases
Improved transaction processing response time because
users utilise a local server.
Better disaster recovery
The biggest disadvantage is data is not always up to date.
6.2 Data files
6.2.1 Types of data files
There are different types of data files that are used for storing data; these
are master files, transaction files and table files.
[Link] Master files
This is a permanent file containing data that does not change
frequently. This is the most important data file on a database. The
status of all records on the database will be included in the master
file. Master files have two types: strategic file with data that does
not change frequently like name, address and transaction type files
6
that are updated regularly for example, the outstanding balance of a
debtor.
Inventory
Strategic-type data Transaction-type
data
[Link] Transaction files
Transaction files store data about daily transactions happening in the
entity. Data in these files is used to update transaction-type files in
the master file through a common field.
After the transactions have been processed, the masterfile is
updated, the transaction file is cleared so that new transactions can
be entered and stored.
[Link] Table files
These are mainly for reference purposes. An example of a table file
is a supplier list.
7
Organisation and access
Access to data on a database is very important. In some databases the data
may be bulk and accessing specific records would be difficult if the database
system did not have access facilities. The database system allows for the
rapid access to data. The database system makes use of the primary key to
identify and to access records. Databases on the internet use URLs (uniform
resource locator).
Files are accessed according to the way they are organised or stored on the
physical storage medium. The data may be stored serially, sequentially or
randomly.
[Link] Serial access methods
Serial access involves having to access records starting from the first
to the required record. Normally the records are sorted according to
a certain field. This form of access is slow.
[Link] Sequential access methods
This is similar to serial access method but a file containing the sorted
records is created. The file contains the primary keys sorted
according to a given field. Users retrieve the desired file by selecting
its primary key without having to read all the preceding files.
[Link] Direct access methods
The computer accesses the desired record without searching through
each record. Access to the file is direct. An index of primary keys is
created and this provides direct and instant access to the record that
the key relates to. Because of the use of the index this method is also
called the indexed-sequential access method.