0% found this document useful (0 votes)
4 views46 pages

Programming and Databases Detailed Study Module Notes

The document provides detailed study notes for a core technical module on Programming and Databases, aimed at Year 2 Diploma in Computer Systems Engineering trainees. It covers essential topics such as database technology, programming languages, and software engineering principles, with practical activities and revision questions to enhance learning. The module aims to equip students with the knowledge and skills necessary to design, implement, and manage databases and software systems effectively.

Uploaded by

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

Programming and Databases Detailed Study Module Notes

The document provides detailed study notes for a core technical module on Programming and Databases, aimed at Year 2 Diploma in Computer Systems Engineering trainees. It covers essential topics such as database technology, programming languages, and software engineering principles, with practical activities and revision questions to enhance learning. The module aims to equip students with the knowledge and skills necessary to design, implement, and manage databases and software systems effectively.

Uploaded by

naomimapalo0
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Programming and Databases - Detailed Study Module Notes

PROGRAMMING AND DATABASES


Detailed Study Module Notes
Simplified explanations, diagrams, examples, practical activities, and revision questions

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.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes

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.

Main module objectives


 Explain basic file and database concepts.
 Design simple databases using entities, attributes, relationships, primary keys, and foreign keys.
 Create and manage relational databases using basic SQL commands.
 Apply basic database administration, security, backup, and recovery procedures.
 Explain programming languages and select suitable languages for different tasks.
 Analyse problems using input-process-output thinking, algorithms, pseudocode, and flowcharts.
 Design, code, test, debug, and document simple programs.
 Apply structured programming principles using sequence, selection, repetition, modules, procedures, and
functions.
 Use Visual Basic or a similar tool to build simple forms and event-driven applications.
 Explain software engineering principles, project management, data handling, implementation, testing,
quality, maintenance, and automated testing.

Recommended study method


1. Read the simplified explanation first.
2. Study the diagram or example before memorising definitions.
3. Practise the practical activity using a computer.
4. Write your own notes after each topic.
5. Answer the quick check questions without looking at the notes.
6. Build the mini project gradually as each topic is covered.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes

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.

UNIT 1: DATABASE TECHNOLOGY


Database technology is the study of how data is organised, stored, retrieved, protected, and maintained. It
begins with simple files and develops into relational databases that support modern information systems.

1.1 File Concepts

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.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
Simplified explanation
A file is a named collection of related data. In computing, files are used to store information such as student
details, sales transactions, reports, images, programs, or backups. Before database systems became
common, organisations stored data in separate files for each department. This was simple, but it often caused
duplication, inconsistency, poor security, and difficult sharing.

Figure 1: Data hierarchy from character to database.

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

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
Backup file Copy used for recovery Backup of student database
Report file Output file produced for users End-of-term results report
Short-term file used during
Temporary file Temporary import file
processing

File organisation methods


Method How it works Best use Limitation
Records are stored one Slow when searching for
Sequential Payroll or batch processing
after another in order one record
Records can be accessed
Requires good indexing or
Direct/Random directly using a Fast retrieval systems
addressing
key/address
Uses an index to locate
Indexed Student lookup by ID Index must be maintained
records quickly

File-based system versus database system


Area File-based system Database system
Separate files for different
Storage Related tables managed together
departments
Duplication High data redundancy Reduced redundancy
Sharing Difficult to share safely Designed for controlled sharing
Security Usually weak User roles, passwords, permissions
Data recovery Difficult if files are lost Backup and recovery tools available
Accounts keeps one student file while One central student table shared by
Example
exams keeps another authorised departments

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.

7. Open a spreadsheet or text editor.


8. Create fields: StudentID, FirstName, LastName, Gender, Programme, PhoneNumber.
9. Enter at least five student records.
10. Identify which part is a field, which part is a record, and which part is the file.
Prepared for Diploma in Computer Systems Engineering trainees
Programming and Databases - Detailed Study Module Notes
11. Explain two problems that may occur if this file is copied to many departments.

Quick check questions


12. Define a file in computing.
13. Differentiate between a field and a record.
14. List five types of files used in organisations.
15. Explain two limitations of traditional file processing.
16. Why do database systems reduce data inconsistency?

1.2 Entity Relationships

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.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
Figure 2: Simple ERD showing students, courses, and enrolments.

Entity and attribute examples


