0% found this document useful (0 votes)
57 views31 pages

DATABASES pp2

Uploaded by

maryannej238
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views31 pages

DATABASES pp2

Uploaded by

maryannej238
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

CUTE IDEAS LEARNING SERIES

DATABASE PAPER 2 REVISION QUESTIONS


QUESTION ONE
Consider the three tables below extracted from a school database Management Information System
(a) Students table
NO ADM FIRST LAST CLASS TERM TWO FEES
NO NAME NAME
1 1010 Thomas Onyango 2A KSHS17,000.00

2 1011 Hillary Joel 2C KSHS17,000.00

3 1012 Steve Njoroge 2B KSHS17,000.00

4 1013 Titus Mutua 2A KSHS17,000.00

5 1014 Paul Lema 2B KSHS17,000.00

6 1025 Ben Okoth 2C KSHS17,000.00

EXAMS TABLE
SERIAL ADM ENG KISW MAT BIO CHEM PHY HIST GEO AGRI COMP BS
NO NO N

1 1012 81 65 42 89 52 86 80

2 1010 56 35 46 74 75 62 38

3 1025 76 91 72 48 59 88 81

4 1011 64 39 46 86 67 37 88

5 1013 75 72 68 56 85 54 78

6 1014 86 83 70 86 43 90 67

ACCOUNTS TABLE

RECEIPT NO ADMNO FEES PAID

1 1025 KSH10,000.00

2 1010 KSH17,000.00

3 1011 KSH2,500.00

4 1012 KSH5,800.00

5 1013 KSH14,000.00

6 1014 KSH1,500.00
(a) Create a database to contain the data and save it as information system (2mks)
(b) Design the above tables structures with the appropriate primary keys (4mrks)
(c) Link the tables and enforce referential integrity (4marks)
(d) Design forms for each of e above tables created (6 marks)
(e) Use the respective forms you have created in (c) above enter the data in those tables
(9 marks)
(f) Create a query with a new field called“Total marks” that add marks for all subjects in exams table.
The query should display the following: ADMNO, FIRSTNAME, LASTNAME, CLASS, ENG,
KISW, MATHS, BIO, CHEM, PY, EO, AGRI, COMP, BSN and TOTAL MARKS. Save the query
as “Total MarksQ”
(9 marks)
(g) Create a query with a new field called “Fees Balance” that displays the fees balance from a
calculation. This query should display the following: ADM NO, FIRSTNAME, LASTNAME,
CLASS, TOTAL FEES, FEES PAID and FEES BALANCE for ONLY students who have fees
balance greater than Kshs. 8000 and come from 2B, save it as “QFEES BAL”
(6 marks)

(h) Get the variance of Eng, Std Deviation of Kisw and Maximum for Math on the “Total MarksQ”
in (f) above (3 marks)

(i) Using the query “Total MarksQ”in (f) above, create a report with the following properties:
❖ Layout : Tabular
❖ Orientation: Landscape
❖ Style: Opulent
Save the report as “RTotalMarksQ” (4 marks)

(j) Print:
➢ Exams table and “QFEESBAL” on both sides of the page (2 marks)
➢ Query “Total MarksQ” in landscape (1 mark)

-2-
QUESTION TWO

The following tables represent data for a video store named Sinai Video store. Study them and

answer the questions that follow:

Table 1: MEMBERS

Member No First name Last Address Phone Town Monthly fee


name

SVS-0001 Raphael Mudibo P.O.Box 343 (020)22112 Nairobi Kshs 50

SVS-0002 Mary Musembi P.O Box 121 (050)34342 Gilgil Kshs 50

SVS-0003 Bernard Angaine P.O Box 441 (038)24242 Naivasha Kshs 50

SVS-0004 Gabriel Laisula P.O Box 134 (020)11445 Nairobi Kshs 50

SVS-0005 Nelly Mwangi P.O Box 989 (038)25423 Naivasha Kshs 50

SVS-0006 Janet Mbori P.O Box 323 (025)45343 Kisii Kshs 100

SVS-0007 Bruce Nyaga P.O Box 544 (050)31322 Gilgil Kshs 150

SVS-0008 Andrew Bosibori P.O Box 331 (025)21423 Kisii Kshs 50

SVS-0009 Abubakar Said P.O Box 900 (028)23432 Isiolo Kshs 100

SVS-0010 Samantha Wellings P.OBox 232 (025)53293 Kisii Kshs 150

Table 2: RENTAL

Date collected Member No Disk No Due Date Rental Amount

1-May-2018 SVS-0004 001 5-May-2018 Kshs 20

12-May-2018 SVS-0001 003 16-May-2018 Kshs 20

15-June-2018 SVS-0005 002 19-June-2018 Kshs 20

20-June-2018 SVS-0004 005 24-June-2018 Kshs 50

30-June-2018 SVS-0005 006 04-July-2018 Kshs 50

12-July-2018 SVS-0005 004 16-July-2018 Kshs 25

25-October - 2018 SVS-0001 007 29-October - 2018 Kshs 50

-3-
Table 3: Movie

Disk No Title Category Main Actor Production Year Rating

001 A Thief in the Night Thriller Hoss Baxton 1984 A

002 Nursery Rhymes Educational Kerry Kean 1994 A

003 Cartoon 17 General Jimmy Grant 1994 C

004 Trading places Comedy Kim Fields 1995 B

005 When Hatred Came Thriller Shalom King 1987 A

006 The Gods must be crazy Comedy Mfasa Limpula 1986 B

007 The Gods must be crazy 2 Comedy Mfasa Limpula 1988 B

008 The Gods must be crazy 3 Comedy Mfasa Limpula 1991 B

009 The Island Action Marie Payton 1992 A

010 Prepare For War Action Rebecca 1990 A

