Software Development  ·  Level 6
Computerised Database Systems Management
Chapter 2: To create database system
📚 3 Topics
What you will be able to do

By the end of this chapter, you will be able to:

  • Choose the right database management software based on the system needs.
  • Set up the database development environment correctly to match application requirements.
  • Create database objects accurately by following design plans.
  • Apply data attributes properly as detailed in the database design.
  • Build data relationships correctly according to the design specifications.
  • Follow workplace safety and health practices that meet OSHA standards.
  • Identify the correct methods for storing and disposing of e-waste safely.
  • Demonstrate proper e-waste management following OSHA guidelines.

These skills will help you build reliable database systems while keeping your workplace safe and environmentally responsible—key qualities for success in the tech trade!

Creating a database system is a fundamental skill for software development professionals in Kenya, particularly as organizations increasingly rely on data-driven decision-making. Effective database creation enables efficient data storage, retrieval, and management, forming the backbone of many software applications in sectors such as banking, healthcare, education, and government. This chapter explores the essential components involved in building a database system, focusing on the creation of database objects and fields, which are critical to structuring data logically and functionally.

2.1 Creation of Database Objects

The creation of database objects is a core activity when setting up a database system. These objects define the structure and schema of the database, allowing software developers to organize data effectively. In Kenya’s dynamic software industry, understanding these objects is vital for building scalable and maintainable database solutions that meet client and regulatory requirements.

2.1.1 Database Objects

Database objects are the fundamental building blocks within a database system that store, organize, and manipulate data. They include tables, views, indexes, stored procedures, and triggers, each serving a specific purpose in managing data efficiently. Software developers working in Kenyan firms or on projects for institutions such as the Kenya Revenue Authority (KRA) rely on these objects to design robust databases that support complex data operations.

Tables and Their Role in Data Storage

Tables are the primary objects where data is stored in rows and columns, similar to spreadsheets. Each row represents a record, while columns represent attributes or fields of the data. For example, a hospital management system might have tables for patients, doctors, and appointments. Tables must be carefully designed with appropriate data types and constraints to ensure data integrity and performance.

Views for Data Abstraction and Security

Views are virtual tables created by querying one or more tables. They provide a way to present data selectively without exposing the underlying tables directly. In banking software, for instance, views can restrict access to sensitive customer information while allowing staff to view relevant data subsets.

Indexes for Performance Optimization

Indexes are database objects that improve the speed of data retrieval operations by creating pointers to data within tables. Proper indexing is crucial in large databases like those used by educational institutions managing thousands of student records. However, excessive indexing can slow down data insertion and updates, requiring balanced implementation.

Stored Procedures for Reusable Logic

Stored procedures are precompiled SQL code blocks stored in the database, allowing repetitive tasks or complex operations to be executed efficiently. Kenyan software developers often use stored procedures to enforce business rules or automate data processing in systems such as SACCO management platforms.

Triggers for Automated Responses

Triggers are special procedures that automatically execute in response to specific events on a table, such as insertions, deletions, or updates. They are useful for maintaining audit trails or enforcing complex integrity constraints without manual intervention, as seen in county government financial systems.

2.1.2 Fields

Fields, also known as columns or attributes, define the individual data elements stored within a table. Each field has a specific data type and constraints that determine what kind of data it can hold. Proper field definition is critical for data accuracy and consistency in software applications used in diverse Kenyan sectors.

Field Data Types and Their Importance

Choosing the correct data type for a field ensures efficient storage and accurate data processing. Common data types include integers, decimals, characters, dates, and booleans. For example, a university database might use date fields to track student enrollment dates and decimal fields to store GPA values.

Field Constraints to Maintain Data Integrity

Constraints restrict the type of data that can be entered into a field, preventing invalid data entry. Typical constraints include NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, and CHECK. In retail business databases, a UNIQUE constraint on product codes prevents duplicate entries, ensuring inventory accuracy.

Field Naming Conventions in Database Design

Consistent and descriptive field naming enhances readability and maintainability of database schemas. Kenyan developers often follow conventions such as using lowercase letters, underscores to separate words, and meaningful names like "customer_id" or "transaction_date" to facilitate collaboration and future system upgrades.

Default Values and Field Behavior

Fields can have default values that are automatically assigned when no explicit value is provided during data entry. This feature simplifies data input and ensures essential fields have valid data. For instance, a hotel booking system might default the "booking_status" field to "pending" when a new reservation is created.

Field Indexing and Performance

Fields that are frequently searched or used in join operations may require indexing to speed up query performance. However, indexing every field is inefficient, so developers must identify key fields that benefit the most from indexing, such as customer ID fields in SACCO databases.

Practice Questions

  1. Explain the role of tables and views in a database system and how they differ. (6 marks)
  2. Describe five types of database objects and their purposes in software development. (10 marks)
  3. Why is it important to define appropriate data types and constraints for fields in a database? Provide examples. (8 marks)
  4. Discuss the advantages and disadvantages of using indexes on fields in a database. (6 marks)
The rest of this chapter
🔒

Create a free account to open more of this chapter.