Entity Possible attributes
StudentID, FirstName, LastName, Gender, DateOfBirth,
Student
ProgrammeCode
LecturerID, FullName, DepartmentID, Email,
Lecturer
PhoneNumber
Course CourseID, CourseName, Level, CreditHours
Department DepartmentID, DepartmentName, HeadOfDepartment
Invoice InvoiceID, StudentID, Amount, DateIssued, Status

Keys in database design


Key type Meaning Example
Uniquely identifies each record in a
Primary key StudentID in Students table
table
Foreign key Links one table to another table StudentID in Enrolments table
A field that could become a primary
Candidate key NRC number or StudentID
key
StudentID + CourseID in a
Composite key A key made from two or more fields
registration table

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.

Business rule example


Business rule: A student can register for many courses. A course can be taken by many students.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
Database solution: Create a Student table, a Course table, and an Enrolment table. The Enrolment table
stores StudentID and CourseID as foreign keys.

Practical activity - Drawing an ERD for student registration: Follow the steps below and save your work as
evidence.

17. List the entities: Student, Course, Enrolment.


18. List at least four attributes for each entity.
19. Choose a primary key for each entity.
20. Show the foreign keys in the linking table.
21. Draw the relationships and label cardinality as one or many.

Quick check questions


22. What is an entity?
23. What is an attribute?
24. Differentiate between primary key and foreign key.
25. Give one example of a one-to-many relationship.
26. Why must a many-to-many relationship usually be broken into two one-to-many relationships?

1.3 Relational Database

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.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes

Figure 3: Relational schema showing primary and foreign keys.

Tables, rows, and columns


Database concept Meaning Example
Table Stores data about one entity Students table
Row/Record One complete item in a table One student
Column/Field One data item in each record StudentName
Data type Defines the kind of value stored Text, Number, Date, Boolean

Common data types


Data type Use Example
Text/String Letters, names, descriptions Mary Phiri
Number/Integer Whole numbers 25
Real/Float Decimal values 75.5
Date/Time Dates and times 2026-07-01
Boolean True/false values Active = True
Currency Money values K1500.00

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

Figure 4: SQL CRUD cycle for database operations.

Basic SQL examples


CREATE DATABASE CollegeDB;

CREATE TABLE Students (


StudentID INT PRIMARY KEY,
FirstName VARCHAR(50) NOT NULL,
LastName VARCHAR(50) NOT NULL,
Gender VARCHAR(10),
ProgrammeCode VARCHAR(20)
);

INSERT INTO Students (StudentID, FirstName, LastName, Gender, ProgrammeCode)


VALUES (1001, 'Mary', 'Phiri', 'Female', 'CSE');

SELECT StudentID, FirstName, LastName


FROM Students
WHERE ProgrammeCode = 'CSE';

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
UPDATE Students
SET ProgrammeCode = 'ICT'
WHERE StudentID = 1001;

DELETE FROM Students


WHERE StudentID = 1001;

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.

Normal form Simple rule Example


Each field should contain one value Do not store multiple phone numbers
First Normal Form (1NF)
only in one field
Every non-key field must depend on In a composite-key table, avoid fields
Second Normal Form (2NF)
the full primary key depending on only one part of the key
Store DepartmentName in
Non-key fields should not depend on
Third Normal Form (3NF) Department table, not repeatedly in
other non-key fields
Student table

Practical activity - Creating a student-course database: Follow the steps below and save your work as
evidence.

27. Create a database named CollegeDB.


28. Create Students, Courses, and Enrolments tables.
29. Use suitable data types and primary keys.
30. Create foreign keys in the Enrolments table.
31. Insert at least five student records and three course records.
32. Write SELECT queries to show all students registered for one course.
33. Generate a simple report showing student names and course names.
Prepared for Diploma in Computer Systems Engineering trainees
Programming and Databases - Detailed Study Module Notes
Quick check questions
34. Define a relational database.
35. Differentiate between a table and a record.
36. What is the purpose of a foreign key?
37. Write one SQL command used to retrieve data.
38. Why is normalisation important?

1.4 Database Administration

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.

Duties of a Database Administrator


Duty Explanation
Creates database structures, tables, relationships, and
Database creation
constraints.
Creates user accounts and controls who can access the
User management
database.
Creates backup copies and restores data when failure
Backup and recovery
occurs.
Security management Protects data from unauthorised access and attack.
Checks whether queries and database operations are
Performance monitoring
running efficiently.
Data integrity control Ensures data remains accurate and consistent.

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