a) Create a database for the following tables. Name it as Sinai Video Store (2marks)
b) Create three Tables for each of the above Tables adding appropriate primary key and other field properties for
each (6marks)
c) Create relevant relationships among the Tables (2marks)
d) Create forms for each table and give them appropriate names (3marks)
e) Using the forms created above, enter data into each Table (9marks)
f) Using a query, add a field named New Monthly Charges that calculates the new monthly fee given that there is a
8% increase from current fee. Save it as New Fee Query (6marks)
g) Create a query that displays all the movies produced after the year 1990. Save it as Latest Movies
(5marks)
h) Generate a query that calculates the Total income each Movie has made. Save the Query as Total gain
(6marks)
i) Create a report that:
(i) Groups each of the movies according to category (2marks)
(ii) Calculates the income each movie category has made (2marks)
(iii) Calculates the total income from all movies (2marks)
(iv) Has the heading Total Income Report with font size 20 (2marks)
(v) Save the report as Total Income Report (1mark)
Print New Fee Query, Latest Movies query, Total Gain query and Total Income Report

-4-
QUESTION THREE

a. The following data was extracted from Readers Bookshop. Use the data to create a database called
WINNERS. (1mk)
Book_Table

Book no BName Supplier Id Price


B_01 Mathematics 1 450
B_02 Science 1 347
B_03 Literature 2 250
B_04 Newspaper 3 60
Supplier_Table

Supplier Id BName
1 KLB Publishers
2 Longhorn
3 Nation media
Clients_Table

Client No CName Location


01 Greats Academy Nairobi
02 Soars High Malindi
03 Winners Academy Mombasa
04 Masomo School Lari
Sales_Table

Client No Book no Quantity Date ordered


01 B_01 340 2/4/2020
04 B_03 543 4/4/2020
04 B_04 57 4/4/2020
03 B_01 123 10/5/2020
01 B_02 453 11/4/2020
01 B_03 201 11/4/2020
01 B_03 211 11/4/2020
04 B_01 341 13/4/2020
02 B_03 122 13/4/2020
b. Create the tables shown above. (17mks)
c. Create forms for the four tables and name them BOOKS, SUPPLIERS, CLIENTS and SALES
respectively. (2mks)
d. Using the forms created above enter the above data in their respective tables. (10mks)
e. Create a query named KLB that will be used to display the books supplied the books supplied by
KLB publishers. The query should display the book no, name, supplier name and price.
(3mks)
f. Create a query that will display books ordered Greats Academy exceeding 300 copies. The query
should display Name, Book no, Quantity, date ordered and amount paid. (4mks)
g. Create a report to the amount the bookshop would be paid for each sale. (4mks)
h. Create a columnar report summarizing the amount of money READERS BOOKSHOP should get
from each client. The report should show Client no, CName, BName, Price and total per book.
Format the page to landscape orientation. (5mks)
i. Title the above report as READERS APRIL SALES and save it as APRIL. (2mks)
j. Print APRIL report, Books_Table, KLB query and supplier form. (2mks)
-5-
QUESTION FOUR
HIGH SEASONS is a holiday resort firm. It has several branches all over the
world. In order to keep track of its employees, a database to organize employee
information is required.

(a) Create a database file and save it as SEASONS in the removable storage
provided. (2 marks)

(b) (i) Create a table containing the following fields with correct data type and define field properties as
follows: (4 marks)

Field Name Field Properties


EmployeeNo. 4 characters
Date of Birth MM/DD/YY
Grade 1 character

(ii) Make the field Employee No. the primary key and save the table as
EMPLOYEES. (3 marks)

(c) (i) Create a form based on the EMPLOYEES table with the title as EMPLOYEESFORM. and save it
as EMP FORM (4 marks)

(ii) Use the form to enter the records below: (5 marks)

EmployeeNo. Date_of_Birth Grade


EMP01 5/15/1960 G
EMP02 4/28/1978 H
EMP03 10/30/1972 R
EMP04 12/5/1975 H
EMP05 2/28/1974 G
EMP06 1/3/1970 G
EMP07 11/24/1956 H
EMP08 3/10/1984 G
EMP09 4/4/1956 S
EMP10 8/11/1964 R

(d) (i) Create another table containing the following records: (4 marks)
Job Group Salary
G 24,000.00
H 32,000.00
R 48,000.00
S 52,000.00

(ii) Give the table appropriate primary key and save as Job Grade. ( 2 marks)

(e) Create a relationship that enforces referential integrity. (3 marks)


-6-
(f) (i) Create a query and save it as EMPLOYEESQUERY based on the EMPLOYEES table that would
display the entire employee’s in Grade H, R and their salaries. (5 marks)

(ii) Sort the records in the EMPLOYEESQUERY in alphabetical of Grade field. (2 marks)
(iii) Add the Salary field on the EMPLOYEESQUERY to display the each employee salary and save
the changes. (2 marks)

(g) (i) Create a columnar report with portrait orientation from the EMPLOYEESQUERY. Save the
report as EMPLOYEESREPORT. (4 marks)

(ii) Enter a function to compute the salaries grand total displayed in the report.
(3 marks)

(iii) Insert a header EMPLOYEES IN GRADE H AND R in the report having font size 20pts to
the left of the page. (2 marks)
(iv) Create a query from EMPLOYEESQUERY to display Empno, Date of Birth and age of every
Employee. Save as age. (4 maks)

(h) Print the EMPLOYEES Table, EMPLOYEESFORM, EMPLOYEESQUERY and


EMPLOYEESREPORT. (2 marks)

-7-
QUESTION FIVE

1. A firm keeps its details in a computer database. The information below contains details
obtained from two tables of the database. Study the tables and answer the questions that
follow.

Employees table

EmployeeID EmployeeName Department Job Title Salary


7369 Mark Koech Research Clerk 48000
7499 Philip Meme Sales Salesman 16000
7521 Mohamed Ali Sales Salesman 12500
7566 Kennedy Simiyu Research Manager 39750
7698 David Kamau Operations Manager 38500
7782 Titus Ole Simian Accounting Manager 34500
7788 John Onyango Operations Analyst 30000
7821 Patel Shah Operations Analyst 25000