Free: practical guides, quick cards, workplace scenarios and more.

Create a free account
🔒2.2 Database Development

Database development is a critical phase in building robust software solutions, especially for software development professionals working on systems that require efficient data storage, retrieval, and manipulation. In Kenya, businesses ranging from banks like…

🔒2.3 Data Relationships

In software development, especially in designing database systems, understanding data relationships is fundamental. Data relationships define how entities or tables within a database connect and interact with each other. In Kenya’s dynamic software industry, w…

Chapter Summary

This chapter explored the creation of database systems by first examining the various database objects essential for effective data management, including tables, forms, queries, reports, and macros. It then focused on the structure of data within these objects, highlighting the importance of fields, records, data types, field properties, and keys in organizing and securing information. The development process of a database was detailed through the steps of creating tables, establishing relationships between tables, and designing queries, forms, and reports to facilitate data manipulation and presentation. Additionally, the chapter addressed critical elements such as integrity constraints and database indexing to ensure data accuracy and optimize performance. Lastly, it described different types of data relationships, including one-to-one, one-to-many, many-to-one, and many-to-many, which define how data entities interact within a database system. Together, these topics provide a comprehensive foundation for constructing and managing computerized databases effectively.

Self-Assessment

🔒 PDFDownload this self-assessment, with answers

A. Written Assessment

  1. Define a database table and explain its role in a database system. (4 marks)
  2. Which database object is primarily used to enter, modify, and view records?
    a) Table
    b) Form
    c) Query
    d) Report (2 marks)
🔒20 more in this section.

Chapter Examination Questions

🔒 PDFDownload these examination questions, with model answers

SECTION A (40 Marks) - Answer ALL Questions

  1. Define the term database object and explain its importance in software development projects such as those undertaken at Equity Bank. (4 marks)
  2. Distinguish between tables and forms in a database system, giving an example of when each would be used in a school management software. (4 marks)
🔒18 more in this section.

Chapter Practical Activities

Practical 1: Create a student registration database with tables and fields

Software Development · Level 6
Computerised Database Systems Management
PRACTICAL ASSESSMENT
TIME: 4 HOURS
⬇ PDFCandidate Instructions (Candidate Tool)

Type: Individual

INSTRUCTIONS TO CANDIDATE:
1.  You are required to perform the following task:
i.  Create a database named 'StudentRegistration' with three tables: Students (StudentID, FirstName, LastName, DateOfBirth, Email), Courses (CourseID, CourseName, DurationMonths), and Enrollments (EnrollmentID, StudentID, CourseID, EnrollmentDate) with appropriate data types and primary keys.
2.  You have been provided with the following resources for the practical task:
Tools & EquipmentMaterials
Relational Database Management System (MySQL, PostgreSQL, MS SQL Server)Rewritable Compact Disc (CD-RW)
Data Modelling Tool (Lucidchart, EdrawMax, Draw.io)
⬇ PDFResources Required (Cutting List)
S/NItemQuantity
1Relational Database Management System (MySQL, PostgreSQL, MS SQL Server)1 Pc per Candidate
2Data Modelling Tool (Lucidchart, EdrawMax, Draw.io)1 Pc per Candidate
3Rewritable Compact Disc (CD-RW)1 Pc per Candidate
⬇ PDFAssessor Guide
Items to be EvaluatedMarks AvailableMarks ObtainedComments
TASK 1: Create database and tables
Created database named 'StudentRegistration'
(Award 1 mark for correct database creation)
1
Created table 'Students' with fields and appropriate data types
(Award 1 mark for each correct field and data type: StudentID integer PK, FirstName varchar, LastName varchar, DateOfBirth date, Email varchar)
4
Created table 'Courses' with fields and appropriate data types
(Award 1 mark for each correct field and data type: CourseID integer PK, CourseName varchar, DurationMonths integer)
3
Created table 'Enrollments' with fields and appropriate data types
(Award 1 mark for each correct field and data type: EnrollmentID integer PK, StudentID integer FK, CourseID integer FK, EnrollmentDate date)
4
Set primary keys on StudentID, CourseID, EnrollmentID fields respectively
(Award 1 mark for each primary key defined)
3
Set foreign key constraints on Enrollments.StudentID and Enrollments.CourseID referencing Students and Courses respectively
(Award 1.5 marks for each foreign key constraint)
3
Used consistent naming conventions for tables and fields
(Award 2 marks for consistent and meaningful naming)
2
Sub-Total20
PRODUCT CHECKLIST
Students table with fields: StudentID (integer, PK), FirstName (varchar), LastName (varchar), DateOfBirth (date), Email (varchar)
(Award 3 marks for correct fields, data types, and primary key)
3
Courses table with fields: CourseID (integer, PK), CourseName (varchar), DurationMonths (integer)
(Award 2 marks for correct fields, data types, and primary key)
2
Enrollments table with fields: EnrollmentID (integer, PK), StudentID (integer, FK), CourseID (integer, FK), EnrollmentDate (date)
(Award 3 marks for correct fields, data types, primary key, and foreign keys)
3
Referential integrity enforced via foreign keys between Enrollments and Students, and Enrollments and Courses
(Award 2 marks for correct foreign key constraints)
2
Database structure follows normalization and best design practices
(Award 2 marks for normalization and consistent naming)
2
Sub-Total12
GRAND TOTAL32
ASSESSMENT OUTCOME:   ☐ Competent    ☐ Not Yet Competent (competent if at least 50%)