Common database security threats


Threat Meaning Basic prevention
Someone accesses data without
Unauthorised access Passwords, roles, permissions
permission
Data disappears due to error or
Data loss Regular backups
failure
Malware Malicious software attacks the system Antivirus and safe downloads
Attacker inserts harmful SQL through
SQL injection Prepared statements and validation
forms
Hardware failure Storage or server device fails Backups, redundancy, maintenance

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.

Quick check questions


44. What is database administration?

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
45. List five duties of a DBA.
46. Differentiate between full and incremental backup.
47. What is an audit trail?
48. Mention three database security threats.

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.

2.1 Programming Languages

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.

Generations of programming languages


Generation Language type Simple explanation Example
Binary instructions directly
1st generation Machine language understood by the 10110000
computer
Uses short symbolic
2nd generation Assembly language MOV, ADD, SUB
instructions
Closer to human language C, Java, Python, Visual
3rd generation High-level languages
and easier to write Basic
Problem-oriented Focus on results with less
4th generation SQL, report generators
languages coding
5th generation AI/logic-based languages Used for artificial Prolog
intelligence and logic

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
problems

Types of programming approaches


Approach Meaning Example language/use
Program is organised as procedures
Procedural programming C, Pascal, Visual Basic procedures
and steps
Program is organised around
Object-oriented programming Java, C++, Python, [Link]
objects/classes
Code runs in response to events such
Event-driven programming Visual Basic forms
as clicks
Often used to automate tasks or build
Scripting JavaScript, PHP, Python scripts
web behaviour

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

Choosing a programming language


 Problem type: web, desktop, mobile, database, automation, or scientific computing.
 Platform: Windows, web browser, Android, server, or embedded device.
 Ease of use: beginner-friendly languages may be better for learning.
 Performance: some systems need faster compiled languages.
 Availability of tools: IDEs, frameworks, libraries, and database drivers.
 Community support: tutorials, documentation, and problem-solving support.

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.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
50. Identify where each language is commonly used.
51. State whether each is compiled, interpreted, or uses both processes.
52. Explain which one you would choose for a small student records system and why.

Quick check questions


53. Define a programming language.
54. Give four examples of programming languages.
55. Differentiate between low-level and high-level languages.
56. What is the difference between a compiler and an interpreter?
57. State three factors used when choosing a programming language.

2.2 Problem Analysis and Development of Programs

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.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
Figure 5: Input-Process-Output model for problem analysis.

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

IF finalMark >= 50 THEN


DISPLAY "Pass"
ELSE
DISPLAY "Fail"
ENDIF
STOP

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes

Figure 6: Flowchart for determining Pass or Fail.

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

Trace table example


Condition finalMark
caMark examMark finalMark Output
>= 50
20 25 45 False Fail
30 35 65 True Pass
40 10 50 True Pass

Practical activity - Algorithm and flowchart practice: Follow the steps below and save your work as evidence.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
67. Write an IPO table for calculating simple interest.
68. Write pseudocode for calculating simple interest using Principal, Rate, and Time.
69. Draw a flowchart for the same problem.
70. Create a trace table using three sets of sample data.
71. Explain any logic errors found during desk checking.

Quick check questions


72. What is problem analysis?
73. What does IPO stand for?
74. List five characteristics of a good algorithm.
75. What is the purpose of a trace table?
76. Why should logic be tested before coding?

2.3 Implementing a Programme Design

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.

Basic program structure


Section Purpose Example
Declaration section Defines variables and constants Dim total As Integer
Input section Receives data from the user Read CA mark and exam mark
Processing section Performs calculations or decisions finalMark = caMark + examMark
Output section Displays or stores results Display Pass or Fail

Variables and constants


Concept Meaning Example
A named memory location whose
Variable score = 70
value can change
Constant A named value that should not PASS_MARK = 50
Prepared for Diploma in Computer Systems Engineering trainees
Programming and Databases - Detailed Study Module Notes
change

Common data types


Data type Use Example
Integer Whole numbers 25
Real/Float/Double Decimal numbers 75.5
String Text "Mary"
Boolean True or false True
Date Date values 01/07/2026

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.

77. Write pseudocode for calculating the area of a rectangle.