Department Table

DeptCode Department Location


10 Accounting Nairobi
20 Research Nakuru
30 Sales & Marketing Mombasa
40 Operations Kisumu

Required:
(a) Create a database that can be used to store the above data and save it as
MACAL in the disk provided. (10mks)

(b) Using appropriate primary and foreign keys create a relationship between
the two tables. Enforce referential integrity between the tables. (4mks)

(c) Validate the primary key entry to exactly four and two characters for the
EmployeeID and DeptCode fields respectively. (4mks)

(d) Create a form for each table and use it to enter the records shown in the
tables above. Save the forms as EmployForm and DepartForm
respectively. (6mks)

(e) It is required that the dates on which the employees were hired be included
in the database. Koech was hired on 10/06/1998. Meme on 15/08/1996.
Mohamed on 16/03/1996, Onyango on 09/03/2003, the rest were hired on
13/03/2004. Insert a new field, name it Date of Hire in the Employees
table and enter the field. (5mks)

(f) Create a query that displays employees who were employed after year
2000, save the query as LatestEmployees. (4mks)

-8-
(g) Create, a, Report that displays the Employee Name, Job title Department
name and Salary, grouped according to location.
Save the report as EmployeeReport. (4mks)

(h) (a) Create a query to display the employees and their job description.
Save it as EMPTYPE. (4mks)

(b) Create a pie chart based on the query in h(a) above to display the
proportions of employees in various job descriptions.
Save the report as CHART. (4mks)

(i) Print:
(i) Employees and Department table designs.
(ii) Employee and Department forms.
(iii) LatestEmployees Query.
(iv) EmployeesReport.
(v) The Chart

-9-
QUESTION SIX

The following records were provided by a Uchumi Bora Supermarket . Study the table and answer the questions that
follow. The products having the ProductID starting with value 1 are premium products, others starting with 2 are
ordinary products.

ProductID SalesID Product Description Package Quantity Sales Date Sales Sales
Rate Quantity(Kgs)
1001 1 Cassava Flour 1Kg 12/08/2020 340 25

2002 2 Wheat Flour 2Kg 14/08/2020 32 45

2003 3 Millet Flour 1Kg 23/08/2020 63 50

2004 4 Maize Flour 2Kg 27/08/2020 50 47

1001 5 Cassava Flour 1Kg 02/09/2020 340 20

1005 6 Amaranth Flour 1/2Kg 09/09/2020 34 30

2003 7 Millet Flour 1Kg 11/09/2020 63 23

1006 8 Moringa Flour 1/2Kg 17/09/2020 78 45

(a) Create a database file named “Uchumi Bora Products”. (2mks)

Split and design the above table into “Products” and “Sales” tables to record products (7mks)
items and sales made respectfully. Set the SalesID to Auto Number.

(c) Add appropriate key fields and create a relationship between the two tables. (2mks)

(d) Create the following forms: (6mks)


(i) Columnar Products form named “ProductsForm”, having the title “Product Entry
Form”.
(ii) Columnar Sales form named “SalesForm”, having the title “Sales Details Entry
Form”.

(e) Using the forms in (d) above post the products and sales details to their respectful (8mks)
tables.
Create the following queries.

(i) A query named Sales Query that computes sales amount as a product of Sales Quantity and
Sales Rate (5mks)
(ii) A query named Premium Query to generate a list of premium products, having the fields; Product
ID, Product

Description, Package Quantity. Order the list in ascending order of ProdID.


(6mks)

- 10 -
(iii) A query name Date Query to generate sales made between 23/08/2020 and 09/09/2020, having the
fields ProductID, Product Description, SalesID, Sales Date and Sales Quantity.
(4mks)

(g) Generate the following reports.


(i) Sales report named Sales Report, having the fields ProductID, Product Description, Package Quantity,
SalesID, SalesDate,
SalesRate and SalesQuantity, grouped by ProductID.
(3mks)

(ii) A report named VAT Report displaying ProductID, SalesQuantity, SalesRate and SalesAmount from (f)
(i); add field named
“VAT 16%” and compute VAT as 16% of the SalesAmount.
(4mks)

(h) (i) Print the tables, Products and Sales (1mk)

(ii) Print the queries, Sales Query and Premium Query (1mk)

(iii) Print the reports, Sales Report and VAT Report (1mk)

- 11 -
QUESTION SEVEN

The data in the tables below were extracted from Bondo Sub county Games Management system.

Table 1: TEAMS TABLE

Team Code Team Name Address Tel. No. Reg. Fee

01 Majiwa High School Box 0012 021542148 5,000

02 Maranda High School Box 2454 025485267 3,500

03 Usenge High School Box 458 025478756 4,700

04 Akoko Mixed Secondary Box 635 032547855 2,400

05 Kipasi Secondary School Box 2446 032458754 1,200

06 Kapiyo Secondary School Box 6589 015487564 1,400

07 Nyang’oma Boys Box 1254 031204543 5,000

Table 2: RESULTS TABLE

Team Code Games Won Games Lost Games Draw

01 12 2 2

02 10 3 3

03 4 8 3

04 9 3 4

05 7 3 5

06 7 6 4

07 5 9 2

(a) Create a database named Football to store the data above. (12marks)

(b) Format the Reg. Fee field as follows:

(i) To display the entries with the prefix: “KSh.”Correct to two decimal places. (2marks)

(ii) Restrict entries to positive values only and should return an error message “Error: enter positive values
only” if an out of range value is entered. (2marks)

(c) Validate Team Code to 2 characters only. (2marks)

(d) Create a suitable table relationship between the tables. (3marks)

(e) Design a form for each table and use it to enter the data into the tables. (9marks)

- 12 -
(f) Create a query named TotalGamesQuery to display the fields: Team Code, Team Name and Total games
played. (4 marks)

