ZNOTES.
ORG logo
ALIGNED WITH THE 2023-2025 SYLLABUS
CAIE IGCSE
COMPUTER SCIENCE (0478)
COMPUTER SCIENCE (0478)
PRACTICAL
Authorised for personal use only by Monica Kunda at Atlantic Study Center generated on 28/10/2025
CAIE IGCSE COMPUTER SCIENCE
The program or set of programs is developed based on the
1. Algorithm Design & design.
Each module of the program is written using a suitable
Problem-Solving programming language.
Testing is conducted to ensure that each module functions
correctly.
1.1. Program Development Life Cycle Iterative testing is performed, which involves conducting
(PDLC) modular tests, making code amendments if necessary, and
repeating tests until the module meets the required
functionality.
Analysis
Design
Coding
Testing
Testing
The completed program or set of programs is executed
Maintenance
multiple times using various test data sets.
This testing process ensures that all the tasks within the
Analysis
program work together as specified in the program design.
Running the program with di!erent test data can identify
Before solving a problem, it is essential to define and
and address potential issues and errors.
document the problem clearly, known as the "requirements
The testing phase aims to verify the overall functionality
specification" for the program.
and performance of the program by evaluating its
The analysis stage involves using tools like abstraction and
behaviour with various inputs.
decomposition to identify the specific requirements for the
program.
Abstraction focuses on the essential elements needed for 1.2. Structure Diagrams
the solution while eliminating unnecessary details and
information. Every computer system is made up of sub-systems, which
Decomposition involves breaking down complex problems are in turn made up of further sub-systems.
into smaller, more manageable parts that can be solved Structure Diagrams – The breaking down of a computer
individually. system into sub-systems, then breaking each sub-system
Daily tasks can be decomposed into constituent parts for into smaller sub-systems until each one only performs a
easier understanding and solving. single action. A structure diagram diagrammatically
represents a top-down design. Example below.
Design
The program specification derived from the analysis stage is
used as a guide for program development.
During the design stage, the programmer should clearly
understand the tasks to be completed, the methods for
performing each task, and how the tasks will work together.
Documentation methods such as structure charts,
flowcharts, and pseudocode can be used to document the
program's design formally.
1.3. Pseudocode & Flowcharts
Coding and iterative testing
Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.
[Link] This document is authorised for personal use only by Monica at Atlantic Study Center on 28/10/25.
CAIE IGCSE COMPUTER SCIENCE
Pseudocode - Verbal representation of an algorithm (a Declaration & Usage of Variables & Constants
process or set of steps) and flowcharts are a diagrammatic Variable – Store of data which changes during execution
representation. of the program (due to user input)
Flowcharts: A flowchart shows diagrammatically the steps Constant – Store of data that remains the same during
required to complete a task and the order that they are to the execution of the program
be performed Basic Data Types
Algorithm: These steps, together with the order, are called Integer – Whole Number e.g. 2; 8; 100
an algorithm Real – Decimal Number e.g. 7.00; 5.64
Char – Single Character e.g. ‘a’; ‘Y’
String – Multiple Characters (Text) e.g. “ZNotes”; “COOL”
Boolean – Only 2 Values e.g. True/False; Yes/No; 0/1
Input & Output (READ & PRINT) – Used to receive and
display data to the user respectively. (It is recommended to
use input and output commands)
INPUT Name
OUTPUT "Hello Mr." , Name
// Alternatively //
READ Name
PRINT "Hello Mr," , Name
An example of a flowchart is given below from a past paper
Declaration of variable - A variable/constant can be
question in which all of the functions of a flowchart are shown:
declared by the following manner
DECLARE [Variable Name] : [DATATYPE OF VARIABLE]
Array: Array is similar to variable but it can store multiple
values of same datatype under single name
DECLARE [ARRAYNAME] : ARRAY [Lower Limit : Upper Limit ]
Assignment - Each variable is assigned using a left arrow.
[VARIABLE NAME] <---- [Value to be assigned]
ArrayName [IndexValue] <---- [Value to be assigned]
Conditional Statements:
IF…THEN…ELSE…ENDIF
This flowchart’s task is to check if a rider’s height is more the
requirement (1.2) in this case. It then counts until the accepted
riders are 8. After they are 8, it outputs the number of rejected
riders and tells the rest that they are ready to go!
2. Pseudocode
Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.
[Link] This document is authorised for personal use only by Monica at Atlantic Study Center on 28/10/25.
CAIE IGCSE COMPUTER SCIENCE
Loop Structures:
FOR…TO…NEXT : Will run for a determined/known amou
REPEAT… UNTIL – Will run at least once till condition is
satisfied; Verification is done after running code
CASE…OF…OTHERWISE…ENDCASE – Multiple conditions and
corresponding consequences \n
WHILE…DO…ENDWHILE – May not ever run; Verification is
done before running code
Note: When using conditions in these loop structures and
conditional statement, it has to be kept in mind that it can
be done in two ways.
1. use of a Boolean variable that can have the value
TRUE or FALSE
2. comparisons made by using coparison operators,
where comparisons are made from left to right
IF [BOOLEAN VARIABLE]
THEN
OUTCOME
ELSE
OUTCOME
ENDIF
IF ((CONDITION 1) OR ( CONDITION 2)) AND (CONDITION 3) A
THEN
OUTCOME
ELSE
OUTCOME
ENDIF
Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.
[Link] This document is authorised for personal use only by Monica at Atlantic Study Center on 28/10/25.
CAIE IGCSE COMPUTER SCIENCE
MaxiumumValue <--- Array[1] MinimumValue <--- Array[1]
2.1. FOR Counter ← 2 TO LoopLimit
IF Array[Counter] > MaximumValue
THEN
MaximumValue ← Array[Counter]
ENDIF
IF Array[Counter] < MinimumValue
THEN
MinimumValue ← Array[Counter]
ENDIF
NEXT Counter
// Average//
Total ← 0
2.2. Standard methods used in algorithm: FOR Counter ← 1 TO NumberOfValues
Total ← Total + StudentMark[Counter]
Totalling :Totalling means keeping a total that values are NEXT Counter
added to Average ← Total / NumberOfValues
Total ← 0 Linear Search: In a linear search, each item in the list is
FOR Counter ← 1 TO LoopLimit inspected sequentially until a match is found or the entire
Total ← Total + ValueToBeTotalled list is traversed.
NEXT Counter
Counting: Keeping a count of the number of times an action INPUT Value
is performed is another standard method. Found ← FALSE
Counter ← 0
PassCount ← 0 REPEAT
FOR Counter ← 1 TO LoopLimit IF Value = Array[Counter]
INPUT Value THEN
IF Value > Range Found ← TRUE
THEN ELSE
PassCount ← PassCount + 1 Counter ← Counter + 1
ENDIF ENDIF
NEXT Counter UNTIL Found OR Counter > NumberOfValues
IF Found
Maximum, minimum and average : Finding the largest and THEN
smallest values in a list are two standard methods that are OUTPUT Value , " found at position " , Counter, " in t
frequently found in algorithms ELSE
OUTPUT Value , " not found."
ENDIF
Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.
[Link] This document is authorised for personal use only by Monica at Atlantic Study Center on 28/10/25.
CAIE IGCSE COMPUTER SCIENCE
Bubble Sort: Iteratively compare and swap adjacent Length check
elements in a list to sort them. Start from the first element
and continue until the second-to-last element. After each This can either ensure that data consists of a precise number
pass, the last element is in its correct place. However, other of characters.
elements may still be unsorted. Repeat the process,
excluding the last element, until only one element remains OUTPUT "Please enter your value of ", Limit , " charact
or no swaps are needed. REPEAT
INPUT Value
First ← 1 IF LENGTH(Value) <> Limit
Last ← 10 THEN
REPEAT OUTPUT "Your value must be exactly" , Limit ," charact
Swap ← FALSE ENDIF
FOR Index ← First TO Last - 1 UNTIL LENGTH(Value) = Limit
IF Array[Index] > Array[Index + 1]
THEN It can also check if the data entered is a reasonable number of
Temp ← Array[Index] characters or not
Array[Index] ← Array[Index + 1]
Array[Index + 1] ← Temp OUTPUT "Please enter your value "
Swap ← TRUE REPEAT
ENDIF INPUT Value
NEXT Index IF LENGTH(Value) > UpperLimit OR LENGTH(Value) < LowerL
Last ← Last - 1 THEN
UNTIL (NOT Swap) OR Last = 1 OUTPUT "Too short or too long, please re-enter "
ENDIF
UNTIL LENGTH(Value) <= UpperLimit AND LENGTH(Value) >= L
2.3. Validation and Verification
Type check
To ensure the acceptance of reasonable and accurate data
inputs, computer systems must thoroughly examine each data A type check verifies that the entered data corresponds to a
item before accepting it, and this is where Validation and specific data type.
Verification come into play!
OUTPUT "Enter the value "
Validation REPEAT
INPUT Value
Validation in computer systems involves automated checks to IF Value <> DIV(Value, 1)
ensure the reasonableness of data before accepting it. If the THEN
data is invalid, the system should provide an explanatory OUTPUT "This must be a whole number, please re-enter"
message for rejection and allow another chance to enter the ENDIF
data. UNTIL Value = DIV(Value, 1)
There are multiple types of validation. These include:
Range check Presence check
A range check verifies that a numerical value falls within
specified upper and lower limits. A presence check checks to ensure that some data has been
entered and the value has not been left blank
REPEAT
INPUT Value OUTPUT "Please enter the value "
IF Value < MinimumValue OR Value > MaximumValue REPEAT
THEN INPUT Value
IF Value = ,"
OUTPUT "The student's mark should be in the range", MinimumValue "" to ", MaximumValue
ENDIF THEN
UNTIL Value >= MinimumValue AND Value <= MaximumValue OUTPUT "*=Required "
ENDIF
UNTIL Value <> ""
Format Check
Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.
[Link] This document is authorised for personal use only by Monica at Atlantic Study Center on 28/10/25.
CAIE IGCSE COMPUTER SCIENCE
A format check checks that the characters entered conform to
a pre-defined pattern. 3.2. Abnormal Data
Check Digit Test data that would be rejected by the solution as not
suitable, if the solution is working properly is called
A check digit is the final digit included in a code; it is
abnormal test data / erroneous test data.
calculated from all the other digits.
e.g. in a program where only whole number values ranging
Check digits are used for barcodes, product codes,
from 0 to 100 (inclusive) are accepted, abnormal data will
International Standard Book Numbers (ISBN), and Vehicle
be: -1, 151, 200, 67.2, “Sixty-Two” and -520
Identification Numbers (VIN).
Verification 3.3. Extreme Data
Verification is checking that data has been accurately copied Extreme data are the largest and smallest values that
from one source to another normal data can take
There are 2 methods to verify data during entry ( there are e.g. in a program where only whole number values ranging
other methods during data transfer, but they are in paper 1) from 0 to 100 (inclusive) are accepted, extreme data will be:
0 and 100
1. Double Entry
3.4. Boundary Data
Data is inputted twice, potentially by di!erent operators.
The computer system compares both entries and if they
This is used to establish where the largest and smallest
di!er, an error message is displayed, prompting the data to
values occur
be reentered.
At each boundary two values are required: one value is
accepted and the other value is rejected.
2. Screen/Visual check
e.g. in a program where only whole number values ranging
from 0 to 100 (inclusive) are accepted, one example of
A screen/visual check involves the user manually reviewing
boundary data will be: 100 and 101. 100 will be accepted
the entered data.
and 101 will not be accepted
After data entry, the system displays the data on the screen
and prompts the user to confirm its accuracy before
proceeding.
The user can compare the displayed data against a paper
4. Trace Table
document used as an input form or rely on their own
A trace table is utilized to document the outcomes of every
knowledge to verify correctness.
step in an algorithm. It is employed to record the variable's
value each time it undergoes a change.
3. Test Data A dry run refers to the manual process of systematically
executing an algorithm by following each step in sequence.
A trace table is set up with a column for each variable and a
Test data refers to input values used to evaluate and assess
column for any output e.g.
the functionality and performance of a computer program
or system.
It helps identify errors and assess how the program handles
di!erent scenarios
3.1. Normal Data
Normal data is the test data which accepts values in
acceptible range of values of the program Test data is employed to execute a dry run of the flowchart and
Normal data should be used to work through the solution document the outcomes in a trace table. During the dry run:
to find the actual result(s) and see if they are the same as
the expected result(s)
e.g. in a program where only whole number values ranging
from 0 to 100 (inclusive) are accepted, normal test data will
be : 23, 54, 64 , 2 and 100
Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.
[Link] This document is authorised for personal use only by Monica at Atlantic Study Center on 28/10/25.
CAIE IGCSE COMPUTER SCIENCE
The ability to write an algorithm is very important for this
Whenever a variable's value changes, the new value is syllabus and paper. Some key steps/points to be known in-
recorded in the respective column of the trace table. order to write the perfect algorithm are as follows:
Each time a value is outputted, it is displayed in the output
column. 1. Make sure that the problem is clearly understood which
includes knowing the purpose of the algorithm and the
An example of trace table is given below using a past paper tasks to be completed by the algorithm.
question: 2. Break the problem into smaller problems (e.g. in a
Q: The flowchart below inputs the height of children who want program which outputs average values, divide the
to ride on a rollercoaster. Children under 1.2 metres are problem into multiple ones i.e. how to count the
rejected. The ride starts when eight children have been number of iterations and how to count the total of all
accepted. values)
3. Identify the data that is needed to be saved into
variables/constants/arrays and what datatype it is, and
declare all the variables/constants/arrays accordingly,
with meaningfull names
4. Decide on how you are going to construct your
algorithm, either using a flowchart or pseudocode. If
you are told how to construct your algorithm, then
follow the guidance.
5. Construct your algorithm, making sure that it can be
easily read and understood by someone else. Take
particular care with syntax e.g. when conditions are
used for loops and selection.
6. Use several sets of test data (Normal, Abnormal and
Boundary) to dry run your algorithm and check if the
Complete the trace table for the input data: 1.4, 1.3, 1.1, 1.3,
expected results are achieved (a trace table can be used
1.0, 1.5, 1.2, 1.3, 1.4, 1.3, 0.9, 1.5, 1.6, 1.0
Riders Reject Height OUTPUT
for this purpose) . If error is found, find the point of
0 0 error in the trace table and fix it in the code.
1 1.4
2 1.3
1 1.1 Note: The algorithms that you have looked at so far in these
3 1.3 notes were not designed with readability in mind because you
2 1.0
4 1.5 needed to work out what the problem being solved was.
3 1.2
5 1.3
6
7
4
1.4
1.3
0.9
6. Programming
8 1.5 Ready to go 4
6.1. Programming Languages
4.1. Identifying errors:
There are many high-level programming languages to
Trace tables can be used to trace errors in a program. For choose from. We will only be treating Python, Visual Basic,
example, if the requirement for the previous question or Java.
would be to accept riders that are of height 1.2 too, rather
than rejecting them, then the error would have been caught
in the trace table as when 1.2 is entered, it would increment
rejected which it shouldn’t in our example
5. How to write an algorithm?
Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.
[Link] This document is authorised for personal use only by Monica at Atlantic Study Center on 28/10/25.
CAIE IGCSE COMPUTER SCIENCE
Python is an open-source, versatile programming language Input and Output
that encourages quick program development and
emphasises code readability. The integrated development Programs require input and output statements to handle
environment (IDE) showcased in this chapter is referred to data.
as IDLE. In IGCSE Computer Science, algorithms and programs are
Visual Basic is a popular programming language that is designed to take input from a keyboard and output to a
extensively used for Windows development. The integrated screen.
development environment (IDE) featured in this chapter is Prompting the user with clear instructions for input is
known as Visual Studio, which is utilised for capturing necessary for the user to understand what is expected.
screenshots. Input data in programming languages must match the
Java is a widely adopted programming language utilised by required data type of the variable where it will be stored.
numerous developers. The integrated development By default, inputs are treated as strings, but commands can
environment (IDE) employed for capturing screenshots in convert input to integer or real number data types.
this chapter is known as BlueJ. Users should be provided with information about the
output/results for a program to be useful.
6.2. Programming Concepts Each output should be accompanied by a message
explaining the result's meaning or significance.
If an output statement has multiple parts, they can be
Constructs of a Program
separated by a separator character.
Data use – variables, constants and arrays
Sequence – order of steps in a task 6.3. Basic Concepts
Selection – choosing a path through a program
Iteration – repetition of a sequence of steps in a program When writing the steps required to solve a problem, the
Operators use arithmetic for calculations and logic and following concepts need to be used and understood:
Boolean for decisions.
Sequence
Variables and Constants Selection
Iteration
A variable within a computer program refers to a named Counting and totalling
storage unit with a value that can be modified throughout String handling
the program's execution. To enhance comprehension for Use of operators.
others, it is advisable to assign significant names to
variables. Sequence
A constant within a computer program represents a
named storage unit that holds a value which remains The ordering of the steps in an algorithm is very important. An
unchanged throughout the program's execution. Similar to incorrect order can lead to incorrect results and/or extra steps
variables, it is recommended to assign meaningful names that are not required by the task.
to constants to enhance comprehensibility for others.
Selection
Data Types
Selection is a very useful technique, allowing di!erent routes
Di!erent data types are assigned to computer systems for through the steps of a program. The code of this is explained in
e!ective processing and storage. the notes of previous chapters.
Data types allow data, such as numbers or characters, to be
stored appropriately. Iteration
Data types enable e!ective manipulation using
mathematical operators for numbers and character As explained in the previous chapter, we already
concatenation.
Some data types provide automatic validation. Totalling and Counting
The types of datatypes are told in Chapter 1 already!
As explained in the previous chapter, we already
String Handling
Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.
[Link] This document is authorised for personal use only by Monica at Atlantic Study Center on 28/10/25.
CAIE IGCSE COMPUTER SCIENCE
Strings are used to store text and can contain various Procedures and Functions
characters.
An empty string has no characters, while the programming Procedures and functions are defined at the start of the code.
language specifies the maximum number of characters
allowed. A procedure refers to a collection of programming
Characters in a string can be identified by their position statements organized under a single name, invoked at any
number, starting from either zero or one, depending on the given point in a program to execute a specific task.
programming language. A function is a compilation of programming statements
String handling is an important aspect of programming. consolidated under a singular name, invoked at any
In IGCSE Computer Science, you will need to write moment within a program to accomplish a particular task.
algorithms and programs for the following string methods: Unlike a procedure, a function also has the capability to
Length: Determines the number of characters in a return a value back to the main program.
string, including spaces. Parameters refer to variables that store the values of
Substring: Extracts a portion of a string. arguments passed to a procedure or function. While not all
Upper: Converts all letters in a string to uppercase. procedures and functions require parameters, some utilize
Lower: Converts all letters in a string to lowercase. them to facilitate their operations.
These string manipulation methods are commonly provided
in programming languages through library routines. Procedures without parameters:
Finding the length of a string: PROCEDURE ProcedureName ()
[Commands]
LENGTH("Text Here") ENDPROCEDURE
//Calling/running the procedure
LENGTH(Variable) CALL ProcedureName()
Extracting a substring from a string: The procedure with parameters:
SUBSTRING("Computer Science", 10, 7) PROCEDURE ProcedureName (ParameterName : ParameterDataty
// returns the next 7 values starting from the 10th value[Commands]
of the string "Computer Science" i.e. "Science"
SUBSTRING(Variable, Position, Length) ENDPROCEDURE
//Calling/running the procedure
Converting a string to upper case CALL ProcedureName (ParameterValue)
UCASE("Text here") Function:
UCASE(Variable) FUNCTION FunctionName (ParameterName : ParameterDatatype
[Commands]
Converting a string to lowercase RETURN ValueToBeReturned
ENDFUNCTION
LCASE("Text Here")
When defining procedures and functions, the header is the
LCASE(Variable) first statement in the definition.
The header includes:
Arithmetic, Logical and Boolean Operators The name of the procedure or function.
Parameters passed to the procedure or function, along
As explained in the previous chapter, we already with their data types.
The data type of the return value for a function.
Use of Nested Statements Procedure calls are standalone statements.
Function calls are made as part of an expression, typically
Selection and iteration statements can be nested, meaning on the right-hand side.
one statement can be placed inside another.
Nested statements help reduce code duplication and Local and Global Variable
simplify testing of programs.
Di!erent types of constructs can be nested within each
other, such as selection statements within condition-
controlled loops or loops within other loops.
Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.
[Link] This document is authorised for personal use only by Monica at Atlantic Study Center on 28/10/25.
CAIE IGCSE COMPUTER SCIENCE
Any part of a program can use a global variable – its scope // Now the text written is commented and thus ignored
covers the whole program
A local variable can only be used by the part of the program ""
it is declared in – its scope is restricted to that part of the This method can also be used to comment
program. multiple lines but the singular line method
is more widely accepted and reccomended too
Note: Any variables/arrays made in this procedure and ""
functions will be local and cannot be used out of these. To
be made available all over the program, they must be
declared globally in the following way.
6.6. Arrays
DECLARE [VariableName] : DataType AS GLOBAL An array is a data structure containing several elements of
the same data type; these elements can be accessed using
6.4. Library Routines the same identifier name.
The position of each element in an array is identified using
the array’s index.
Programming language development systems often provide
There are two types of arrays
library routines that can be readily incorporated into
programs.
One-Dimensional Array
Library routines are pre-tested and ready for use, making
programming tasks easier.
Explained in the previous chapter in detail
Integrated Development Environments (IDEs) typically
include a standard library of functions and procedures.
Two-Dimensional Array
Standard library routines perform various tasks, including
string handling.
A two-dimensional array can be referred to as a table with
MOD – returns the remainder of a division
rows and columns.
DIV – returns the quotient (i.e. the whole number part) of a
division
ROUND – returns a value rounded to a given number of
decimal places
RANDOM – returns a random number.
Examples:
Value1 <--- MOD(10,3) returns the remainder of 10 divided
by 3
Value2 <---- DIV(10,3) returns the quotient of 10 divided by 3
Value3 <--- ROUND(6.97354, 2) returns the value rounded to
2 decimal places
Value4 <--- RANDOM() returns a random number between 0
and 1 inclusive
When a two-dimensional array is declared in pseudocode,
6.5. Creating a Maintainable Program the first and last index values for rows and the first and last
index values for columns alongside the data type are
A maintainable program should: included.
always use meaningful identifier names for variables, Declaring a 2D Array:
constants, arrays, procedures and functions
be divided into modules for each task using procedures and DECLARE Name : ARRAY[RowLower:RowUpper,ColumnLower:Colum
functions
be fully commented using your programming language’s Filling a 2-D array using a loop:
commenting feature
Commenting in pseudocode:
Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.
[Link] This document is authorised for personal use only by Monica at Atlantic Study Center on 28/10/25.
CAIE IGCSE COMPUTER SCIENCE
FOR ColumnCounter ← 1 TO 3 OPENFILE "[Link]" FOR READ
FOR RowCounter ← 1 TO 10 DECLARE DataVariable : STRING
OUTPUT "Enter next value " WHILE NOT EOF("[Link]) DO
INPUT ArrayName [RowCounter, ColumnCounter] READFILE "[Link]", DataVariable
NEXT RowCounter // here the line can be outputted or stored in an array
NEXT ColumnCounter //before the file ends has been read
ENDWHILE
6.7. File Handling
7. Databases
Computer programs store data that
will be needed again in a file. A database is a well-organized compilation of data that enables
individuals to retrieve information according to their specific
requirements. The data contained within a database can
Data stored in RAM is volatile and will be lost when the
encompass various forms such as text, numerical values,
computer is powered o!.
images, or any other type of digital content that can be stored
Data saved to a file is stored permanently, allowing it to be
on a computer system.
accessed by the same program at a later date or by other
programs.
Stored data in a file can be transferred and used on other 7.1. Why do we need a database?
computers.
The storage of data in files is a commonly used feature in To store data about people, things, and events.
programming. Any modifications or additions need to be made only once,
ensuring data consistency.
Key point: When writing in a file, the program is outputing All users access and utilize the same set of data, promoting
the data to the file, and when reading a file, the program in uniformity.
inputing the data from the file Relational databases store data in a non-repetitive manner,
\n There are 3 ways a file can be opened in a program i.e. to eliminating duplication.
write, to read and to append
7.2. What makes a database?
6.8. Writing in a file
Data is stored in tables in databases. Each table consists of
OPENFILE "[Link]" FOR WRITE a specific type of data e.g. cars. These tables HAVE to be
named according to what they contain e.g. a table
//When opening a file to write, all the data already existing in the
containing fileinformation
patient is OVERWRITTEN
will be PATIENT
These tables consist of records (rows). Each record consists
of data about a single entity (a single item, person or event )
WRITEFILE "[Link]" , Value e.g. a single car
These tables also have columns that are knows an fields.
// The next command of WRITEFILE would be writen on next line
Theseof the of
consist file
specific information regarding the entities
that are written later in records e.g. car name, car
CLOSEFILE "[Link]" manufacturer etc.
6.9. Reading a file: Note: In this chapter, skills of dealing with a database are
also required so working with Microsoft Access is needed
OPENFILE "[Link]" FOR READ to understand this chapter better. You have to be able to
READFILE "[Link]" , Variable define a single-table database from given data storage
requirements,
// The value in the line (which is identified by the number of times choose
thisa is
suitable
beingprimary
run) key
is for a database
stored in the variab
CLOSEFILE "[Link]" table and also be able to read, complete and understand SQL
scripts.
6.10. Reading a file till EOF:
Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.
[Link] This document is authorised for personal use only by Monica at Atlantic Study Center on 28/10/25.
CAIE IGCSE COMPUTER SCIENCE
Each record in a table represents a unique item, person, or
event.
To ensure reliable identification of these items, a field called
the primary key is necessary.
The primary key is a unique field that distinguishes each
item within the data.
In order to serve as a primary key, a field must have values
that are never repeated within the table.
An existing field can serve as a primary key if it is unique,
Source: Cambridge IGCSE and O Level Computer Science by such as the ISBN in the book table.
Hodder Education In cases where all existing fields may contain repeated data,
an additional field, such as "HospitalNumber," can be
7.3. Validation in databases added to each record to serve as the primary key.
Database management software automatically provides 7.6. Structured Query Language - SQL
some validation checks, while others need to be set up by
the developer during construction. Structured Query Language (SQL) is the standard language
For example; The software automatically validates fields like for writing scripts to retrieve valuable information from
"DateOfAdmission" in the PATIENT table to ensure data databases.
input is a valid date. \n By using SQL, we can learn how to retrieve and display
specific information needed from a database.
7.4. Basic Data Types For instance, someone visiting a patient may only require
the ward number and bed number to locate them in the
hospital, while a consultant may need a list of the names of
Each field will require a data type to be selected. A data type
all the patients under their care. This can be done using
classifies how the data is stored, displayed and the operations
SQL
that can be performed on the stored value.
The datatypes for database are quite similar to original
SQL Scripts
datatypes, however, there are a few di!erences.
An SQL script is a collection of SQL commands that are used
to perform a specific task, often stored in a file for
reusability.
To comprehend SQL and interpret the output of an SQL
script, practical experience in writing SQL scripts is
necessary.
Select Statements:
Note: Access datatype refers to the software Microsoft
SELECT (fieldsname)
Access which is a DBMS (DataBase Management System).
FROM (tablesname)
Here, databases could be worked upon in practical form
WHERE (condition)
ORDER BY (sortingcondition) ;
7.5. Primary Key
Selecting Sum of values in a table:
SELECT SUM ( fieldsname )
FROM (tablesname)
WHERE (condition)
ORDER BY (sortingcondition) ;
Counting the number of records where the field matches a
specified condition
Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.
[Link] This document is authorised for personal use only by Monica at Atlantic Study Center on 28/10/25.
CAIE IGCSE COMPUTER SCIENCE
SELECT COUNT ( fieldsname ) NOT Gate
FROM (tablesname) AND Gate
WHERE (condition) OR Gate
ORDER BY (sortingcondition) ; NAND Gate
NOR Gate
==ORDER BY ASCENDING - sorts in ascending order.== XOR Gate
==ORDER BY DESENDING - sorts in descending order.==
Note: ORDER BY…is not necessary to add. It has to be only NOT gate: an inverter, A
added if required!
A Output
0 1
1 0
AND gate: A.B
A B Output
0 0 0
0 1 0
1 0 0
1 1 1
7.7. Operators
Just like pseudocode, the operators used there can also be
used here for conditions, however, a few more are also used in OR gate: A + B
databases
A B Output
0 0 0
0 1 1
1 0 1
1 1 1
NAND gate: A.B
A B Output
0 0 1
0 1 1
1 0 1
1 1 0
8. Boolean Logic
8.1. Logic Gates and their functions
NOR gate: A + B
Six types of logic gates
A B Output
0 0 1
0 1 0
1 0 0
1 1 0
XOR gate: A ⨁ B
Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.
[Link] This document is authorised for personal use only by Monica at Atlantic Study Center on 28/10/25.
CAIE IGCSE COMPUTER SCIENCE
A B Output
0 0 0
0 1 1
1 0 1
1 1 0
9. Writing Logic Statements
Logic Statements is a way of showing all the logics that are in
place for a logic circuit.
10. Creating Truth Tables
9.1. Writing from a logic circuit
1. Look at the ciruit and go around the logic gates used in 10.1. From Logic Circuits
the circuit
2. Go from the one output that is being given towards the 1. Create a truth table with each input possible, creating
input every possible combination of inputs . Tip: For the first
3. Write the last gate ( the first gate you walk through ) in input, write it in the combination of 1,0,1,0 and so
the middle and then, for each of the value coming into on. For the second, go 1,1,0,0 and so on, and for the
the gate, leave space at the side third one, go 1,1,1,1,0,0,0,0 going by the powers of 2
4. If the value coming into the gate is coming from another for each input. This would guarantee each possible
gate, use a bracket for the gate’s logic combination
5. Repeat process 3-4 till you are able to reach the input 2. Run through the circuit with the inputs and get the
values fully output that will be reached and write it accordingly
For logic statements, and problem statements,
9.2. Writing from a truth table
convert them to logic circuits first and then do the
1. Create logic circuit fom the truth table (shown later) rest
2. Write the logic statement using the ciruit
10.2. Example
9.3. Writing from a Problem statement
This is the example of a truth table of a logic circuit
1. See what logics go in place in the statement to take
place
2. Go from the logic of any 2 inputs at the start, and then
keep on going until you are able to reach the final gate
which gives the output
3. When writing the statement, make sure you show the
logic statement where the output is 1
9.4. Example of a LOGIC STATEMENT
(B AND C) OR (A NOR (A NAND C)) is the logic statement for
the following Logic Circuit
The circuit:
Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.
[Link] This document is authorised for personal use only by Monica at Atlantic Study Center on 28/10/25.
CAIE IGCSE COMPUTER SCIENCE
11. Logic Statements from
Truth Tables 1. The Conditions are given so make logic statements
using the conditions and the table. (NOT S AND T) OR (S
AND W) OR (NOT T AND W)
2. Make the logic circuit from the given equation
3. Make the truth table
1. Given the truth table above, take the rows where the
output (x) is 1 (Rows 1, 2, 4, 5, 6, 7)
2. Create a logic expression from these rows (example,
row 1 will be (NOT A AND NOT B AND NOT C) = X
3. Create logic expressions for all the rows with output 1
and connect them with OR gate
12. Exam-Style Question
Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved.
[Link] This document is authorised for personal use only by Monica at Atlantic Study Center on 28/10/25.
[Link]
CAIE IGCSE logo
COMPUTER SCIENCE (0478)
PRACTICAL
© ZNotes Education Ltd. & ZNotes Foundation 2025. All rights reserved.
This version was created by Monica on Tue Oct 28 2025 for strictly personal use only.
These notes have been created by Abdullah Aamir, Shriram S, Meera Srivastava & Abhiram Mydi for the 2023-2025 syllabus.
The document contains images and excerpts of text from educational resources available on the internet and printed books.
If you are the owner of such media, test or visual, utilized in this document and do not accept its usage then we urge you to
If you are the owner of such media, test or visual, utilized in this document and do not accept its usage then we urge you to
contact us
and we would immediately replace said media. No part of this document may be copied or re-uploaded to another website.
Under no conditions may this document be distributed under the name of false author(s) or sold for financial gain.
"ZNotes" and the ZNotes logo are trademarks of ZNotes Education Limited (registration UK00003478331).