Computer Studies Form 2-Database
Computer Studies Form 2-Database
DATABASE
(a)Character
It is the smallest element of a
computer file and refers to a letter or
symbol that can be entered, stored
and output by a computer. It is made
up of a set of seven or eight digits
depending on the character coding
scheme used.
(b) Field(s)
Refers to a single character or collection of
characters that represent an attribute
within an entity. Fields have unique data
types.
It is also a column of similar information or
groups of vertically related data that
contain similar information of the same
data type.
Data types are field properties that apply
to all values contained in that field and
determines what kind of data those values
can be.
Data types can be of text, number,
currency and date/time. Fields appear in
columns within a table structure.
(c) Record
Refers to a collection of related fields for
an entity. Records in a file are made up
of fixed number of fields. For example,
an individual employee record may
include his name, employee number,
salary, tax, gender etc. records are
recorded in rows within a table structure.
(d) File
A file is a compilation of related data
records maintained in some prearranged
order. For instance, an employee file
might consist of 1,000 individual
employees arranged by the employees
number.
Database system
It comprises of four major components.
They include:
i. Data: these are values physically recorded
in the database. They are the raw values
and facts. Data is also referred to as
anything that is deemed to be of
significance to the organisation that the
database system is serving.
ii.Hardware: it consists of secondary
storage devices on which the database
resides together with the associated
devices control units and communication
channels.
iii.Software: application programs that
allow users to store information in an
ordered manner for timely and quick
retrieval such as a DBMS.
(iv) Users: refers to the person who uses the
DBMS. There are three broad categories of users.
They include:
Application programmers: They are responsible
for writing programs that use the database. They
use the DBMS to come up with software that can
solve problems for specific groups of people or
organisations.
End users: they interact with the database from
a terminal. The end user may employ a query
language provided as an integral part of the
system. They use the DBMS to solve individual
problems.
Database administrator: the persons who have
the overall charge of the database system. They
exercise administrative functions such as
ensuring security of data by defining the access
Examples of DBMS:
DBMS can be divided into two categories namely:
Desktop databases.
Server databases.
Desktop databases are single user applications
that reside on standard personal computers;
hence the name Desktop. They include the
following:
Microsoft Access
Fox Pro
Paradox
Lotus Approach
FileMaker Pro
Clipper
Dbase
Server databases contain mechanisms that
ensure the reliability and consistency of data
and are geared towards multi-user applications.
They are designed to run on high performance
servers and they carry a corresponding high
price tag. They include the following:
SQL server
Oracle
DB2
Ingress
Entity Relationship Modeling
It is a technique used to identify the objects
within an organisation and how they are related
to each other.
It uses the concept of entities, attributes and
relationships.
(i) Entity
An entity is an object of significance, whether real
or imagined about which information needs to
be known or held e.g. a person, car, house,
company, student, course and job.
(ii) Attribute
An attribute is any detail that serves to qualify or
express the state of an entity. It could be text,
numbers, picture, a feel, smell, sound etc.
Illustration: A student entity could have the
following attributes:
FEES PAID
NAME
(iii) Relationships
It is defined as an association among entities. Several
relationships may exist between the same entity. There
are three types of relationships recognised among various
data stored in a database. They are as follows:
(a)One To One Relationship
This is where one record or entity in a primary table/file is
linked to exactly one record or entity in another file/table.
Examples;
-A movie cannot be loaned to more than one person at the
same time.
-A student can only have one admission number and an
admission number can only be issued to one student.
STUDENT ADM/NO
PERSON MOVIE
(ii) One to Many relationship
One record or entity in a table/file is linked to
many records or entities in another table/file.
Examples;
One person can borrow many movies and many
movies can be borrowed by one person.
A student can register for one course and many
students can register for that particular course.
student
Movie 1
1
student
person Movie 2 course 2
student
Movie 3
3
(iii) Many to Many relationship
Many records/entities in a primary file/table are linked to
many records/entities in another file. Examples;
A movie can have many actors and an actor can act in
many movies.
A trader can sell many items and many traders can sell a
particular item.
movie actor
trader item
Database Models:
It is a specific method for describing the structure,
organisation and processing within a database. There
are five types of database models namely:
a) Flat file or File Management System (FMS) model.
b) Hierarchical Database system (HDS) model.
c) Network database system (NDS) model.
d) Relational database model.
e) Object oriented model.
(a) Flat file or File Management System (FMS) model
It was the first method used for data storage in a
computerised database. The data is arranged
sequentially in a given order. To access a particular
item, the search begins at the first item and
subsequent items are checked until the required item
is located.
(b) Hierarchical Database system (HDS) model.
In this model, data items are arranged in a tree
format. The origin of a data tree is a root
(level 1). The subsequent levels are called
nodes which branch to the lowest level called
a leaf. To access an item, in level 2, level
1data items have to be accessed. A specific
single path leads to each item at lower levels.
This model is used in storage ofROOT
files in a
(LEVEL 1)
computer, where the root directory is either
C:, A: or D:. (it forms a one to many
relationship) NODES
(LEVEL 2)
(c) Network database system (NDS) model.
In this model, data relationships and items link
to each other in the form of a network. The
relationship between the data items is
known as sets. Data items are accessed
through multiple paths. It forms a many to
many relationship. The model uses a pointer
to locate a particular record.
However, in case of large volumes of data, it is
difficult to locate an item because it will
increase the complexity of the search due to
the use ofTrader 1
the pointer. Trader 2
Item 1 Item 2
(d) Relational database model
This model organises data in simple row column
format called tables. Related data items are
entered in a table where each column
represents individual fields and each row
represents individual records. This method is
popular
Students detailswith
table mini and micro computers.
Students marks table
Relationships
Adm/no Name
can be createdKCPE
Adm/no
amongst
mark
various
tables. Joseph
7009 7009 300
7010 Hansel 7010 324
7011 Mary 7011 410
7012 Royale 7012 312
MICROSOFT ACCESS
Ms Access is a DBMS application within the
Microsoft Office Suite use for creating and
manipulating databases. Currently, there
exists various versions of Microsoft Access.
Creating A New Database In Microsoft Access
2007
Getting started:
Steps:
Click START menu
Select PROGRAMS/ALL PROGRAMS
Click on MICROSOFT OFFICE folder
Select MICROSOFT ACCESS
In the Getting Started With Microsoft Access task
pane, under New Blank Database, click on Blank
Database.
In the Blank database task pane that appears, under
FILE NAME, type an appropriate name for the
database.
Click on CREAT button.
A new database will appear ready for construction and
interaction with database features such as tables,
queries, forms and reports.
Microsoft Access 2007 start window
Microsoft Access 2007 window
Features of Microsoft Access 2007 Window
Ms Access window is divided into two major
parts:
i) The application part- it contains the tabbed
menu ribbon with tabs such as:
Home
Create
External data
Database tools
ii) The Database window- it contains a navigation
task pane that displays created database
objects such as:
Tables
Queries
Forms
Reports
Macros etc.
Ms Access database objects:
Table: It is a database object made up of
rows and columns that is used to hold
related data records. Each row
represents a record while each column
represents a field.
Queries: it is database tool used to
extract data from one or more tables
based on a specific criteria and display
the result.
Forms: these are data entry screens
that provides the user with graphical
interface to enable them add, view,
delete and edit records.
Reports: these are database tools that are
used to summarize and present data from
tables and queries and format them in a
suitable way for viewing or for printing.
Macros: it is an automation database tool
that enable users to add functionality to a
database. They contain actions that perform
tasks such as opening a report, running a
query or closing the database.
Modules: Visual Basic Application
procedures that can be used to automate
more complex operations that cannot be
handled by macros.
Guidelines for designing a good database
Study carefully the user requirements in order
to define all the data inputs, outputs and the
relationships required.
Design a draft database on the paper to
determine the number of files or tables
required.
Divide the information into separate fields,
records and tables to allow flexibility in
manipulating the database
Define a field for each table that will be used
to identify each record uniquely (primary key).
Give the most important fields priority when
constructing a table structure.
Design data entry screens (forms) needed for
the database.
Database objects:
i) TABLES/FILE STRUCTURE
It is a database object made up of rows and
columns that is used to hold related data
records.
Each row represents a record while each column
represents a field.
Creating a table structure
A table can be created using table wizard, table
templates or in design view.
Description of Field data types
A data type refers to the attribute of a field that
determines the kind of data it contains.
Common data types are as follows:
Table design view Window showing field names, data types and
field properties
DATA TYPE DESCRIPTION
Text This type includes alphabetical letters,
numbers, spaces and special symbols. It can
take a maximum 255 characters including
spaces. It usually specifies a field that is
not used for calculations including numbers
stored in it.