(g) Create a query to show the team name and total points. (Note: A Win in a game earns team 3 points, a
draw 1 point and a loss 0). The query should show the 3 best teams based on the total points. Save the
query as BestTeamsQuery. (5 marks)

(h) Create a report named RegReport to display the Team Name, Address, Reg. Fee. The report should show
the total registration fee collected from all teams. (5marks)

(i) Sort the records to show the team that has paid the highest amount of registration fee first.
(2 marks)

(ii) Title the report as “income from registration”. (2 marks)

(i) Print each of the following: (2marks)

(i) Teams table and Results table

(ii) TotalGamesQuery and BestTeamsQuery RegReport.

- 13 -
QUESTION EIGHT

The following table contains details of Huduma Hospital.

PATIENT PATIENT DATE OF DATE OF BILLED PAID MODE OF RECEIPT DOCTOR DOCTOR AILMENT

ID NAME VISIT DISCHARGE AMOUNT AMOUNT PAYMENT NO ID NAME

P3001 TOSHA 2/2/2023 2/3/2023 50000 10000 Mpesa 6001 D101 Amani Cancer

P3002 PHILYS 13/2/2023 18/2/2023 20000 10000 Mpesa 6006 D101 Amani Fracture

P3003 SALIM 12/2/2023 16/2/2023 15000 12000 Cash 6011 D105 Bahati Cholera

P3004 BRAYO 14/2/2023 16/2/2023 17000 5800 Cash 6015 D103 Upendo TB

P3005 PHILIP 17/2/2023 17/2/2023 1000 1000 Cash 6030 D104 Uzima Headache

P3006 JOAN 20/2/2023 21/2/2023 5000 5000 Cash 6040 D103 Upendo TB

P3007 CARLOS 1/3/2023 3/3/2023 7500 5000 Cash 6051 D101 Amani Toothache

P3008 QUINTER 2/3/2023 5/3/2023 4500 2500 Mpesa 6073 D102 Joyce Malaria

P3009 GULAMU 5/3/2023 15/3/2023 15000 2500 Cash 6084 D102 Joyce Malaria

P3010 GERALD 17/3/2023 21/3/2023 8500 3500 Mpesa 6099 D104 Uzima BP

a) Create a database file that can be used to store the above data and save it as Huduma _Hospital. (2 marks)
b) Design THREE tables, one for the Patient_ Details, Account_ Details and Doctors_ Diagnosis (14 marks)
c) Create a relationship between the three tables (5 marks)
d) Using appropriate forms, enter the information given into the Three tables (13 marks)
e) Create a query ;
i) To display patients who paid via Mpesa. Save the query as Mpesa Payments (2 marks)
ii)To display the number of day’s patients stayed in the hospital. Save the query as Days Spend (4 marks)
f) Create a report showing all patients whose arrears (unpaid balances) are greater than 5000. Save the report as
Patient Arrears (5 marks)
g) Print out the following:
i) Patient_ Details, Account_ Details and Doctors_ Diagnosis tables (3 marks)

ii)Mpesa payments query (1 mark)

iii) Patient Arrears report (1 mark)

- 14 -
9. The following information was obtained from IEBC register. Use it to answer the questions that
follow:
DISTRICT APPROX REGION MALE FEMALE DOMINANT DENOMINATION
POPULATION TRIBE

NAKURU 120,000 RIFTVALLEY 40,000 80,000 KIKUYU CHRISTIAN

NYANDARUA 150,000 CENTRAL 70,000 80,000 KIKUYU CHRISTIAN

GARISSA 50,000 N.EASTERN 30,000 20,000 SOMALI ISLAMIC


ISIOLO 45,000 EASTERN 25,000 20,000 RENDILE ISLAMIC
TURKANA 70,000 RIFTVALLEY 30,000 40,000 TURKANA CHRISTIAN

MARAKWET 100,000 RIFTVALLEY 50,000 50,000 MARAKWET CHRISTIAN

MACHAKOS 140,000 EASTERN 80,000 70,000 KAMBA CHRISTIAN


MAKUENI 156,000 EASTERN 56,000 100,000 KAMBA CHRISTIAN
KWALE 112,000 COAST 62,000 50,000 DIGO CHRISTIAN
MALINDI 132,000 COAST 100,000 32,000 GIRIAMA CHRISTIAN

KISUMU 180,000 NYANZA 90,000 90,000 LUO CHRISTIAN


KISII 156,000 NYANZA 56,000 100,000 ABAGUSII CHRISTIAN
KAKAMEGA 165,000 WESTERN 65,000 100,000 LUHYA CHRISTIAN
VIHIGA 145,000 WESTERN 45,000 100,000 LUHYA CHRISTIAN

a. Create a database called Population .Create a table called demography to store the above
information:
(15mks)
- Don’t use automatic primary key instead make the District field as the primary key field and set its
field size property to 15. (2mks)
- Change data in the demography table to bookman old style and font size 11 with blue font and
pink line/border colour. (2mks)
b. From the table demography create and run select query to show:

i. Records for districts from Rift Valley or Eastern Region. Save the query as “city dwellers”.
(3mks)

ii. Record for districts whose approx. population are greater than 100,000 and the
denomination is Christian. Save the query as Christian. (3mks)
iii. Record where the Region name ends with letter R and N. Save the query as RN letters.
(3mks)

- 15 -
c. Create and run action queries that will:
i. Extract records from the table demography of district from Rift Valley and Central Region
and paste them into a new table called Demo-mod. Save the query as make demo.
(3mks)
ii. Extract records from the table demography for district from Regions names ending with letter
“N” and then add them to the table demo-mod you have just created. Save this query with
name “add letters” (3mks)
iii. In the table “demo mod” change the denomination name from Christian to Hindu. Save this
query as “denomination” (3mks)
iv. In the table demo-mod, erase/delete records for values greater than or equal to 150,000 in
the approx. population field. Save query as “delete query” (3mks)
d. Using records in the demography table create a Justified form with office as a style using form wizard
and let the form title be “Demography distribution in Kenya”. (5mks)
e. By use of a report wizard, display records from the table demography with its fields EXCEPT male
and female field. Group the report by Region, layout should be outline 2 and landscape orientation.
Report title should be “population report 2017”