78. Convert the pseudocode into code using Visual Basic or another selected language.
79. Test the program using length = 10 and width = 5.
80. Write another program to determine Pass or Fail.
81. Identify one syntax error, one runtime error, and one logic error from sample code.

Quick check questions


82. What is program implementation?
83. Differentiate between a variable and a constant.
84. Give four common data types.
85. What is a syntax error?
86. Why are comments useful in a program?

2.4 Structured Programming

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.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes

Figure 7: Core structures used in structured programming.

Features of structured programming


 Clear program logic.
 Top-down design from major tasks to smaller tasks.
 Modular design using procedures and functions.
 Limited unnecessary jumps or confusing control flow.
 Proper indentation.
 Meaningful names for variables and modules.
 Useful comments and documentation.

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

Procedures and functions


Concept Meaning Example
A named block of code that performs
Procedure ClearForm()
a task
A named block of code that returns a
Function CalculateFinalMark()
value
Variable used by a
Parameter mark in CalculateGrade(mark)
procedure/function to receive data
Actual value passed into a
Argument CalculateGrade(65)
procedure/function
Used only inside one
Local variable total inside CalculateTotal
procedure/function
Available to many parts of the
Global variable CurrentUserName
program

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.

Quick check questions


92. Define structured programming.
93. List the three main control structures.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
94. Differentiate between a procedure and a function.
95. What is the purpose of indentation?
96. Why is modular programming useful?

2.5 Visual Basic

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.

Figure 8: Example Visual Basic form for a student marks application.

Visual Basic interface


Part Purpose

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
Toolbox Contains controls such as buttons, labels, and textboxes.
Form designer Area where the user interface is designed.
Used to set properties such as Name, Text, Size, and
Properties window
Colour.
Code window Used to write program code.
Project explorer Shows forms, modules, and files in the project.

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.

Properties, methods, and events


Concept Meaning Example
Property Describes a control or object [Link], [Link]
Method An action performed by an object [Link](), [Link]()
Something that happens and triggers
Event Button Click, Form Load
code

Event-driven code example


Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles
[Link]
Dim caMark As Integer
Dim examMark As Integer
Dim finalMark As Integer

caMark = CInt([Link])
examMark = CInt([Link])
finalMark = caMark + examMark

[Link] = [Link]()

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
If finalMark >= 50 Then
[Link] = "Pass"
Else
[Link] = "Fail"
End If
End Sub

Simple database application functions


Function Purpose
Add Insert a new record into the database.
Search Find an existing record.
Update Modify existing information.
Delete Remove an unwanted record.
Report Display or print organised information.

Practical activity - Creating a Visual Basic marks form: Follow the steps below and save your work as
evidence.

97. Create a new Visual Basic Windows Forms project.


98. Design a form with labels and textboxes for Student Name, CA Mark, Exam Mark, Final Mark, and Result.
99. Add buttons for Calculate, Clear, Save, and Exit.
100. Write code for the Calculate button.
101. Test the form using three students with different marks.
102. Improve the form by preventing empty marks or marks outside the valid range.

Quick check questions


103. What is Visual Basic?
104. What is event-driven programming?
105. Differentiate between a property and a method.
106. Give five examples of Visual Basic controls.
107. What database functions should a simple student records application have?

UNIT 3: SOFTWARE ENGINEERING


Software engineering is the professional approach to developing software systems. It is wider than
programming because it includes requirements, design, project management, data, coding, implementation,
testing, quality, maintenance, documentation, and ethics.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes

Figure 9: Software development lifecycle.

3.1 Principles of Software Engineering

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.

Programming versus software engineering


Area Programming Software engineering
Building complete software systems
Main focus Writing code
professionally
Scope Usually narrower Covers requirements, design, coding,

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
testing, deployment, and
maintenance
Documentation May be limited Requires formal documentation
Teamwork Can be individual Usually involves teams and roles
Uses testing, reviews, standards, and
Quality control May depend on programmer
user feedback

Qualities of good software


Quality Meaning
Correctness The software does what it is supposed to do.
Reliability The software works consistently without frequent failure.
Efficiency The software uses time, memory, and resources well.
Usability Users can understand and operate it easily.
Maintainability It can be corrected, updated, and improved easily.
Portability It can run on different platforms with minimal changes.
Security It protects data and system functions from misuse.

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.

Quick check questions


