Programming and Databases Detailed Study Module Notes
Programming and Databases Detailed Study Module Notes
Item Details
Programme Diploma in Computer Systems Engineering
Module Programming and Databases
Level Year 2 Diploma
Module Type Core Technical Module
Suggested Duration 140 hours
Database Technology, Programming, Software
Main Units
Engineering
Purpose of these notes: These notes turn the module outline into learner-friendly study material. Each topic
has simple definitions, detailed explanations, worked examples, practical tasks, common mistakes, and revision
questions.
Module Introduction
This module introduces the relationship between data, databases, programming, and software engineering. A
database stores organised data. A program processes data. Software engineering provides a professional
method for planning, building, testing, deploying, and maintaining software systems.
The module is suitable for Year 2 diploma trainees who already have basic ICT skills and are now preparing
to build small information systems such as student records, stock control, payroll, library, or registration
systems.
Module aim
To equip trainees with knowledge and practical skills in database technology, structured programming,
program development, and software engineering principles for solving real-world computing problems.
Study Map
Unit Topic Main Skill Developed
Understand files, records, fields, and
Unit 1 File Concepts
file organisation.
Identify entities, attributes, keys, and
Unit 1 Entity Relationships
relationships.
Create tables, relationships,
Unit 1 Relational Database
constraints, and SQL queries.
Manage users, backups, recovery,
Unit 1 Database Administration
security, and privacy.
Classify languages and understand
Unit 2 Programming Languages
translators.
Use IPO, algorithms, pseudocode,
Unit 2 Problem Analysis
flowcharts, and trace tables.
Translate designs into code using
Unit 2 Program Implementation variables, operators, and control
structures.
Use sequence, selection, repetition,
Unit 2 Structured Programming
functions, and modules.
Build forms, controls, event-driven
Unit 2 Visual Basic code, and simple database
applications.
Plan, build, test, implement, maintain,
Unit 3 Software Engineering
and improve software systems.
Learning outcomes
Define data, information, field, record, file, and database.
Explain different types of files used in organisations.
Describe how data is stored and organised in files.
Distinguish between file-based systems and database systems.
Explain the advantages and limitations of file systems.
Key terms
Term Simple meaning Example
Data Raw facts before processing 45, John, ICT, 2026
Information Processed data that has meaning John scored 45 marks in ICT.
Field One item of data StudentName
A group of related fields about one One student record containing ID,
Record
item name, gender, programme
File A collection of related records Student records file
Database A collection of related tables/files College management database
Types of files
File type Meaning Example in a college
Stores permanent or fairly stable
Master file Student master file
records
Transaction file Stores daily activities or changes Fees payment transactions
Example: If the same student name is stored in admissions, accounts, and examinations files, a spelling
correction must be made in all three places. In a database system, the student details can be stored once and
linked to other records using StudentID.
Practical activity - Creating a simple student record file: Follow the steps below and save your work as
evidence.
Learning outcomes
Define an entity and an attribute.
Identify primary keys, foreign keys, candidate keys, and composite keys.
Explain one-to-one, one-to-many, and many-to-many relationships.
Draw simple Entity Relationship Diagrams.
Convert business rules into database relationships.
Simplified explanation
An entity is something about which an organisation stores data. In a college system, common entities include
Student, Lecturer, Course, Department, and Payment. Each entity has attributes. For example, a Student
entity may have StudentID, FirstName, LastName, Gender, and DateOfBirth.
Relationship types
Relationship Meaning Example
One record in Table A relates to one One person has one national ID
One-to-one
record in Table B record
One record in Table A relates to
One-to-many One department has many lecturers
many records in Table B
Many records in Table A relate to Many students register for many
Many-to-many
many records in Table B courses
Important: Many-to-many relationships are usually converted into two one-to-many relationships using a linking
table. For example, Student and Course can be linked through Enrolment.
Practical activity - Drawing an ERD for student registration: Follow the steps below and save your work as
evidence.
Learning outcomes
Explain the concept of a relational database.
Create simple relational database tables.
Apply primary keys, foreign keys, and constraints.
Use basic SQL commands to create, insert, select, update, and delete data.
Explain the purpose of database normalisation.
Simplified explanation
A relational database stores data in related tables. Each table has rows and columns. A row is a record. A
column is a field. Relationships are created using primary keys and foreign keys. Relational databases are
useful because they reduce duplication and make data easier to search, update, protect, and report.
Database constraints
Constraint Purpose Example
Primary key Prevents duplicate records StudentID must be unique
Foreign key Protects relationships between tables CourseID must exist before
Prepared for Diploma in Computer Systems Engineering trainees
Programming and Databases - Detailed Study Module Notes
enrolment
Unique Prevents duplicate values in a column Email address must be unique
Not null Prevents empty required fields StudentName cannot be blank
Check Restricts values to an allowed range Mark must be between 0 and 100
Data integrity
Integrity type Meaning Example
Every table must have a valid primary
Entity integrity No student record without StudentID
key
Foreign keys must point to existing An enrolment cannot use a CourseID
Referential integrity
records that does not exist
Values must match accepted Marks must be numeric and between
Domain integrity
type/range 0 and 100
Normalisation
Normalisation is the process of organising tables to reduce duplication and improve data integrity. It helps
avoid update, insert, and delete problems.
Practical activity - Creating a student-course database: Follow the steps below and save your work as
evidence.
Learning outcomes
Explain the role of a database administrator.
Apply basic database security procedures.
Backup and restore databases.
Monitor database performance.
Maintain database users and access rights.
Simplified explanation
Database administration is the management of databases so that data remains available, accurate, secure,
and recoverable. A Database Administrator, commonly called a DBA, is responsible for creating databases,
managing users, controlling access, backing up data, recovering lost data, and monitoring performance.
Database users
User type Role
Administrator Manages the whole database system.
Developer Builds database applications and writes queries.
End user Uses the system to view or process information.
Prepared for Diploma in Computer Systems Engineering trainees
Programming and Databases - Detailed Study Module Notes
Data entry clerk Enters, updates, and verifies records.
Backup types
Backup type Meaning Advantage
Simple to restore but takes more time
Full backup Copies the entire database
and space
Copies only changes made since the
Incremental backup Faster and uses less space
last backup
Copies changes made since the last Easier to restore than many
Differential backup
full backup incremental backups
Simple SQL injection example: A login form should not directly join user input into SQL. Instead of building
SQL like 'SELECT * FROM users WHERE username=' + input, use parameterised queries or prepared
statements.
Practical activity - Database maintenance checklist: Follow the steps below and save your work as evidence.
39. Create a list of database users and their required access levels.
40. Identify which users should only read data and which may update data.
41. Prepare a weekly backup schedule.
42. Create a simple restore test plan.
43. List five security rules for protecting the database.
UNIT 2: PROGRAMMING
Programming is the process of designing and writing instructions that a computer can follow. A program
solves a problem by accepting input, processing it, and producing output. Good programming begins with
problem analysis before coding starts.
Learning outcomes
Define programming and programming language.
Classify programming languages by generation and type.
Compare low-level and high-level languages.
Explain assemblers, compilers, and interpreters.
Choose a suitable programming language for a given problem.
Simplified explanation
A programming language is a formal language used to give instructions to a computer. Computers understand
machine language, but humans usually write programs using high-level languages such as Python, Visual
Basic, Java, PHP, C++, or JavaScript. Language translators convert human-readable code into a form the
computer can execute.
Translators
Translator Purpose Example
Converts assembly language to
Assembler Assembly programs
machine code
Converts the whole program before
Compiler C, C++, Java compilation stage
execution
Interpreter Translates and executes line by line Python, JavaScript
Example: For a student records desktop application, Visual Basic can be suitable because it provides form
controls and event-driven programming. For a web portal, PHP, JavaScript, Python, or another web technology
may be suitable.
Practical activity - Comparing languages: Follow the steps below and save your work as evidence.
49. Choose three languages such as Visual Basic, Python, and PHP.
Learning outcomes
Analyse a problem before coding.
Identify inputs, processing requirements, and outputs.
Develop algorithms.
Represent solutions using pseudocode and flowcharts.
Use desk checking and trace tables to test logic.
Simplified explanation
Problem analysis means understanding what the program must solve before writing code. Many programming
errors happen because the programmer starts coding before understanding the input, processing, output,
rules, and possible errors. A good programmer first studies the problem, writes an algorithm, tests the logic,
and then codes.
Problem-solving stages
58. Understand the problem in ordinary language.
59. Identify the required inputs.
60. Identify the processing or calculations required.
61. Identify the expected outputs.
62. Develop an algorithm.
63. Represent the algorithm using pseudocode or a flowchart.
64. Desk check the logic using sample data.
65. Code the program.
66. Test and debug the program.
Algorithm
An algorithm is a clear step-by-step procedure for solving a problem. A good algorithm must be clear, finite,
logical, correct, and efficient.
Example algorithm - final mark: 1. Start. 2. Input CA mark. 3. Input exam mark. 4. Add CA and exam to get
final mark. 5. If final mark is at least 50, display Pass. Otherwise display Fail. 6. Stop.
Pseudocode example
START
INPUT caMark
INPUT examMark
finalMark = caMark + examMark
Flowchart symbols
Symbol Use
Oval Start or end of a program
Parallelogram Input or output
Rectangle Processing or calculation
Diamond Decision such as Yes/No or True/False
Arrow Shows direction of flow
Connector Links different parts of a flowchart
Practical activity - Algorithm and flowchart practice: Follow the steps below and save your work as evidence.
Learning outcomes
Convert algorithms into program code.
Apply correct program structure.
Use variables, constants, data types, and operators.
Use sequence, selection, and repetition structures.
Test and correct syntax, logic, and runtime errors.
Simplified explanation
Program implementation is the stage where the design is translated into actual code. The programmer uses a
selected programming language to create a working program. A well-implemented program should have clear
structure, meaningful variable names, correct data types, useful comments, and proper error handling.
Operators
Operator type Meaning Examples
Arithmetic Performs calculations +, -, *, /
Relational Compares values >, <, >=, <=, =, <>
Logical Combines conditions AND, OR, NOT
Assignment Stores a value = or :=
Code example - simple interest: Simple Interest = Principal × Rate × Time / 100. The program must input
principal, rate, and time, then output the interest.
START
INPUT principal
INPUT rate
INPUT time
interest = (principal * rate * time) / 100
DISPLAY interest
STOP
Program errors
Error type Meaning Example
Violates the grammar rules of the
Syntax error Missing END IF or bracket
language
Runtime error Occurs while program is running Division by zero
Logic error Program runs but gives wrong result Using subtraction instead of addition
Debugging techniques
Read error messages carefully.
Prepared for Diploma in Computer Systems Engineering trainees
Programming and Databases - Detailed Study Module Notes
Check spelling of variable names.
Test with normal, abnormal, and extreme data.
Use print/display statements to inspect values.
Use breakpoints if the IDE supports them.
Compare the program with the original algorithm.
Test one small part at a time.
Practical activity - Implementing simple programs: Follow the steps below and save your work as evidence.
Learning outcomes
Explain structured programming.
Use sequence, selection, and repetition structures.
Break programs into modules, procedures, and functions.
Use parameters, arguments, local variables, and global variables appropriately.
Write readable and maintainable code.
Simplified explanation
Structured programming is a method of writing programs in a clear, organised, and logical way. It avoids
confusing jumps and encourages the use of sequence, selection, repetition, and modular design. Structured
programs are easier to read, test, debug, and maintain.
Control structures
Structure Meaning Example
Input marks, calculate total, display
Sequence Statements run in order
result
Program chooses between
Selection IF mark >= 50 THEN Pass ELSE Fail
alternatives
FOR each student, calculate final
Repetition Program repeats a block of code
mark
Selection example
IF finalMark >= 50 THEN
result = "Pass"
ELSE
Prepared for Diploma in Computer Systems Engineering trainees
Programming and Databases - Detailed Study Module Notes
result = "Fail"
ENDIF
Repetition example
FOR counter = 1 TO 10
INPUT mark
total = total + mark
NEXT counter
average = total / 10
Good habit: Use functions for calculations and procedures for actions. This makes your program easier to test
and reuse.
Practical activity - Menu-driven program: Follow the steps below and save your work as evidence.
87. Design a simple menu with options: Add Student, Search Student, Display Report, Exit.
88. Use selection to determine which option the user chooses.
89. Create a separate procedure for each menu option.
90. Use a loop to keep showing the menu until the user selects Exit.
91. Add comments explaining each major section.
Learning outcomes
Explain the Visual Basic development environment.
Design simple forms using controls.
Write event-driven code.
Use variables, decision statements, loops, procedures, and functions in Visual Basic.
Create simple database-connected applications.
Simplified explanation
Visual Basic is a programming environment used to create Windows applications. It is useful for beginners
because it provides a visual form designer, controls, properties, and event-driven programming. Instead of
only typing code, the programmer can design the screen visually and then write code for events such as
button clicks.
Common controls
Control Use
Label Displays text that the user usually cannot edit.
TextBox Allows the user to enter text or numbers.
Button Runs code when clicked.
ComboBox Provides a drop-down list.
ListBox Displays a list of items.
CheckBox Allows true/false or multiple selections.
RadioButton Allows one option from a group.
DataGridView Displays tabular data from a database or list.
caMark = CInt([Link])
examMark = CInt([Link])
finalMark = caMark + examMark
[Link] = [Link]()
Practical activity - Creating a Visual Basic marks form: Follow the steps below and save your work as
evidence.
Learning outcomes
Define software engineering.
Explain why software engineering is important.
Differentiate between programming and software engineering.
Describe qualities of good software.
Explain common reasons why software projects fail.
Simplified explanation
Software engineering applies organised methods, standards, tools, and discipline to software development.
Programming focuses mainly on writing code, while software engineering covers the full process of building a
useful, reliable, secure, maintainable, and user-friendly system.
Software crisis: The software crisis refers to problems such as late projects, cost overruns, unreliable systems,
poor documentation, and systems that fail to meet user needs. Software engineering reduces these problems by
using disciplined methods.
Practical activity - Evaluating software quality: Follow the steps below and save your work as evidence.
108. Choose one software application you know, such as a school portal or mobile money app.
109. Evaluate it using correctness, reliability, usability, maintainability, and security.
110. Identify two strengths and two weaknesses.
111. Suggest improvements based on software engineering principles.
Learning outcomes
Explain software project management.
Identify software project resources and constraints.
Describe basic project planning activities.
Identify project team roles.
Prepare a simple project plan.
Simplified explanation
Software project management is the planning, organising, monitoring, and controlling of software
development work. It helps a team deliver a system within agreed scope, time, cost, and quality requirements.
Project constraints
Constraint Meaning Example
Login, student registration, marks
Scope What the system must include
entry, reports
Time When the project must be completed Complete in 8 weeks
Budget for developer time, tools,
Cost Money and resources available
hosting
Quality Expected standard of the final system Secure, accurate, user-friendly
Example project: Student Records Management System: scope includes login, student registration, course
registration, marks entry, search, update, delete, reports, backup, testing, and user guide.
Practical activity - Simple project plan: Follow the steps below and save your work as evidence.
Learning outcomes
Explain the role of programming languages in software development.
Select appropriate languages for different systems.
Describe development tools used in software engineering.
Differentiate between front-end, back-end, scripting, markup, and database query languages.
Simplified explanation
Software engineering uses different languages and tools depending on the type of system being developed. A
web system may use HTML and CSS for structure and design, JavaScript for browser behaviour, PHP or
Python for server-side logic, and SQL for database queries. A desktop system may use Visual Basic, C#,
Java, or Python.
Language categories
Category Purpose Examples
Prepared for Diploma in Computer Systems Engineering trainees
Programming and Databases - Detailed Study Module Notes
Development tools
Tool Purpose Example
Provides coding, debugging, and
IDE Visual Studio, VS Code, NetBeans
project tools
Tracks code changes and supports
Version control Git, GitHub
teamwork
Provides ready-made structure and
Framework Laravel, .NET, Django
libraries
Code library Reusable code for common tasks Database connector library
Helps create user or technical
Documentation tool Markdown, Word, Help generators
documentation
Practical activity - Choosing languages for a system: Follow the steps below and save your work as
evidence.
Learning outcomes
Explain the role of data in software systems.
Identify data requirements from a case study.
Design simple data structures.
Apply basic data validation methods.
Create a simple data dictionary.
Simplified explanation
Data is central to most software systems. A system collects data, validates it, stores it, processes it, and
produces useful information. Poor data design causes errors, duplication, weak reports, and security
problems. Good software engineering requires careful analysis of data requirements before implementation.
Data structures
Structure Meaning Example
Stores multiple values of the same
Array marks[0], marks[1]
type using indexes
List Flexible collection of items List of registered students
Record Group of related fields Student record
Table Rows and columns of related records Students database table
Validation rules
Validation type Meaning Example
Presence check Field must not be empty Student name required
Practical activity - Data dictionary for registration form: Follow the steps below and save your work as
evidence.
Learning outcomes
Explain software implementation.
Describe system installation methods.
Prepared for Diploma in Computer Systems Engineering trainees
Programming and Databases - Detailed Study Module Notes
Explain direct, parallel, phased, and pilot changeover.
Prepare users for a new system.
Identify risks during software implementation.
Simplified explanation
Software implementation is the process of putting a completed or partly completed system into actual use. It
includes coding integration, installation, data migration, configuration, user training, documentation, and
changeover from the old system to the new system.
Implementation activities
Complete coding and integrate system modules.
Install the software on user computers or servers.
Configure database connections, user accounts, and security settings.
Migrate data from the old system to the new system.
Train users to operate the new system.
Prepare user manuals and technical documentation.
Monitor early use and correct problems.
Changeover methods
Method Meaning Advantage Risk/limitation
Old system stops and new
Direct changeover Fast and cheaper High risk if new system fails
system starts immediately
Old and new systems run Safer because results can More expensive and time-
Parallel changeover
together for some time be compared consuming
New system is introduced Lower risk and easier
Phased changeover Takes longer
in stages training
New system is tested in
Problems are found before Pilot may not reveal all
Pilot changeover one department/location
full rollout issues
first
Example: A college may first implement a new student portal in the ICT department only. If the pilot succeeds, it
can later be rolled out to other departments.
Practical activity - Implementation plan: Follow the steps below and save your work as evidence.
Learning outcomes
Explain software testing and its importance.
Identify testing levels and testing methods.
Prepare simple test cases.
Use normal, abnormal, and extreme test data.
Record and report test results.
Simplified explanation
Software testing is the process of checking whether software works according to requirements. Testing helps
find defects before users are seriously affected. Testing does not prove that a system is perfect, but it
increases confidence that the system behaves correctly under expected and unexpected conditions.
Testing levels
Level Meaning Example
Unit testing Testing one small part of the program Test CalculateFinalMark function
Test registration form saving to
Integration testing Testing combined modules
database
System testing Testing the whole system Test full student records system
Users test whether system meets
Acceptance testing Registrar confirms reports are correct
their needs
Testing methods
Method Meaning
Tester checks inputs and outputs without seeing internal
Black-box testing
code.
Tester uses knowledge of internal code logic and
White-box testing
structure.
Practical activity - Testing a calculator program: Follow the steps below and save your work as evidence.
159. Create test cases for addition, subtraction, multiplication, and division.
Prepared for Diploma in Computer Systems Engineering trainees
Programming and Databases - Detailed Study Module Notes
160. Include normal data such as 10 and 5.
161. Include abnormal data such as letters instead of numbers.
162. Include extreme data such as very large numbers or division by zero.
163. Record expected result, actual result, and status.
Learning outcomes
Explain software quality.
Differentiate between quality assurance and quality control.
Identify software quality factors.
Apply basic quality control techniques.
Prepare a software quality checklist.
Simplified explanation
Software quality means the degree to which software meets requirements, satisfies users, works correctly,
and can be maintained. Quality must be planned and controlled throughout the project, not added at the end.
Quality factors
Factor Simple meaning Example question
Accuracy Results are correct Are marks calculated correctly?
Reliability System works consistently Does it crash often?
Efficiency Uses resources well Does it respond quickly?
Usability Easy for users Can staff use it without confusion?
Are passwords and permissions
Security Protects data
enforced?
Quality techniques
Code review: another developer checks the code.
Documentation review: check whether manuals and technical documents are clear.
Testing: run planned test cases.
User feedback: ask real users to evaluate the system.
Standards and procedures: use naming rules, coding rules, and security procedures.
Quality metrics: measure defects, response time, completion rate, and user satisfaction.
Practical activity - Software quality checklist: Follow the steps below and save your work as evidence.
Learning outcomes
Explain software maintenance.
Identify types of software maintenance.
Describe maintenance procedures.
Prepare a basic maintenance log and maintenance plan.
Explain why version control is useful during maintenance.
Types of maintenance
Type Meaning Example
Corrective maintenance Fixing faults or bugs Correcting wrong total in fees report
Changing system for new Updating system to work with a new
Adaptive maintenance
environment OS
Perfective maintenance Improving features or performance Adding a better search function
Refactoring code and applying
Preventive maintenance Reducing future problems
security updates
Maintenance activities
Receive and record user complaints or change requests.
Analyse the cause and impact of the problem.
Plan the correction or improvement.
Update code, database, configuration, or documentation.
Test changes before release.
Update version control and maintenance log.
Inform users of changes.
Practical activity - Maintenance planning: Follow the steps below and save your work as evidence.
Learning outcomes
Explain automated testing.
Differentiate between manual testing and automated testing.
Describe benefits and limitations of automated testing.
Identify tools used for automated testing.
Develop simple automated test logic.
Simplified explanation
Automated testing uses software tools and test scripts to run tests automatically. It is useful for repeated
checks, regression testing, and fast feedback during development. However, not all testing should be
automated. Human judgement is still needed for usability, appearance, unclear requirements, and exploratory
testing.
Practical activity - Automated test planning: Follow the steps below and save your work as evidence.
Required features
199. Login form.
200. Student registration form.
201. Course registration form.
202. Student marks entry form.
203. Search student records.
204. Update student details.
205. Delete student records.
206. Generate a simple report.
207. Backup database.
208. Test report and user guide.
Suggested screens/forms
Form Controls needed Purpose
Allow authorised users to enter the
Login Form TextBox, Button, Label
system
TextBox, ComboBox, DatePicker,
Student Registration Form Capture student details
Button
Course Form TextBox, ComboBox, Button Capture course details
TextBox, ComboBox, Button,
Marks Form Enter and calculate marks
DataGridView
Search Form TextBox, Button, DataGridView Find student records quickly
Button, DataGridView, Print/Export
Reports Form Display and print reports
option
Unit 2: Programming
233. Define programming and programming language.
234. Classify programming languages by generation.
235. Differentiate between compiler and interpreter.
236. Explain the IPO model using an example.
237. Write an algorithm for calculating final marks.
238. Draw a flowchart for determining pass or fail.
239. Explain the use of trace tables.
240. Differentiate between variable and constant.
241. Explain syntax, runtime, and logic errors.
242. Define structured programming.