- 16 -
10. Mobility Tax service limited is a company that deals with taxis service within
KASSU city. Drivers are paid commission based on number of trips and kilometres
covered. The company manager has requested you to assist develop a database to
store the details of their drivers.
a) Open a database program and create a database named Mobility. [1mark]
b) Create two tables named CarDetails and DriverDetails from the following details.
[12marks]
Field Name Data Type and Properties
Trips Number (size 2)
Reg_No Text (size12)
Car_Type Text (size 25)
Emp_No Text (size 12)
Phone Number (Format the number to start with 0)
Distance Number
Charges Currency (format=Kshs, decimal Places=2)
Name Text (size 25)
Male Yes/No

c) Create appropriate relationships among the tables and enforce referential integrity.
[3marks]
d) Create a form for CarDetails table and add a Subform for the DriverDetails table.
save the form as DataEntry [8marks]
e) Enter the above data using the forms created in (d) above [10marks]

Trips Reg_No Car_Type Emp_No Phone Distance Charges Name Male


(per day) (km) (Per km)
15 KCY 128K Sedan M-001 0722563980 25 Kshs 120 Carlos Didi Yes
11 KDA 122G S. wagon M-002 0112135369 26 Kshs 135 Virginia liams No
15 KCQ 611M Van M-003 0117236895 30 Kshs 150 Eunice Glen No
16 KDB 231H USV M-004 0723568974 25 Kshs 150 David Kibara Yes
13 KDC 158C Electric M-005 0893124569 15 Kshs 100 Emily Ngetich No
12 KDG 154G Hybrid M-006 0714895647 36 Kshs 120 Benard koech Yes
10 KDH 317J S. wagon M-008 0721458697 23 Kshs 135 Eliud Mwango Yes
13 KCZ 692Z Van M-009 0110569832 25 Kshs 150 Claire Simon No
13 KDM 362T USV M-010 0123698754 23 Kshs 150 Casey Mwanzo Yes
14 KDA 212K Hybrid M-012 0115698725 36 Kshs 120 Ivy Richards No
f) Create a query to display EmpNo, Name, Car_Type and Male for Female drivers
whos names contain letter “i”. Save the query as Qry_Female. [3marks]
g) Create query to calculate commission earned by each driver given that a driver
earns 20% of the total amount charged by a vehicle. Save query as Qry_Comm.
[5marks]
h) Create a report based on Car_Type showing total distance covered. Save report as
CarType [4marks]
i) Print:
i) CarDetails and DriverDetails tables [2marks]
ii) Qry_Comm query [1mark]
iii) CarType report [1mark]

- 17 -
11. The tables below, STUDENT, SUPERVISOR and SUPERVISIONS are extracts of records kept in Bondo
University for project supervisions.

Table 1: Students Table


Student Name Gender Project Fee Paid
Number
C001 Ken M 32000
C002 Joy F 27800
C003 Lero M 18900
C004 Moth F 42700
C005 Ben M 45000
Table 2: Supervisor Table
Supervisor Number Name Department
L220 Alex Mechanical
L230 Samara ICT
L240 Roy Electronics
L250 Mati Education
L260 Joy Human Resource
Table 3: Supervision Table
Supervision Supervision Student Supervisor Project
Number Date Number Number Title
100 12/03/2015 C001 L220 Java
200 22/03/2015 C003 L230 Website
300 17/03/2015 C004 L240 Robotics
400 02/03/2015 C001 L220 Java
500 18/03/2015 C002 L240 Robotics
600 12/03/2015 C004 L230 Java
700 11/03/2015 C002 L250 Database
800 12/03/2015 C003 L220 Java
900 12/04/2015 C005 L250 Database
1100 12/04/2015 C002 L250 Database
(a) Using a database application software, create a database file named Project (2marks)
(b) Create three tables named Student, Supervisor and Supervision as shown above. (6marks)
(c) Validate Project fee paid to accept numbers between 18000 and 50000 and display error message
Invalid data enter if out of range (4mark)
(d) Set the primary key for each table. (3marks)
(e) Create relationships among the tables. (2marks)
(f) Create a form for each table above (3marks)
(g) Enter the data in the table Student, Supervisor and Supervision as shown above. (6marks)
(h) Create a query named Balance to display student name, Gender, project fee balance per student,
given that the total project fee is Ksh.50000. (4marks)
(i) Create a query named Balance2 to display students’ Names, project title whose fee balance is above
Ksh.20000. (4marks)
(j) Use Make table query to create a table called StudentSupervisor. The table should have the
following fields Student Number, Supervisor Number , Supervisor Name and Project
(4marks)
- 18 -
(k) Create a report named Supervision to display Students Names, Project Title, names of supervisor,
and supervision Dates. The records in the report should be grouped by students’ Name and the
number of supervisions by each student should be displayed. (4marks)
(l) Title the report as supervision per lecturer. (2marks)
(m)Print the following:
• Tables: Student and StudentSupervisor (2marks)
• Queries: Balance And Balance2 (2marks)
• REPORT: Supervision (1mark)

