CHAPTER
THREE
DATABASE
INFORMATIO
N SYSTEM
April 14, 2023 MDUMA 1
Chapter Outline
Introduction
Meaning of Database
Data processing
Manual Data Processing.
Mechanical Data Processing.
Electronic Data Processing.
Database Concept and Terminology
Types of Database
Creating Database
April 14, 2023 MDUMA 2
DATABASE
Is a collection of data that is organized so that its contents can easily
accessed, managed and retrieved when needed.
Types ofdatabase
1. Manual database
2. Electronic database
Manual database
Is the database which is paper-based in record keeping. i.e. Diary, Address book,
Telephone directory, etc
Advantages
1. It is cheaper
2. It can’t be deleted easily
3. It’s easily to use and learn for professional and non-professional.
Disadvantages
1. Lack of security
2. It consume a lot of time
3. Reduction in sharing information
April 14, 2023 MDUMA 3
Electronic database
Is the database which is computerized in record keeping. i.
e. Library database, Hospital database
Advantages
1. Easy to generate employee records & financial
statements
2. Allow to backup records and keep them in a safe place
3. Improved data security.
4. Can process large amounts of data easily
Disadvantages
1. Cost
2. Complexity
3. Computer viruses and hackers
4. Data redundancy and inconsistency
April 14, 2023 MDUMA 4
DATABASE MANAGEMENT SOFTWARE (DBMS)
Is a software package that enables you to manage, modify
and store information to the database. i.e. Ms Access,
Mysql etc
FUNCTION OF A DATABASE MANAGEMENT SOFTWARE (DBMS)
i. Allow user to add or delete records
ii. Allow user to Update or modify existing records
iii. Ensure security of data in the database
iv. It help to organize data for easy access, retrieve and
manipulation
v. Act as an interface between database and other
programs
April 14, 2023 MDUMA 5
DATABASE MODELS
The main database models are:-
1. Flat file
2. Hierarchical
3. Network
4. Relational
April 14, 2023 MDUMA 6
DBMS PHOTO
April 14, 2023 MDUMA 7
FLAT FILES
A flat file database is a type of database that
stores data in a single table.
NAME PAMBA SEC
i.e. Admission No. 649
Total Marks 720
No. of subject 10
Average 68
Position 4
April 14, 2023 MDUMA 8
Hierarchical Model
Is a data model in which its data is organized into a
tree-like structure
April 14, 2023 MDUMA 9
NETWORK MODEL
A network database consists of a collection of records connected to
one another.
April 14, 2023 MDUMA 10
RELATIONAL DATABASE
MODEL
A relational database is a database that stores
information about a certain data and how they are
related Customer ID Name Telephone No
900 Marry Paulo 0768894223
230 Peter Karimu 0756327262
450 Neema John 0788916353
Customer ID Date Amount
600 2/3/2004 90,000
780 2/5/2004 13,000
450 3/6/2004 13,000
April 14, 2023 MDUMA 11
FEATURES OF DATABASE MANAGEMENT SOFTWARE
i. Tables
ii. Queries
iii. Reports
iv. Form interface
v. Computer programming language
April 14, 2023 MDUMA 12
Tables
Is a collection of related records. It is organized in
rows and column where by rows represent a record
and column represent a field.
Field
Is a character or combination of character that
represent a data item. i.e. In a class list the
Student Name is a field
Record
Is a collection of related fields that represent a
single entity.
i.e. Student Name, Total Marks, Average, etc
April 14, 2023 MDUMA 13
Forms
Is an interface that enable user to view and make data
entries into table. It used for entering, editing and
deleting of data stored in the table
A form is designed using graphical objects called
Controls.
Two types of controls
1. Bound controls
2. Unbound controls
April 14, 2023 MDUMA 14
A bound control
Is one whose source of data is a field in a table or query
Unbound control
Is a control that is not connected to any data source
Features when creating a form layout using form wizard
1. Columnar form
The fields for each record are displayed down a column
2. Tabular form
Records are displayed from left to right across the page and
labels appear at the top of each column
April 14, 2023 MDUMA 15
TWO fields with FIVE records
NAME ADDRESS
JUMA BOX-KIGOMA
AISHA BOX-MBEYA
DADID BOX-SINGIDA
JOSEPH BOX-MWANZA
ELIZABETH BOX-ARUSHA
Entity
Is a person, place or concept about which data can be
collected
i.e. Employee, House, Car, Books etc
Attributes
Is anything that describes characters of an entity.
i.e. Name, Age, Gender, Height, etc
Reports
Used to provides the user with the output layout and what is
to be printed
April 14, 2023 MDUMA 17
Querying a database
Query
Are special request for something to be done on the data
in the database
Query statements are written using a special language
called Structured Query language (SQL)
i.e.
Select Student ID,
From
Student Table
Where
Name=”Mariam”
April 14, 2023 MDUMA 18
Select query
It used for searching and analyzing data in one or more
tables
Action query
It used to make changes to many records at once.
Four types of Action query used in Ms Access
1. Update – For update data in a table
2. Append query- For adds data in a table from one
or more tables
3. Make table query- For create a new table
4. Delete query – For delete specified records from one
or more tables
April 14, 2023 MDUMA 19
Validation rule
Is a logical expression that restricts the values to be
entered in a field
Validation text
This is a message that appears once the validation rule
is violated.
An index
Is a key used to speed up searching and sorting records
in a table. i.e. A primary key (No duplicates)
Primary key
Is an index that uniquely identifies each record stored in
the table
Foreign key
Is a field in a relational table that matches the primary
key column of another table
April 14, 2023 MDUMA 20
Updating database records
Update
Is more often used to refer to adding and deleting
elements of data.
Upgrade
Refer to installing new versions of software
April 14, 2023 MDUMA 21
Entity Relationship
It refers to an association between entities.
Example Student and a book
There are three types of relationships
1. One-to-one
2. One-to-many
3. Many-to-many
April 14, 2023 MDUMA 22
One- to- One
For a particular field in one table, there is only one
matching records in another table.
Example.
A husband can only have one wife and a wife can
only have one husband, this known as one to one
relationship
HUSBAND WIFE
April 14, 2023 MDUMA 23
One -to-many
For a particular field in one table, there are several
matching records in another table.
Example.
A mother can have many children and a child can have
only one mother, this known as one to many
relationship
MOTHER CHILDREN
April 14, 2023 MDUMA 24
Many- to- Many
For a particular records in one table, there are several
matching records in other tables and vice versa.
Example.
A video can be hired by many customers and
Customers can hire many videos this known as
many to many relationship
VIDEOS CUSTOMERS
April 14, 2023 MDUMA 25
Database Backup
Is the process of making new copies of data which
may be used to restore the original one after a
data loss event.
Pages used to display data pages from the current
database but in HTML format
April 14, 2023 MDUMA 26
Automate operations used in DBMS
i. Macros
ii. Modules
MACRO
It replace a repetitive series of keyboard and mouse
actions
MODULES
It used to enhance database with features that are not
available from Ms Access
April 14, 2023 MDUMA 27
DATA TYPE
Text
This type includes alphabetic letters, numbers, spaces
and punctuation.
Number
These are fields made up of numeric numbers 0 to 9
Integer
For numeric data which is to be used in calculations
Memo
For length notes of up to 64,000 characters
April 14, 2023 MDUMA 28
Date/time
For holding dates or times
Currency
For holding currency amounts (monetary value)
Autonumber
Unique sequential number increased by 1 automatically
when a record is added
Boolean
For fields containing only; YES or NO, TRUE or FALSE,
MALE or FEMALE etc
April 14, 2023 MDUMA 29
NORMALIZING OF A DATABASE
Is the process of dividing information
into independent tables to avoid
repetition of data
A good database design means better
storage, security and little
maintenance effort.
April 14, 2023 MDUMA 30
Procedure to design a Good Database
i. Carefully study the requirements of the user
ii. Design a draft database on the paper to determine
the number of tables required
iii. Divide the information into separate fields, records
and tables to allow flexibility of data
iv. Define a primary key to identify each record uniquely
v. Design data entry forms needed for the database
April 14, 2023 MDUMA 31
A label
Is a sticker or piece of paper put on an item for the purpose
of identification
Required
Determine if an entry must be made in the field before you
proceed to the next field or record.
Allow zero length
It allows the user to proceed without making any entry in
the field set as zero length
April 14, 2023 MDUMA 32
PARTS OF A REPORT
1. Report header
It contains unbound controls that display title of the report
2. Page header
It contains heading or labels data items to be displayed in every column
3. Detail
Holds bound controls that display data items for the table
4. Page footer
Holds a control that is to be displayed on every page such as the page
number
STARTING MICROSOFT ACCESS
i. Click start Menu
ii. All programs
iii. Ms Access
iv. Click blank database
v. Click Create
April 14, 2023 MDUMA 33
REVISION
Database is a collection of related data, typically
describing the activities of one or more related
organizations. i.e University, Company, Secondary
school.
Meaning of Database
Database
Is a collection of related data that is organized so
that its contents can easily be accessed, managed,
and updated.
Database consist entities, attributes, relationships
which help data to be organized in the system.
April 14, 2023 MDUMA 34
Entity
This is a thing or object in the enterprise that is
distinguishable from other objects.
Described by a set of attributes.
For example a person, a car, a subroutine, a wire, an event.
Attributes
An attributes are particular properties that describe an entity.
Each entity has got an attributes.
Relationship
This is an association between entities, e.g. a person
OWNS a car is an association between a person and a car
April 14, 2023 MDUMA 35
Data
Data is a collection of facts, such as numbers, words,
measurements, observations or descriptions of things.
Data processing
It is a sequence of operations on data to convert it into useful
information.
The data processing can be accomplished through following
methods:
1. Manual Data Processing.
2. Mechanical Data Processing.
3. Electronic Data Processing.
April 14, 2023 MDUMA 36
Relationship
This is an association between entities, e.g. a person OWNS a
car is an association between a person and a car
Data
Data is a collection of facts, such as numbers, words,
measurements, observations or descriptions of things.
Data processing
It is a sequence of operations on data to convert it into useful
information.
The data processing can be accomplished through following
methods:
1. Manual Data Processing.
2. Mechanical Data Processing.
3. Electronic Data Processing.
April 14, 2023 MDUMA 37
Manual Data Processing
Data processing that requires humans to manage and process the
data throughout its existence files.
It include the use of Paper, Writing using pen or pencil, Physical
filing cabinets
Some example of Manual Data Processing
Daily class attendance book,
A book seller
Mechanical Data Processing
Data is processed by using different tools like typewriters,
mechanical printers or other mechanical devices such as
calculator.
April 14, 2023 MDUMA 38
Electronic Data Processing
It is the modern technique to process data. The data is processed
through computer.
It is the latest and fastest method of data processing.
Electronic data processing is used in
Banks and business firms
Government offices
Colleges
Schools
Universities, and other institutes.
Tools used in Electronic Data Processing
Computer
Software such Microsoft Access, MySQL etc.
April 14, 2023 MDUMA 39
Database concept and terminology
Database
Database is a collection of data that is organized so that
its contents can easily be accessed, managed, and
updated.
Microsoft Access Is a database application design and
deployment tool that you can use to keep track of
important information.
Traditional databases are organized by fields, records, and
files.
1. Field is a single piece of information.
2. Record is one complete set of fields.
3. File is a collection of records.
April 14, 2023 MDUMA 40
Relational Databases
Data in a relational database is stored in various data tables.
Each table has a key field which is used to connect it to other tables.
Operational Databases
Think of things such as inventory management, purchases, transactions
and financials.
Those are things are collected in database which are production/
operation database.
Database Warehouses
Organizations are required to keep all relevant data for several years.
Other types of database are
i. Document-Oriented Database
ii. External Database
iii. End-User Databases
iv. Distributed Databases
April 14, 2023 MDUMA 41
Importance Data processing system
Hospitals:
1. Hospitals tend to have information systems for data collection and
reporting staff.
2. Data processing system help doctor to know details of patients in
hospital.
3. Sharing of information at different places concerning health care.eg
within hospital or across the world
Business
Data processing system help to collect the related, structured activities
that produce a specific service or product for a customer or customers.
Education:
Student registration. Details of student are obtain easily.
Government:
1. Population census data capture forms
2. Civil registration forms
3. Birth/death/marriage certificates
4. Driving Licenses
5. Customs
Telecommunication:
For keeping record of calls made
April 14, 2023 MDUMA 42
Quiz
i. What is a relational db management system?
ii. Define table, records and field
iii. State six major objects used to manipulate data in
Ms Access- (tables, queries, forms, reports, pages,
macros, modules)
iv. Different between primary key and an index
v. What is normalization in reference to tables
vi. Explain how to set a validation rule when designing
tables
April 14, 2023 MDUMA 43
vii. Define the following terms
a) Form
b) Bound and unbound control
viii. Differentiate between tabular and
columnar form layout
ix. Why would one prefer to use a form for data input
rather than entering directly into a table?
x. Explain how you would move from one record to
another in a form
xi. Draw a simple sketch of a form that can be used to
enter all subjects marks in an examination database
April 14, 2023 MDUMA 44
1. What is referential integrity?
2. Differentiate between a table and a query
3. Explain how you would sort data in a query
4. Differentiate between an action query and a select
query
5. Explain what happens when you try to enter invalid
data into a related table for which referential
integrity has been reinforced
6. Explain how you would create a select query that
would be used to calculate your total score and
average in ten subjects
April 14, 2023 MDUMA 45
7. What is the importance of a report generated from a
database
8. What is the difference between a report and a label
9. Explain how you would create a report that display
subtotals and grand totals
10. What Ms Access objects would you use to
automate your database?
11. Assuming you have appointed as the sales
representative of an insurance company, explain
how you would create annual reports that would
include the company logo at the top of every page.
April 14, 2023 MDUMA 46
Part I: True and False
1. In multi user system the database resides on one computer
and is only accessed by one user at a time. This one user
may design, maintain, and write database programs.
2. Field is a single piece of information.
3. What kind of user will allowed to use your database? This
statement is one of database planning.
4. Document-Oriented Database is a variety of data available at
the workstation of all the end users of any organization.
5. Database is not concerning about data relation since it can
bring interrupt of the data.
6. Operation of database based on Creation, entering of data,
updating of data and deleting of data.
7. Can process large amounts of data easily is one of the
disadvantage of database.
April 14, 2023 MDUMA 47
Part II: Short Answer qz
1. Each workstation is like a small database in itself
which includes data in spreadsheets, presentations,
word files, note pads and downloaded files. All such
small databases form a different type of database
called the _______________
2. Mention at least three you know types of database.
3. ________________is a collection of facts, such as
numbers, words, measurements, observations or
descriptions
4. _____________is a single piece of information.
5. ______________is one complete set of fields.
6. _______________is a collection of records.
April 14, 2023 MDUMA 48
Part III: Long Answer qz
1. List four examples of database systems.
2. Discuss the meaning of the following
a) Data
b) Database
c) Information System
3. Ten functions of database in our daily life.
4. Discuss with your fellow how you can plan the database of
your school.
5. Importance of database in your school.
6. Discuss the Advantages and Disadvantages of Database.
April 14, 2023 MDUMA 49
1. PRACTICAL Qz
i. Create a database called Employees and within it create
a table called customers with the following fields
FIELD NAME DATA TYPE
ID Number Text
Last name Text
First name Text
Address Text
Town Text
Company Text
Date Dates/Time
Salary Currency
Married Yes/No
a. Save the Table as Customer
April 14, 2023 MDUMA 50
2. PRACTICAL Qz
a). Create a table called DVDs with the following attributes
b). Determine the following
i. The primary key
ii. The missing data types and properties
c). Enter ten records into the table
FIELD DATA TYPE SIZE
DVD-code Alphanumeric 8
Title Text 20
Purchase price Currency Fixed
Sales price Fixed
Quantity Number
Date bought Medium
April 14, 2023 MDUMA 51
3. PRACTICAL Qz
a). Create a table named Exams with the
following fields
FIELD NAME DATA TYPE
Student number Text
First name Text
Last name Text
Math’s Number
Physics Number
Chemistry Number
Computer Number
Total Number
Position Number
Reporting date Date/time
April 14, 2023 MDUMA 52
b) Set the student number as the primary key.
Using a data form, enter data for five students as
follow
STUDENT NO MATH’S PHY CHEM COMPUTE
R
2001 40 50 40 90
1983 60 70 57 30
2002 80 30 37 70
1513 30 63 80 70
April 14, 2023 MDUMA 53
c) Without using the form wizard, create a form for the
exams table such that the format is displayed as below
Student Number…………StudentName………….Total…………
Position…………………………………….
Reporting Date…………………………
Subject Average Marks
MATHS ..……………………………
PHYSICS ………………………………
CHEMISTRY ………………………………
COMPUTER ………………………………
April 14, 2023 MDUMA 54
4. PRACTICAL Qz
You are the database manager, Riceland society and you are expected
to create a database called Riceland
a). Design two tables in the database, EMPLOYEES and BILL with the
following fields
EMPLOYEES TABLE BILL TABLES
PNo (Primary key)
National ID PNo(foreign key)
First name BillNo(Primary key)
Last name
Date employed BillDate
Salary BillAmount
Sex
April 14, 2023 MDUMA 55
b). Enter the following records in the Employees table
PNo National ID First name Last Date salary sex
name employed
201 12234 Ali Mohamed 16/03/2002 40000 M
203 12454 Zainabu Mussa 16/04/2002 60000 F
207 22734 David Michael 16/05/2002 100000 M
208 12234 Eliza Peter 16/10/2002 50000 F
April 14, 2023 MDUMA 56
c). Enter the following records in the Bills table
PNo BillNo BillDate BillAmount
201 1100 16/07/2004 3000
203 1200 16/08/2004 7000
201 2000 16/09/2004 2000
208 1340 16/10/2004 8000
204 1430 16/11/2004 6000
d).Explain why duplicate PNo is acceptable in Bills table and not in
the Employees table
e). Create a calculated based on the two tables that will calculate and
display the following
i. The total bill for Eliza in the month of October
ii. The total bill for all the employees
April 14, 2023 MDUMA 57
5. PRACTICAL Qz
1. Open the RICELAND database and
generate a report that display the following
a) Employee name, the Gross salary,
Allowances and Net pay
b) Subtotals and Grand totals for all the
Employees
c) The current date and time
April 14, 2023 MDUMA 58
2. Create a school database that
includes the following
i. Four departments (Math’s, Science, Humanities
and Technical subject)
ii. Members of staff in each department
iii. Subjects offered in each department
iv. From the database generate a grouped report for
all members of staff in each department
v. Create label to be placed at the door of every head
of departments office
April 14, 2023 MDUMA 59
QUERY
REVIEWS
April 14, 2023 MDUMA 60
• If you want to query a text or a certain number beginning with either
letter “M” or Number begin with “067”
i) LIKE “M*” > it will bring all character begin with “M”
ii) LIKE “067*” > it will bring phone number starting with “067”
iii) LIKE “An*” > it will bring all character begin with “An”
April 14, 2023 MDUMA 61
END
April 14, 2023 MDUMA 62