112. Define software engineering.
113. Why is software engineering important?
114. Differentiate between programming and software engineering.
115. List five qualities of good software.
116. Give two reasons why software projects fail.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
3.2 Software Project Management

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

Project planning activities


 Define the problem and project objectives.
 Identify stakeholders and users.
 List system requirements.
 Break work into smaller tasks using a Work Breakdown Structure.
 Prepare a schedule.
 Assign resources and responsibilities.
 Identify risks and mitigation actions.
 Monitor progress and document changes.

Project team roles


Role Main responsibility
Project manager Plans and controls the project.
Systems analyst Studies user needs and requirements.
Programmer Writes system code.
Database administrator Designs and manages the database.
Tester Checks whether the system works correctly.
Prepared for Diploma in Computer Systems Engineering trainees
Programming and Databases - Detailed Study Module Notes

User representative Provides user feedback and confirms requirements.

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.

117. Choose a small system such as Student Records Management System.


118. Write the project objective.
119. List five major features.
120. Identify team roles required.
121. Create a two-month schedule with tasks and dates.
122. Identify at least five project risks and how to reduce them.

Quick check questions


123. What is software project management?
124. List four project constraints.
125. What is a Work Breakdown Structure?
126. Give four software project team roles.
127. Why is risk management important?

3.3 Languages in Software Engineering

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

Create the user interface that users


Front-end languages HTML, CSS, JavaScript
see
Process server-side logic and
Back-end languages PHP, Python, Java, C#
business rules
Create, retrieve, update, and delete
Database query languages SQL
data
Automate tasks or add dynamic
Scripting languages JavaScript, Python, PHP
behaviour
Structure content rather than perform
Markup languages HTML, XML
calculations

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.

128. Choose a system, for example an online admissions portal.


129. Identify front-end technologies needed.
130. Identify back-end language options.
131. Identify the database query language.
132. Choose one IDE and one version control tool.
133. Explain why your language choices are suitable.

Quick check questions


134. Why does language choice matter in software engineering?
135. Differentiate between front-end and back-end languages.
136. What is SQL used for?

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
137. What is an IDE?
138. Why is version control important?

3.4 Data in Software Engineering

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 activities in software systems


Activity Meaning Example
Capturing data from users or other Registration form collects student
Data collection
sources details
Data validation Checking data before saving Phone number must have valid digits
Data storage Saving data in files or databases Students table
Calculating, sorting, filtering, or
Data processing Calculate final mark
transforming data
Data output Displaying reports or results Class performance report

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

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
Type check Data must match expected type Mark must be numeric
Range check Value must be within a valid range CA mark must be 0 to 40
Value must have correct number of
Length check Phone number length
characters
Format check Value must follow a pattern Email must contain @
Lookup check Value must exist in a list/table ProgrammeCode must exist

Sample data dictionary


Field name Data type Size Validation Description
Identifies each
StudentID Integer - Required, unique
student
FirstName Text 50 Required Student first name
LastName Text 50 Required Student surname
Gender Text 10 Male/Female/Other Student gender
Must exist in Programme enrolled
ProgrammeCode Text 20
Programme table in

Practical activity - Data dictionary for registration form: Follow the steps below and save your work as
evidence.

139. Design a student registration form with at least eight fields.


140. Create a data dictionary for the fields.
141. State data type, size, validation rule, and description for each field.
142. Identify which fields should be required.
143. Explain how the data will be stored and protected.

Quick check questions


144. Why is data important in software engineering?
145. What is data validation?
146. Give three examples of validation rules.
147. What is a data dictionary?
148. Differentiate between a record and a table.

3.5 Software Implementation

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.

149. Choose a small system such as a library system.


150. List installation requirements.
151. Choose one changeover method and justify it.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
152. Prepare a user training plan.
153. List possible implementation risks and mitigation actions.

Quick check questions


154. What is software implementation?
155. List four implementation activities.
156. Differentiate between direct and parallel changeover.
157. What is data migration?
158. Why is user training important?

3.6 Software Testing

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.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
Figure 10: Software testing levels and test data types.

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.

Test case example: login form


Test ID Test data Expected result Actual result Status
Correct username To be filled during
TC01 Login successful Pass/Fail
and password testing
Correct username, Error message To be filled during
TC02 Pass/Fail
wrong password displayed testing
Blank username and Validation message To be filled during
TC03 Pass/Fail
password displayed testing
System handles input To be filled during
TC04 Very long username Pass/Fail
safely testing