- 19 -
12. M/s Ann Momanyi, an ICT consultant with Makueni Distributors is in the process of developing a
Management Information System (MIS) for the Company. Currently, she is designing sales database
using three tables namely: - customers, products and transactions. The details for each table are given
below:-
Customers Products Transactions
Customer ID ProductID TransID
CustomerName ProductDescription ClientName
PostalAddress Packaging TransacDate
Town UnitPrice Product
Phone Stock Quantity
Questions
(a) Create a database named MIS and in it create three relations
(b) Identify the most appropriate field as the primary key in each table
(c) Establish relationships among the three tables and enforce the referential integrity
(d) Create a form for each table. Save the forms as Customer Form, Product Form and
Transaction Form
(e) Use the respective forms to enter the following records in each table
CUSTOMERS TABLE
CustomerID Customer Name Postal Address Town Phone
H001 Andrew Mwove 209 Mutituni 200870
H002 Erick Onsongo 68 Nyamira 248567
H003 Brenda Nyabuti 100 Bomet 789678
H004 Lydiah Winzaa 250 Mwingi 778009
H005 Jeff Ogero 330 Keroka 666790
H006 Maureen Makuthu 550 Kakeani 780906

PRODUCTS TABLE
ProductID Product Description Packaging Unit Price Stock
AA001 Cooking Oil 20 kg Gal 16000 80
AA003 Rice 50Kg Bags 4500 60
AB004 Detergents 5 Litres 11000 40
AC006 Fertilizer 50Kg bags 4700 30
AA007 Mineral Water 1.5 Litres 8200 400
TRANSACTION TABLE
CustomerID ClientName TansacDate Products Quantity
1001 Andrew Mwove 06/04/2007 Cooking oil 6
1002 26/04/2007 Mineral water 8
1003 Erick Onsongo 23/04/2007 Detergents 10
1004 14/04/2007 Cooking oil 12
1005 Maureen Makuthu 02/05/2007 Rice 4
1006 08/05/2007 Fertilizer 3
1007 Erick Onsongo 16/05/2007 Detergents 25
(f) Create a query that displays the customer Name, Product Description, Quantity, Unit price and a
calculated field total payable by each customer. Save the query as MISQuery
(g) Generate a report from MISQuery. Save the report as MISReport
(h) Print the Customers, Products, Transaction table’s design, MISQuery and MISReport

- 20 -
13.

(a) Wafula is a secretary for all clubs in the school. He has been told to create Club_DBMS id database
management system (DBMS) to help the club maintain record on the clubs’ members.
Relation name Fields Primary key
Admission Number
First Name
Student Last Name Admission number
Form
Stream
Club Number
Club_Details Club Name Club Number
Date established
Registration Number
Membership Club Number Registration Number
Admission Number
Date of registration
Membership fee

(a) Perform the following operations just like Wafula would:


(i) Create a database Club_DBMS with the tables shown above. (12mks)
(ii) Index on last name on the able student (2mks)
(iii) Crate a lookup list for the following fields in class student (3mks)

Field Lookup list Field Lookup list


One East
Form Two Class North
Three West
Four South

(iv) Create One-Many relationship between the relations and enforce referential integrity (3mks)
(b) Create use friendly screen inputs with the Add New Record, Find Record, Delete Record and
Close Screen Input commands for each of the table, save them using respective table’s name (12mks)
(c) Using the input screens, enter the records below: (6mks)
Admn. No. First Name Last Name Form Stream
3200 Busaule Mwitani Two East
3811 Mawi Martha One South
2844 Nambwaya Nancy Four East
2910 Wafula Victor Four Central
3295 Hassan Eunice Three East
2956 Busolo Josephat Three North
2977 Makhanu Josephat Four South
3216 Mateshe Jackline Three West

Club Number Club Name Date established


97/Mat Mathematics 05/02/1997
02/Sci Science 08/04/2002
01/Env Environment 01/09/2001
97/Lan Debate 08/04/1997

- 21 -
Reg. Number Admn. No. Club No. Reg. Date Membership Fee
MT/0013 2844 97/Mat 12/03/2007 100
SC/0189 2977 02/Sci 11/03/2007 120
MT/0975 2910 97/Mat 05/05/2007 100
DB/0111 2977 97/Lan 11/03/2007 90
EN/1001 3811 01/Env 01/03/2010 80
SC/0998 3216 02/Sci 09/10/2008 120
SC/1006 2844 02/Sci 12/03/2007 120
DB/0565 3295 97/Lan 10/05/2008 90

(c) Create a query for each record containing the product of membership fees $ multiplied by 79.8.
Label this column “Amount in shillings”. The query should display: Last Name (in ascending order),
First Name, Registration Number, Date of Registration, Amount in shillings. For all members whosel
last name start with M or J and first name start with M save the query as Query M (8mks)
(d) Create a query that Display Admission Number, Last name, first Name, Club Names and
Registration date for form four students. Save query as Members (3mks)
(e) Create a tabular report from Query-M that displays Last Name, First Name, Membership Number,
Date of Registration, Membership Fees paid in shillings and display the total to the membership fees
at the end of the report. Save the repo\rt as “Membership Report” (5mks)

Admn. No. First Name Last Name Form Stream


3200 Busaule Mwitani Two East
3811 Mawi Martha One South
2844 Nambwaya Nancy Four East
2910 Wafula Victor Four Central
3295 Hassan Eunice Three East
2956 Busolo Josephat Three North
2977 Makhanu Josephat Four South
3216 Mateshe Jackline Three West
(f) Create a tabular report from Members query, sort the records by first name and save it as
Club Members. (4mks)
(g) On each report, add your name, index number and page number in the format “Page X of Y
pages” as footer (4mks)
(h) Add “Mary Seat of Wisdom Bulimbo Girls’ Sec. School” and Report Name as Header on
each report (2mks)
(i) Print membership Report, Club Members, Query-M and Student table (4mks)

- 22 -
14. The information in the following two tables relates to a vehicle buying and selling business.

Table 1: Seller details

Seller No Seller Name Address Town


8215 Samcon 23454 Nakuru
8242 CMC 654 Eldoret
8430 DCM motors 3554 Nairobi
8620 Farmers Garage 7645 Kitale
8845 KCI 8643 Kisumu

Table 2: Vehicle details

Reg No Make Type Price Seller No