Practical 2: Define Primary and Foreign Keys in a Student-Subject Database

Software Development · Level 6
Computerised Database Systems Management
PRACTICAL ASSESSMENT
TIME: 4 HOURS
⬇ PDFCandidate Instructions (Candidate Tool)

Type: Individual

INSTRUCTIONS TO CANDIDATE:
1.  You are required to perform the following task:
i.  Create six (6) database tables with defined primary keys and foreign keys.
2.  You have been provided with the following resources for the practical task:
Tools & EquipmentMaterials
Relational Database Management System (MySQL, PostgreSQL, MS SQL Server etc.)integer
Data Modelling Tool (Lucidchart, EdrawMax, Draw.io etc.)varchar
Rewritable Compact Disc (CD-RW)date/time
⬇ PDFResources Required (Cutting List)
S/NItemQuantity
1Relational Database Management System (MySQL, PostgreSQL, MS SQL Server etc.)1 Pc per Candidate
2Data Modelling Tool (Lucidchart, EdrawMax, Draw.io etc.)1 Pc per Candidate
3Rewritable Compact Disc (CD-RW)1 Pc per Candidate
⬇ PDFAssessor Guide
Items to be EvaluatedMarks AvailableMarks ObtainedComments
TASK 1: Define Database Keys
Mapped entities from the ERD into six (6) relations
(Award 1 mark per correctly mapped relation, zero if incorrect)
3
Specified attributes for the six (6) relations
(Award 1 mark per table for correct attributes with data types)
6
Specified primary keys for the six (6) relations
(Award 0.5 mark per correct primary key per table)
3
Specified composite primary keys for the marks and subject-teacher relations
(Award 1 mark per correct composite primary key)
2
Enforced referential integrity by specifying foreign keys in the referencing relations
(Award 1 mark per correctly defined foreign key with constraints)
4
Printed the relational schema
(Award 1 mark for clear, complete printed schema)
1
Sub-Total19
PRODUCT CHECKLIST
Created database and six (6) tables with required attributes and data types
(Award 2 marks per table created with correct attributes and data types)
12
Enforced entity integrity (primary key) constraints in the six (6) tables
(Award 1 mark per table for correct primary key enforcement)
6
Enforced referential integrity (foreign key) constraints in the six (6) tables
(Award 1 mark per table for correct foreign key enforcement)
6
Utilized best practices in Database Design: (a) Well normalized relations (b) Consistent naming scheme for relations and attributes
(Award 2 marks for normalization, 2 marks for consistent naming)
4
Sub-Total28
GRAND TOTAL47
ASSESSMENT OUTCOME:   ☐ Competent    ☐ Not Yet Competent (competent if at least 50%)
🔒

Free: practical guides, quick cards, workplace scenarios and more.

Create a free account
🔒Link tables by establishing data relationships in a student database systemPractical 3
🔒Create a one-to-one relationship between Employee and EmployeeDetail tablesPractical 4
🔒Establish a one-to-many relationship between Customers and Orders tablesPractical 5
🔒Establish Many-to-One Relationship Between Customer and Orders TablesPractical 6
🔒Create a Junction Table to Implement Many-to-Many RelationshipsPractical 7
🔒Create Queries to Retrieve Data from a Student DatabasePractical 8
🔒Design and Create User-Friendly Database Forms for Student RecordsPractical 9
🔒Generate Formatted Database Reports from Student Performance DataPractical 10
🔒Create and Use Database Macros for AutomationPractical 11
🔒Implement Database Indexing for Performance ImprovementPractical 12
🔒Create and manage records within database tablesPractical 13
🔒Create and manage database objects for student performance trackingPractical 14
🔒Development of a Student Performance Database SystemPractical 15
Flashcards 20 cards Study deck ▾
Question
1

↻ Tap card to reveal answer
🔒

18 more in this section.

Create a free account
Test Yourself 19 questions Start quiz ▾
0%
0 / 2
🔒

17 more in this section.

Create a free account
Am I competent?

At the start of this chapter we promised you would be able to:

  • Choose the right database management software based on the system needs.
  • Set up the database development environment correctly to match application requirements.
  • Create database objects accurately by following design plans.
  • Apply data attributes properly as detailed in the database design.
  • Build data relationships correctly according to the design specifications.
  • Follow workplace safety and health practices that meet OSHA standards.
  • Identify the correct methods for storing and disposing of e-waste safely.
  • Demonstrate proper e-waste management following OSHA guidelines.

Tick each one you can genuinely do.

Prove it — in the simulator

Sample simulation — try how the simulator works. A version built for this chapter's practical is coming.

Prepare Kenyan PilauLocked ▸

Free: practical guides, quick cards, workplace scenarios and more.

Now — 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.