Testing versus debugging


Activity Meaning
Testing Finding whether defects exist by running checks.
Debugging Finding the cause of a defect and correcting it.

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.

Quick check questions


164. Define software testing.
165. List four testing levels.
166. Differentiate between black-box and white-box testing.
167. What is a test case?
168. Differentiate between testing and debugging.

3.7 Software Quality

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 assurance versus quality control


Concept Meaning Example
Prevents defects by improving the Coding standards, design reviews,
Quality assurance
development process documented procedures
Quality control Detects defects in the product Testing, code review, interface review

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?

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
Can a programmer understand the
Maintainability Easy to update
code?

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.

169. Choose a simple system interface such as a login form.


170. Check labels, button names, validation messages, and layout.
171. Check whether errors are handled politely.
172. Check whether required fields are clearly marked.
173. Prepare a checklist with at least ten quality items.

Quick check questions


174. What is software quality?
175. Differentiate between quality assurance and quality control.
176. List five software quality factors.
177. What is code review?
178. Why is user feedback important?

3.8 Software Maintenance

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.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
Simplified explanation
Software maintenance is the modification of software after delivery. Maintenance may fix faults, adapt the
system to new conditions, improve performance or usability, or prevent future problems. Most software needs
maintenance because user needs, laws, hardware, operating systems, and security threats change over time.

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.

Sample maintenance log


Date Issue/request Type Action taken Status
Search by StudentID
2026-07-01 Corrective Fixed query condition Closed
not working
Added report export
2026-07-03 Add export to PDF Perfective Testing
button
Update database Enforced stronger
2026-07-05 Preventive Closed
password policy passwords

Practical activity - Maintenance planning: Follow the steps below and save your work as evidence.

179. Read three user complaints about a student records system.


180. Classify each complaint as corrective, adaptive, perfective, or preventive maintenance.
181. Create a maintenance log.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
182. Suggest testing needed after each change.
183. Explain how version control would help.

Quick check questions


184. What is software maintenance?
185. List the four types of maintenance.
186. Give one example of corrective maintenance.
187. Why should maintenance be documented?
188. How does version control support maintenance?

3.9 Automated Testing

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.

Figure 11: Basic automated testing process.


Prepared for Diploma in Computer Systems Engineering trainees
Programming and Databases - Detailed Study Module Notes
Manual testing versus automated testing
Area Manual testing Automated testing
Execution Human tester performs steps Tool runs test scripts
Speed Slower for repeated tests Fast once scripts are created
Cost at start Lower setup cost Higher setup cost
Best use Exploratory, usability, new features Repeated, stable, regression tests
Limitation Can be inconsistent and slow Scripts require maintenance

Benefits and limitations


Benefits Limitations
Fast execution of repeated tests Initial setup takes time
Same steps can be repeated accurately Automated tests may fail if interface changes
Useful for regression testing Not suitable for all usability checks
Can run many tests frequently Requires tool knowledge

Common automated testing tools


Tool Common use
Selenium Automated web browser testing
JUnit Java unit testing
NUnit .NET unit testing
PHPUnit PHP unit testing
Visual Studio testing tools Testing .NET/Visual Studio projects

Simple automated test logic example


TEST: Login with valid credentials
Open login page
Type valid username
Type valid password
Click Login button
Check that dashboard page is displayed
If dashboard is displayed, mark test as PASS
Otherwise, mark test as FAIL

Practical activity - Automated test planning: Follow the steps below and save your work as evidence.

189. Choose a login form or registration form.


190. List five test cases that are repeated often.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
191. Decide which tests are suitable for automation.
192. Write simple test steps for one automated test.
193. Explain what result would indicate pass or fail.

Quick check questions


194. What is automated testing?
195. Differentiate between manual and automated testing.
196. List three benefits of automated testing.
197. Mention two limitations of automated testing.
198. Name three automated testing tools.

Recommended Practical Mini Project

Project title: Student Records Management System


This mini project combines database design, entity relationships, relational tables, SQL queries, Visual Basic
forms, structured programming, testing, debugging, documentation, and maintenance planning.

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 database tables