KAJ 543Q Nissan Matatu 1,200,000 8242
KAQ 952R Mercedes Saloon 4,000,000 8242
KAX 534S Peugeot Pickup 960,400 8620
KAZ 454C Mazda Saloon 550,000 8215
KBA 386A Toyota Pickup 750,000 8620
KBB 917A Toyota Saloon 800,000 8430
KBE 875T Isuzu Lorry 1,800,650 8430
KBG 805G Scania Bus 10,500,000 8845
KBJ 324D Isuzu Bus 9,200,000 8845
KZL 931 Toyota Matatu 1,400,000 8620

a). Create a database file named A:\Business. (2mks)


b). Create the two tables above and save them using their respective names. Determine the
appropriate primary keys. (10mks)
c). Create a form based on each table. Insert form titles as seller details form and vehicle
details form respectively. (5mks)
d). Use the forms to enter the records in the two tables as shown above. 15mks)
e). Create a query containing the following fields(Reg no, Make, price and Seller name). It.
Should display only those vehicles whose prices are above 1000,000. Save as Sales1. (6mks)
f). Remove the criteria set in sales1 query. Include a calculated field in the sales query to
derive new prices if the current prices went up by 5%. Save as sales2. (5mks)
g). Create a tabular report based on sales2 query. The report should show the total amount
collected from selling the vehicles if they were sold at their new prices. Save as report. (4mks)
h) Print the seller details table, vehicle details table and the report. (3mks)

- 23 -
15. Use the information in the table below to design a database. Name the table as “EmpT and store
the database file as Company (20mks)
Name Date of Sex ID No. Dept Salary paid (Kshs.)
birth
Peter 20-07-71 Male 1377841 Accounts 3000
James 30-5-78 Male 1235542 Sales 4000
Gregory 30-06-79 Male 1244745 Account s 5600
Job 14-04-77 Male 2213540 Marketing 4500
Sarah 14-07-79 Female 1124681 Sales 3000
Paul 12-04-80 Male 1455367 Accounts 3500
Onyango 25-04-08 Male 0147535 Sales 7000
Jessica 01-01-79 Male 5664124 Sales 3500

(a) Create a form named EmpF and add two more records using the form (5mks)
(b) Create three reports to print the information below:
(i) Employees listed by Department types (EmpR1) (6mks)
(ii) Alphabetical listings of all employees (EmpR2)
(iii) All employees in the sales department get a 2% commission on sales. Create a report to
show the commission paid to all the sales people, if the basic salary for the sales people is
Kshs.3000 (EmpR3) (8mks)
(c) Create a query (EmpQ) to show who will be retiring at the end of the year, if the retirement
age is 55.

24
16. Compulynx is a company with numerous branches in east Africa. in order to monitor the
performance of the branches and that of the cities in which the branches are located, a database
to organize the information is required:-
(a) Create a database file and name it company (2mks)
(b) (i) create a table containing the following fields (4mks)

Field name Field type


STORE-NO Number/numeric
BRANCH Text/character
CITY Text/character
STAFF-SIZE Number/numeric

(ii) Make the field STORE-NO the primary key and save the tables as STORES. (2mks)
(c) (i) Create a form from the STORE able and save it as STORE-FORM (5mks)
(ii) Use the form to enter the records below (5mks)

STORE-NO BRANCH CITY STAFF SIZE


I Tudor Mombasa 15
2 Bongo Dar-es-salam 14
3 Sunset Nairobi 21
4 lake view Kampala 15
5 king’orani Mombasa 9
6 Beach town kisumu 16
7 ABC Nairobi 89
8 crane Ltd kampala 7
9 wheat land nakuru 12
10 ocean view Dar-es-salam 6

(d) (i) Modify the Store table to include and additional field with the heading SALES(SHS) (3mks)
(ii) Enter the information below for each of the stores (2mks)
STORES-NO SALES
1 789,300
2 685,400
3 376,958
4 355,420
5 457,800
6 682,458
7 541,000
8 235,420
9 352,415
10 433,443

(iii) In the STORES table, swap the fields CITY with BRANCH (2mks)
(e) (i) Create a query from the STORE tales to display the field BRANCH,CITY,STAFF-SIZE
and SALES(SHS) for stores whose sales are less than 400,00 (3mks)
(ii) Sort the records in the query above in alphabetical order of BRANCH field and save it as
POOR PERFORMERS (2mks)
(f) (i) create a tabular report with landscape orientation from STORE tables to display the field
in the following order
STORE-NO BRANCH SALES (SHS) 4mks)
25
(ii) Sort records in the report in alphabetic order of the BRANCH field (1mk)
(iii) Compute the total sales and place it below the SALES (shs) column and change its font
size to 13 (5mks)
(iv)Place two straight lines cutting across the page, one above and one below the sales total
(g) (i) Insert a header COMPULYNX PERFOEMANCE in the report having font size 19 and
centre it across the page (3mks)
(ii) Remove the report pagination and insert your name and index number in its place and
save the report as PERFORMANCE (2mks)
(h) Print STORES table, POOR PERFORMER query and performance report

26
17. a) Create a database called ELIMU (2mks)
b) Create three tables EXAMINATION, DOS and BOARDING with the field as shown below
c) Create a relationship between the three tables and enforce integrity (6mks)
d) Enter the data items in the given three tables (15mks)
EXAMINATIONS
Admission number mathematics English Kiswahili Biology
1 45 67 90 23
10 45 89 90 20
2 45 70 80 45
3 89 90 90 20
4 78 9 90 50
5 67 89 60 90
6 67 90 7 80
7 34 78 70 90
8 23 50 38 90
9 23 15 67 20

DOS
Admission number S name Other names KCPE Mark Year of KCPE
1 Peter Barasa 327 2007
10 Johnson Suk 250 2001
2 Alex Ojwang’ 340 1998
3 Chepkuto Esther 250 2008
4 Wekesa Raymond 450 2007
5 Alex Wamwana 410 2003
6 Jane Kilonzo 400 2000
7 Mathew Kariuki 450 1999
8 Nasimiyu Catheen 290 2003
9 Kimathi John 300 2001
BOARDING
Admission number uniform tool Tool name
1 No 12 JEMBE
10 Yes 20 JEMBE
2 No 11 PANGA
3 Yes 1 SLASHER
4 Yes 111 JEMBER
5 No 15 RAKE
6 Yes 22 BASIN
7 Yes 11 BROOMS
8 Yes 90 RAKE
9 yes 23 BUCKET

