By the end of this chapter, you will be able to:
Mastering these skills will help you build reliable databases that support real-world business and organizational needs.
Compiled by: Ann Chebet
Creating a computerized database is a fundamental skill for ICT technicians tasked with managing data efficiently in diverse Kenyan workplaces. Whether supporting a county government office managing citizen records or a retail business tracking inventory, understanding how to structure data through database objects and fields ensures reliable, accessible, and secure information storage. This chapter addresses the essential components involved in creating a database, focusing on the creation of database objects and the detailed configuration of fields to meet organizational needs.
Database objects are the structural elements that a database management system uses to organise, store, present and automate work with data. Creating them correctly is the first practical step in building a computerised database, because every later task, from entering data to producing reports, happens through one of them. Fields are the smallest parts of a table, and they decide what kind of data can be stored and how well it is protected. The examples in this topic use Microsoft Access, which shows all of its objects in one Navigation Pane, because it makes the objects easy to see. Access runs on Windows and is sold within certain Microsoft 365 and Office editions, so check the licence before choosing it for a client. Free alternatives such as LibreOffice Base work in a similar way, and server products such as MySQL provide the same ideas with different tools.
The main database objects are tables, forms, queries, reports and macros. Each has one job: tables store the data, queries ask questions about it, forms enter and edit it, reports present it and macros automate routine actions. They depend on each other. A form and a report usually draw their data from a table or a query, and a macro can open a form or run a query. Consider an equipment hire business that rents out chairs, tents and public address sets for events. A table holds the equipment and the hires, a query lists items currently out, a form lets the clerk record a new hire, a report prints the weekly hire summary and a macro opens the hire form when the database starts. In Access all the objects are saved together in one file with the extension .accdb.
A table is the object that stores the raw data, in rows and columns. Each table should be about one subject, such as equipment, customers or hires, so that each fact is stored in one place only. Each row is a record, which holds all the facts about one item, and each column is a field, which holds one kind of fact for every record.
Equipment
EquipmentID Item DailyRate (Ksh) QtyOwned
E01 Plastic chair 15 200
E02 Tent 10 m by 10 m 4500 3
E03 Public address set 6000 2
Tables have several important characteristics.
A form is the object that provides a friendly screen for entering, viewing and editing data. Users who are not technical can work through a form without ever seeing the tables behind it. A hire clerk, for instance, can choose a customer from a drop-down list and enter the dates, and the form stores the data in the correct tables.
A query is the object that retrieves or changes data according to criteria that the user sets. It does not store data of its own. It stores the question, and each time it runs it produces up-to-date results from the tables. A query can select certain fields, filter records, sort them, combine tables and calculate new values.
SELECT Item, DailyRate
FROM Equipment
WHERE DailyRate > 1000;
Applied to the Equipment table above, this query returns the tent at Ksh 4,500 and the public address set at Ksh 6,000, and leaves out the chair.
A report is the object that formats and summarises data for viewing or printing. While a form is for entering data, a report is for showing finished information to a person who will read it, such as the owner. A report draws its data from a table or a query.
A macro is an object that stores a list of actions so that Access performs them automatically, without the user writing a program. Macros save time on repeated tasks and make sure the steps are always done in the same order. They are built in the Macro Builder by choosing actions from the Action Catalog.
A field is one column of a table. It holds one kind of fact for every record, and it has a name, a data type and a set of properties. Properly specified fields ensure data integrity, efficient storage and meaningful retrieval. The examples in this part come from a photo studio that records client bookings, with fields for the client name, phone number, session date, package, deposit and confirmation.
Field names make queries, forms and code easier to read and maintain, and they should follow a convention.
A record is the complete set of field values about one thing, shown as one row of a table. In the studio's Booking table one record describes one booking.
BookingNo ClientName Phone SessionDate Package Deposit (Ksh) Confirmed
1 Achieng 0700 000 001 2026-12-05 Wedding 5000 Yes
2 Baraka 0700 000 002 2026-12-06 Portrait 500 No
Here the table holds two records and seven fields. Records are what users add, change, find and delete.
A data type decides what kind of values a field accepts and how much space it uses. Choosing the right type prevents wrong entries and makes sorting and calculation work properly. The guidelines for choosing a type are given under Selection of data types in database design. The commonly used types in Microsoft Access, in current Microsoft 365 versions, are shown below with a rough equivalent in SQL.
| Access data type | Stores | Example field | Rough SQL equivalent |
|---|---|---|---|
| Short Text | Letters, digits and symbols, up to 255 characters | ClientName, Phone | VARCHAR(n) |
| Long Text | Large amounts of text | Notes | TEXT |
| Number | Whole or decimal numbers, in a chosen size | Quantity | INT, SMALLINT, DECIMAL |
| Large Number | Very large whole numbers | A long reference number | BIGINT |
| Date/Time | Dates and times | SessionDate | DATE, DATETIME |
| Currency | Money, with fixed decimal places | Deposit | DECIMAL |
| AutoNumber | A number the database generates for each new record | BookingNo | AUTO_INCREMENT integer |
| Yes/No | A true or false value | Confirmed | BOOLEAN |
| Hyperlink | A web or file address | PortfolioLink | VARCHAR(n) |
| Attachment | One or more files, such as photographs | SamplePhotos | BLOB |
| Calculated | A value worked out from other fields | Balance | Generated column |
| Lookup Wizard | A value chosen from a list or another table | Package | Foreign key |
The Number type has sizes. Byte stores whole numbers from 0 to 255, Integer from −32,768 to 32,767 and Long Integer from −2,147,483,648 to 2,147,483,647, while Single and Double store decimal numbers with different precision. Phone numbers are stored as Short Text, because a leading zero would be lost in a Number field and nobody adds phone numbers together. Memo is the old name for Long Text.
Field properties are settings that refine how a field behaves. They appear in the lower pane of Design View and differ a little for each data type. Careful settings control what is accepted, how it looks and how it is stored.
A key is a field, or a group of fields, that identifies records or links tables. The kinds of key, such as candidate, alternate and surrogate keys, are explained under Keys in database design. This part shows how keys are set when objects are created.
Create a free account to open more of this chapter.
Free: practical guides, quick cards, workplace scenarios and more.
Create a free accountThis chapter explored the creation of computerized databases by first detailing various database objects such as tables, forms, queries, reports, and macros that serve as foundational elements for data management. It examined fields and records, highlighting the importance of data types, field properties, and keys in structuring information effectively. The process of database development was covered extensively, including the creation and linking of tables, as well as building queries, forms, and reports to facilitate data interaction and presentation. Integrity constraints were discussed to ensure data accuracy and consistency, focusing on null values, entity integrity, referential integrity, and general constraints. The chapter also introduced database indexing, differentiating between primary and secondary indexing to optimize data retrieval. Finally, it explained data relationships by describing one-to-one, one-to-many, many-to-one, and many-to-many associations, alongside fundamental database operations such as insert, select, update, and delete. An introduction to SQL was provided with guidance on writing commands and using SQL views to manage and manipulate database information efficiently.
Type: Individual
| Tools & Equipment | Materials |
|---|---|
| Computer with database software (e.g. MS Access 2016 or later) | |
| Database template file (empty) |
| S/N | Item | Quantity |
|---|---|---|
| 1 | Computer with database software (e.g. MS Access 2016 or later) | 1 Pc per Candidate |
| 2 | Database template file (empty) | 1 Pc per Candidate |
| Items to be Evaluated | Marks Available | Marks Obtained | Comments |
|---|---|---|---|
| TASK 1: Create the database and Students table | |||
| Launched database software and created a new database named 'CollegeEnrollment' (Award 1 mark for correct database creation and naming) | 1 | ||
| Created 'Students' table with fields: StudentID, FirstName, LastName, Gender, DateOfBirth, Department (Award 1 mark per correct field name) | 6 | ||
| Assigned appropriate data types to each field (e.g. StudentID: AutoNumber, FirstName: Short Text, DateOfBirth: Date/Time) (Award 1 mark per correct data type assignment) | 6 | ||
| Set StudentID as Primary Key for 'Students' table (Award 1 mark for correct primary key set) | 1 | ||
| Sub-Total | 14 | ||
| TASK 2: Create the Enrollments table | |||
| Created 'Enrollments' table with fields: EnrollmentID, StudentID, CourseCode, EnrollmentDate, Grade (Award 1 mark per correct field name) | 5 | ||
| Assigned appropriate data types to each field (e.g. EnrollmentID: AutoNumber, StudentID: Number, EnrollmentDate: Date/Time, Grade: Number) (Award 1 mark per correct data type assignment) | 5 | ||
| Set EnrollmentID as Primary Key for 'Enrollments' table (Award 1 mark for correct primary key set) | 1 | ||
| Set StudentID as Foreign Key referencing Students.StudentID (Award 1 mark for correct foreign key relationship) | 1 | ||
| Sub-Total | 12 | ||
| TASK 3: Populate tables with provided data | |||
| Entered at least 5 student records into 'Students' table with valid data (Award 1 mark for each correctly entered student record, max 4) | 4 | ||
| Entered at least 5 enrollment records into 'Enrollments' table with valid data linking to Students (Award 1 mark for each correctly entered enrollment record, max 4) | 4 | ||
| Sub-Total | 8 | ||
| TASK 4: Define field properties | |||
| Set field size for text fields (e.g. FirstName and LastName to 50 characters) (Award 1 mark for each correctly set field size) | 2 | ||
| Set required fields to not allow null values where appropriate (Award 1 mark for each correctly set required field) | 2 | ||
| Set default value for Grade field as 0 (Award 1 mark for correct default value set) | 1 | ||
| Sub-Total | 5 | ||
| PRODUCT CHECKLIST | |||
| Database 'CollegeEnrollment' contains two tables with correct fields and data types as specified (Award 5 marks if both tables and fields are correct and complete) | 5 | ||
| Primary and foreign key constraints correctly applied (Award 3 marks if all keys and relationships are correctly defined) | 3 | ||
| Tables populated with at least 5 accurate records each linking properly (Award 4 marks for correctly populated and linked tables) | 4 | ||
| Field properties such as field sizes, required fields, and default values correctly set (Award 3 marks for appropriate field property settings) | 3 | ||
| Sub-Total | 15 | ||
| GRAND TOTAL | 54 | ||
Type: Individual
| Tools & Equipment | Materials |
|---|---|
| Computer with database application installed | Student and Enrollment Data Sheet |
| Keyboard and Mouse |
| S/N | Item | Quantity |
|---|---|---|
| 1 | Computer with database application installed | 1 Pc per Candidate |
| 2 | Keyboard and Mouse | 1 Set per Candidate |
| 3 | Student and Enrollment Data Sheet | 1 Set per Candidate |
| Items to be Evaluated | Marks Available | Marks Obtained | Comments |
|---|---|---|---|
| TASK 1: Create and Save Database | |||
| Launched the database application (Award 1 mark for launching the database application) | 1 | ||
| Created a new database and saved it as 'StudentEnrollment' (Award 1 mark for creating and saving the database with correct name) | 1 | ||
| Sub-Total | 2 | ||
| TASK 2: Create Students Table | |||
| Created table named 'Students' (Award 1 mark for correct table name) | 1 | ||
| Added field 'StudentID' with data type 'AutoNumber' or equivalent (Award 1 mark for field name, 1 mark for correct data type) | 2 | ||
| Set 'StudentID' as Primary Key (Award 1 mark for primary key constraint) | 1 | ||
| Added fields 'FirstName', 'LastName', 'Gender', 'Department' with appropriate data types (Award 1 mark each for field name and correct data type, total 4 marks) | 4 | ||
| Saved the 'Students' table (Award 1 mark for saving the table) | 1 | ||
| Sub-Total | 9 | ||
| TASK 3: Create Enrollment Table | |||
| Created table named 'Enrollment' (Award 1 mark for correct table name) | 1 | ||
| Added field 'EnrollmentID' with data type 'AutoNumber' or equivalent (Award 1 mark for field name, 1 mark for correct data type) | 2 | ||
| Set 'EnrollmentID' as Primary Key (Award 1 mark for primary key constraint) | 1 | ||
| Added field 'StudentID' with data type matching 'Students.StudentID' (Award 1 mark for field name, 1 mark for correct data type) | 2 | ||
| Added fields 'CourseName' and 'Grade' with appropriate data types (Award 1 mark each for field name and correct data type) | 2 | ||
| Set 'StudentID' as Foreign Key referencing 'Students.StudentID' (Award 1 mark for foreign key constraint) | 1 | ||
| Saved the 'Enrollment' table (Award 1 mark for saving the table) | 1 | ||
| Sub-Total | 10 | ||
| TASK 4: Populate Tables with Provided Data | |||
| Entered all provided student records correctly into 'Students' table (Award 1 mark for every 5 correct records entered, max 4 marks) | 4 | ||
| Entered all provided enrollment records correctly into 'Enrollment' table (Award 1 mark for every 5 correct records entered, max 4 marks) | 4 | ||
| Sub-Total | 8 | ||
| TASK 5: Create Queries for Data Retrieval | |||
| Created query listing full names (FirstName + LastName) and Department from 'Students' (Award 2 marks for correct query) | 2 | ||
| Created query displaying CourseName and Grade for each enrolled student using table join (Award 3 marks for correct query with join) | 3 | ||
| Created query showing full names of all male students who are enrolled (Award 3 marks for correct query with gender filter and join) | 3 | ||
| Created query listing students who scored grade above 75 (Award 3 marks for correct query with grade condition) | 3 | ||
| Sub-Total | 11 | ||
| TASK 6: Apply Indexing to Tables | |||
| Created primary index on 'StudentID' in 'Students' table (Award 2 marks for correctly applied primary index) | 2 | ||
| Created secondary index on 'CourseName' in 'Enrollment' table (Award 2 marks for correctly applied secondary index) | 2 | ||
| Sub-Total | 4 | ||
| PRODUCT CHECKLIST | |||
| Database 'StudentEnrollment' contains two linked tables with correct fields and data types (Award 4 marks for correct table structure and field types) | 4 | ||
| Primary and foreign keys correctly established between 'Students' and 'Enrollment' (Award 4 marks for correct key constraints) | 4 | ||
| Tables populated accurately with provided data (Award 4 marks for correct data population) | 4 | ||
| Queries return correct results as per specifications (Award 5 marks for working queries) | 5 | ||
| Indexes applied correctly for primary and secondary keys (Award 3 marks for correctly applied indexes) | 3 | ||
| Sub-Total | 20 | ||
| GRAND TOTAL | 64 | ||
At the start of this chapter we promised you would be able to:
Tick each one you can genuinely do.
So, are you there yet?
You're competent when you can confidently do 50% or more of what this chapter promised.
Sign in to record how you're doing.