Table Purpose Main fields
UserID, Username, PasswordHash,
Users Stores login accounts
Role
StudentID, FirstName, LastName,
Students Stores student details
Gender, Phone, ProgrammeCode
CourseID, CourseName, Level,
Courses Stores course details
Credits
Registrations Links students to courses RegistrationID, StudentID, CourseID,
Prepared for Diploma in Computer Systems Engineering trainees
Programming and Databases - Detailed Study Module Notes
AcademicYear
MarkID, StudentID, CourseID, CA,
Marks Stores marks
Exam, FinalMark, Result

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

Project development stages


209. Analyse requirements and write the problem statement.
210. Draw the ERD and identify all keys.
211. Create relational tables using SQL.
212. Design Visual Basic forms.
213. Write event-driven code for buttons and form actions.
214. Connect forms to the database.
215. Implement add, search, update, delete, and report functions.
216. Test each form and database operation.
217. Prepare test report, user guide, and maintenance plan.
218. Present the system and explain design decisions.

Mini project assessment checklist


Area Checklist item
Tables have correct primary keys, foreign keys, and data
Database design
types.
ERD Entities, attributes, cardinality, and relationships are clear.
SQL Insert, select, update, delete, and report queries work.
Programming Code is structured, readable, and documented.
Forms Interface is clear and uses appropriate controls.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
Testing Test cases, test data, and results are recorded.
Security Login and basic permissions are included.
Backup Database backup procedure is demonstrated.
Documentation User guide and technical notes are prepared.
Student explains design, code, testing, and maintenance
Presentation
clearly.

Comprehensive Revision Questions

Unit 1: Database Technology


219. Define data, information, field, record, file, and database.
220. Explain five types of files used in organisations.
221. Differentiate between sequential, direct, and indexed file organisation.
222. Explain four limitations of file-based systems.
223. Define entity, attribute, primary key, and foreign key.
224. Give examples of one-to-one, one-to-many, and many-to-many relationships.
225. Explain why many-to-many relationships require a linking table.
226. Define a relational database.
227. Explain entity integrity, referential integrity, and domain integrity.
228. Write SQL statements to create, insert, select, update, and delete records.
229. Explain the purpose of database normalisation.
230. Describe the duties of a database administrator.
231. Differentiate between full, incremental, and differential backups.
232. Explain three database security threats and how to reduce them.

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.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
243. Explain sequence, selection, and repetition structures.
244. Differentiate between a procedure and a function.
245. Explain event-driven programming.
246. Describe five Visual Basic controls and their uses.

Unit 3: Software Engineering


247. Define software engineering.
248. Differentiate between programming and software engineering.
249. List and explain six qualities of good software.
250. Explain software project constraints.
251. Identify roles in a software development team.
252. Differentiate between front-end, back-end, scripting, markup, and database query languages.
253. Explain data validation and give examples.
254. Create a simple data dictionary for a student registration form.
255. Explain direct, parallel, phased, and pilot changeover methods.
256. Define software testing and explain its importance.
257. Differentiate between unit, integration, system, and acceptance testing.
258. Differentiate between quality assurance and quality control.
259. Explain four types of software maintenance.
260. Explain automated testing and identify suitable test cases for automation.

Glossary of Key Terms


Term Meaning
Algorithm A step-by-step procedure for solving a problem.
Attribute A data item that describes an entity.
Automated testing Testing performed by software tools using scripts.
Backup A copy of data kept for recovery.
The number of records that may participate in a
Cardinality
relationship.
A translator that converts a whole program before
Compiler
execution.
A collection of related data organised for easy access and
Database
management.
A person responsible for managing and protecting
Database administrator
databases.
Debugging Finding and correcting errors in a program.
Entity Something about which data is stored.
Foreign key A field used to link one table to another.

Prepared for Diploma in Computer Systems Engineering trainees


Programming and Databases - Detailed Study Module Notes
Interpreter A translator that executes code line by line.
Organising database tables to reduce redundancy and
Normalisation
improve integrity.
Primary key A field that uniquely identifies each record.
Pseudocode A human-readable way of writing program logic.
Testing to ensure new changes have not broken existing
Regression testing
functions.
A disciplined approach to developing and maintaining
Software engineering
software.
Programming using clear control structures and modular
Structured programming
design.
A table used to manually test the values of variables step
Trace table
by step.
Validation Checking data before accepting or storing it.

Prepared for Diploma in Computer Systems Engineering trainees

You might also like