27
e) Design query that would display the following fields as shown below and write down the formulae for
getting the total score and criteria for extracting the records below (10marks)
Admin
Admission uniform S Name KCPE maths English Kiswahili TOTAL
number Mark SCORE
1 Yes chepkuto 250 89 90 90 269

10 Yes wekesa 450 78 9 90 177


2 Yes Jane 400 67 90 7 164

f) Design a report that would sort the following in ascending order of the following fields, total score, and
KCPE score, name the admission number and the report should display all the fields. Save the report as
administration (5mks)
g) Print, administration and admin (2mks)

28
18. (a) Create a database file called VIDEOS and use it to enter the details that follow. (3 mks)
(b) Create a table called Customer using the following structure. (4 mks)
Field Name Data type Size Description Caption
Customer ID Number 3 3 – digit unique number Customer ID
Last Name Text 25 Enter the Last Name Last Name
First Name Text 15 Enter First Name First Name
Address Text 50 Address Address
Birth Date data/time Enter yyyy/mm/dd Date of birth
Home Tel Text 14 Home Tel. Home Tel.
Work Tel Text 14 Work Tel. Work Tel.
Email Text 40 Email Address Email Address
Gender Place Text 1 M or F Gender
Work Place Text 40 Place of employment Place of employment
(i) Make the Customer ID Field the primary key. (1 mk)
(ii) Format the Last Name and First Name fields to convert characters to upper case by using >.
(iii) Enter Yes in the required property of the Last Name, First Name and Gender fields. (1 mk)
(iv) Format the Birth Date field yyyy.mm.dd to input the birth dates ,year, month abd day.(1 mk)
(v) Use the input mask for the Home Telephone and work Telephone fields. The input mask should be
(999) 999 – 999.
(vi) Format the Gender field to convert the character to upper case using >. (1 mk)
(vii) Enter the M or F for the Validation rule field of the gender Field. (1 mk)
(viii) Enter the Only valid entries are M or F in the validation Text of the Gender Field.(1 mk)
(ix) Enter Yes in the required property of the gender field. (1 mk)

(x) Save the tables as Customer. (1 mk)


Custo Home Wor Email Work
mer Last First Address Birth Tel. k Gende place
ID Name Name Date Tel. r
(245) Bankers
201 JOHNSO MICHEL RUBY 1969/02/ 431- (246 Michele@bclu F Night
N E PARK, ST 15 2916 )_ b.com Club
PHILIP 2196
(246) GE
202 CHAND TRYON BANK 1969/03/ 431- (246 M Electro
LER E HALL, ST. 05 8971 ) nics
MICHAEL 422-
1119
(246)
203 BANFIE SHIRLE 71 LONG 1970/10/ 5441 sheba@email. F
LD Y BAY 26 com

29
DEVELOPM
ENT
(246) (246 Queen
204 ISIDORE EYSTHE 4MT 1968/11/ 433 – ) F Elizabet
R STANDFAS 10 9172 422 h
T, ST. – Hospita
JAMES 1999 l
(246) (246 Transpo
205 CONNE WINSTO CANE 1971/12/ 433 – ) connel@hotm M rt
L N GARDEN, 10 9172 417- ail.com Board
ST. 4177
THOMAS
(246) (246 KMGP
206 KELLM ARLENE ST. 1974/06/ 421 – ) 426 sypher@hotm F
AN PATRIICKS, 10 2031 – ail.com
CHRIST 2979
CHURCH
(246) (246 Core
207 PAYNE REBA FOSTER, 1967/01/ 423- ) 423 rebapay@sun F Crystal
HALL, ST. 03 6823 – beach.com Hotel
GEORGE 9741
(246)
208 GRANT FREDER GRAPEHAL 1962/09/ 417 – M
IC H L, 09 2280
ST. LUCY
(246)
209 SMITH IRENE ASHTON 1945/07/ 433- storm@hotma F
HALL, ST. 07 3302 il.com
PETER
(246) (246 JG
210 THOMA WICKM BOSCOBEL 1943/04/ 429 – ) 422 M Retirem
S AN N LE, ST. 06 2916 – ent
ANDREW 1231 home

(246) Caribbe
211 CATWE PAULIN BRAGGS 1970/02/ 433 – catpur@yaho. F an
LL E HILL, ST. 02 87 91 com Union
JOSEPH
(246) (246 Shopper
212 GREAV LINDA TOHMPSO 1970/09/ 417 - ) F s
ES N ROAD, 10 4177 417- Retail
ST. 4177 Store
THOMAS
c) Enter the following data into the customer table. (10 mks)

(d) Save the table as Customer.

(e) Some new data become available and a few changes have to be made to existing table.
These tasks are listed below.
(i) Enter the new address for Shirley Banfields as 7 Bayfield Development. (1 mk)
(ii) Delete record 12.

(f) Index in ascending order the customer table on the last name and first name fields in the design
30
view. The index is called Name. (5 mks)

(g) Perform a select query and print the last name, first name, address, home and work telephone
numbers for each customer. He would like the information printed with the last names in
alphabetical order. Save the query as Customer List. (5 mks)

(h) (i) Create a query to display all customers who live in St. Michael or St. Thomas. Save
the query as Saint. (2 mks)
(ii) Display all customers whose last names begin with “B’ save it as B. (2 mks)

(i) Create a Customer data entry form from the customer table. The title of the form should be
“Customer Data Entry Form” (4 mks)

(j) Print customer table, Customer List, Saint and B. (2 mks)

31

You might also like