Free O Level Computer Science 2210 Study Guide — Edvia College
← Free ResourcesEDVIA COLLEGEApply Now

O Level Computer Science 2210 — both papers, free.

A complete study guide for Cambridge O Level Computer Science 2210, covering all 10 topics of the official syllabus for exams in 2026–2028.

How to use it: the two papers test completely different skills. Paper 1 is recall and explanation of computer systems; Paper 2 is doing — writing pseudocode, completing trace tables, drawing logic circuits. Reading alone will not prepare you for Paper 2; you have to write code by hand.

Note: no calculators are permitted in either paper, so all number conversions must be done by hand.

CAIE 2210 · exams 2026–202824 syllabus units10 topicsPseudocode referenceFree & shareable
Start here

The papers

PaperCoversFormatTime / marksWeight
Paper 1 — Computer SystemsTopics 1–6Short-answer and structured questions; all compulsory1 h 45 min · 75 marks50%
Paper 2 — Algorithms, Programming and LogicTopics 7–10Short-answer and structured questions plus a scenario-based question; all compulsory1 h 45 min · 75 marks50%

No calculators are permitted in either paper. Binary, denary and hexadecimal conversions must be done by hand — which is why the conversion drills below matter.

Paper 2's scenario question is worth a large block of marks and asks you to write a working algorithm. Plan it first — inputs, process, output, and which loop type you need — before you start writing pseudocode. A clear plan prevents the most expensive mistake: an algorithm that never terminates or never validates.
No calculator allowed — drill these

Number conversion drills

Binary → denaryWrite the place values above the bits and add up those with a 1.
128  64  32  16   8   4   2   1 1    0   1   1   0   0   1   0  → 128 + 32 + 16 + 2 = 178
Denary → binaryWork down the place values, subtracting where you can.
200: 128 fits (72 left) → 1 64 fits (8 left) → 1 · 32 no → 0 · 16 no → 0 8 fits (0 left) → 1 · 4 no → 0 · 2 no → 0 · 1 no → 0 200 = 11001000
Binary ↔ hexadecimalSplit the binary into nibbles of 4 bits from the right, and convert each nibble separately. This is why hex is used — one hex digit is exactly four bits.
11001000 → 1100 | 1000 → 12 | 8 → C8 2F → 2 | F → 0010 | 1111 → 00101111 C8 in denary = (12 × 16) + 8 = 200
Denary0123456789101112131415
Hex0123456789ABCDEF
Binary0000000100100011010001010110011110001001101010111100110111101111
Binary addition0+0=0, 0+1=1, 1+1=10 (write 0 carry 1), 1+1+1=11 (write 1 carry 1).
Overflow occurs when the result needs more bits than the register holds — with 8 bits, any result above 255 causes overflow and the answer stored is wrong.
Logical shiftsA left shift of one place multiplies by 2; a right shift of one place divides by 2. Zeros are shifted in, and bits shifted out are lost.
00010110 (22) left shift 1 → 00101100 (44) 00010110 (22) right shift 1 → 00001011 (11)
Skill check: Convert 10110101 to denary and to hexadecimal.
Solution: Denary: 128 + 32 + 16 + 4 + 1 = 181. Hex: split into nibbles 1011 | 0101 = 11 | 5 = B5. (Check: 11 × 16 + 5 = 181 ✓)
Topic 1 · 3 units · Paper 1

Data representation

1.1Number systems

Computers use binary because their circuits have two stable states — on and off, represented as 1 and 0. Hexadecimal is used by people because it is much shorter than binary, easier to read and less error-prone, and converts cleanly (one hex digit = four bits).

Uses of hexadecimal: MAC addresses, IPv6 addresses, HTML colour codes, memory dumps, assembly language and error/debugging codes.

You must be able to convert between denary, binary and hexadecimal, add binary numbers, identify overflow, and perform logical binary shifts — all covered in the drills above. Also know two's complement for representing negative binary numbers: to negate, invert all the bits and add 1.

Worked example — two's complement

Represent −20 in 8-bit two's complement.

  1. +20 = 00010100
  2. Invert all bits: 11101011
  3. Add 1: 11101100

1.2Text, sound and images

Data typeHow it is representedKey terms
TextEach character has a unique binary code in a character setASCII (7/8-bit, limited to mostly English) and Unicode (many more bits, covers all world languages and emoji — but needs more storage)
SoundThe analogue wave is sampled at intervals and each sample stored as a binary valueSample rate (samples per second) and sample resolution (bits per sample). Higher values → better quality but larger file
ImagesStored as a grid of pixels, each with a binary colour valueResolution (number of pixels) and colour depth (bits per pixel). Higher values → better quality but larger file
Worked example — file size

An image is 100 × 200 pixels with a colour depth of 8 bits. Calculate the file size in bytes.

  1. Total pixels = 100 × 200 = 20 000
  2. Total bits = 20 000 × 8 = 160 000 bits
  3. Bytes = 160 000 ÷ 8 = 20 000 bytes (about 19.5 KiB)
The trade-off sentence earns the mark: "increasing the sample rate captures the wave more accurately so sound quality improves, but the file size increases and more storage and bandwidth are needed." Always give both halves.

1.3Data storage and compression

UnitEquivalent
1 nibble4 bits
1 byte8 bits
1 kibibyte (KiB)1024 bytes
1 mebibyte (MiB)1024 KiB
1 gibibyte (GiB)1024 MiB
1 tebibyte (TiB)1024 GiB
Lossless compressionLossy compression
DataNo data is permanently removed; the original can be perfectly restoredSome data is permanently removed; the original cannot be restored
MethodRun-length encoding; storing repeated patterns once with an indexReducing colour depth, sample rate or resolution; removing sounds outside human hearing
File sizeReduced lessReduced much more
Use forText and program files, where every byte mattersMusic, photos and video streaming, where slight quality loss is acceptable

Why compress: faster transmission and downloads, less bandwidth used, less storage space needed, faster web page loading, smaller email attachments.

Topic 2 · 3 units · Paper 1

Data transmission

2.1Types and methods of data transmission

A data packet has three parts: a packet header (destination and sender addresses, packet number, and how many packets make up the whole message), the payload (the actual data) and a trailer (a way to identify the end of the packet, and an error-checking method).

Packet switching: data is split into packets that travel independently by whatever route is fastest, then are reassembled in order at the destination. Missing packets are re-requested.

Transmission typeDescriptionSuits
SerialOne bit at a time down a single wireLong distances — reliable, no skew, cheaper
ParallelSeveral bits at once down multiple wiresVery short distances — faster, but bits can arrive skewed
SimplexOne direction onlyComputer to printer
Half-duplexBoth directions, but one at a timeWalkie-talkie
Full-duplexBoth directions simultaneouslyPhone call, broadband

USB is a serial method: it is a universal standard, connectors only fit one way, it can supply power and is auto-detected — but cable length is limited and older versions have slower transfer rates.

2.2Methods of error detection

MethodHow it works
Parity checkA parity bit is set so the total number of 1s is even (even parity) or odd (odd parity). If the received byte's parity is wrong, an error occurred. Weakness: two errors in the same byte cancel out and go undetected.
ChecksumA value calculated from the data block is sent with it; the receiver recalculates and compares. If they differ, an error occurred and retransmission is requested.
Echo checkThe received data is sent back to the sender and compared with the original. Weakness: you cannot tell whether the error occurred on the way there or on the way back.
Check digitAn extra digit calculated from the others, used on barcodes and ISBNs to catch typing and scanning errors.
Automatic Repeat reQuest (ARQ)The receiver sends a positive or negative acknowledgement; if no acknowledgement arrives within a set time, the sender retransmits.
Worked example

A system uses even parity. The byte 1011001 is to be sent with a parity bit. What is the parity bit, and why?

  1. Count the 1s: 1, 1, 1, 1 → four 1s, which is already even
  2. Parity bit = 0, so the total number of 1s stays even
  3. If the receiver counts an odd number of 1s, it knows an error occurred during transmission.

2.3Encryption

Why encryptEncryption scrambles data so that if it is intercepted it is meaningless without the key. It does not prevent interception — it makes intercepted data useless. Plaintext becomes ciphertext.
Symmetric encryptionAsymmetric encryption
The same key encrypts and decryptsA public key encrypts and a matching private key decrypts
Faster; good for large volumesSlower, but far more secure
Problem: the key must be sent to the recipient, and could be interceptedThe private key is never transmitted, so this problem disappears
Topic 3 · 4 units · Paper 1

Hardware

3.1Computer architecture

The CPU processes instructions and data. In the Von Neumann architecture, data and instructions are both stored in the same memory, and instructions are fetched and executed one at a time.

ComponentPurpose
ALU (arithmetic logic unit)Performs calculations and logical operations
CU (control unit)Fetches, decodes and executes instructions; sends control signals
MAR (memory address register)Holds the address of the memory location to be read from or written to
MDR (memory data register)Holds the data just read from, or about to be written to, memory
PC (program counter)Holds the address of the next instruction
ACC (accumulator)Stores the result of calculations
BusesAddress bus (carries addresses, one direction), data bus (carries data, both directions), control bus (carries control signals)
The fetch–decode–execute cycle
  1. The address in the PC is copied to the MAR.
  2. The instruction at that address is fetched into the MDR.
  3. The PC is incremented to point to the next instruction.
  4. The instruction is decoded by the control unit.
  5. The instruction is executed, with results stored in the accumulator.

Factors affecting CPU performance: clock speed (more cycles per second → more instructions), number of cores (more instructions processed simultaneously) and cache size (frequently used data held close to the CPU, so less waiting for slower RAM).

Embedded systems are computer systems built into a larger device to perform a dedicated task — washing machines, engine management, traffic lights. They are cheap, small, reliable and low-power, but usually hard to update and limited to one function.

3.2Input and output devices

Input devices (barcode scanner, QR scanner, digital camera, keyboard, microphone, touch screen, 2D/3D scanner) send data into the system. Output devices (monitor, printer, speaker, actuator, 3D printer) send data out.

Sensors are input devices that measure physical properties continuously — temperature, pressure, light, moisture, motion, infrared, gas, pH. Their analogue readings must be converted by an ADC before a computer can process them; a DAC converts digital signals back to analogue to drive actuators.

Touch screen typeHow it worksNotes
ResistiveTwo conductive layers touch when pressedCheap; works with gloves or a stylus; poorer visibility; can be damaged by scratches
CapacitiveDetects change in the screen's electrical field from a fingerGood visibility and durability; supports multi-touch; does not work with ordinary gloves
InfraredA grid of infrared beams is broken by a touchWorks with any object; affected by strong sunlight

3.3Data storage

RAMROM
Volatile?Volatile — contents lost when power is offNon-volatile — contents kept
Can be written to?Yes, read and writeRead only (in normal use)
StoresCurrently running programs, data and parts of the OSStart-up instructions, e.g. the bootstrap/BIOS
Storage typeHow it stores dataExamples
MagneticMagnetised sectors on spinning plattersHard disk drive, magnetic tape — cheap per GB, large capacity, but moving parts can fail
OpticalA laser burns pits and lands on a reflective surfaceCD, DVD, Blu-ray — cheap and portable, but small capacity and easily scratched
Solid state (SSD)Control gates and floating gates trap electrons (no moving parts)SSD, memory stick — fast, durable, silent, low power; more expensive per GB and a limited number of write cycles

Virtual memory uses part of secondary storage as if it were RAM when RAM is full, allowing more programs to run — but it is much slower, causing "disk thrashing" if overused.

Cloud storage keeps data on remote servers accessed over the internet: accessible anywhere, no hardware to maintain, and backed up automatically — but it needs an internet connection, raises security and privacy concerns, and may incur ongoing costs.

3.4Network hardware

DeviceFunction
NIC (network interface card)Allows a device to connect to a network; holds the MAC address
MAC addressA unique hardware address for a device, in hexadecimal — normally fixed for the life of the device
IP addressIdentifies a device on a network; can change (a static IP does not, a dynamic IP is reassigned)
RouterConnects networks and directs data packets between them using IP addresses

IPv4 uses 32 bits written as four denary numbers (e.g. 192.168.0.1); IPv6 uses 128 bits written in hexadecimal, giving vastly more addresses because IPv4 is running out.

Topic 4 · 2 units · Paper 1

Software

4.1Types of software and interrupts

System software manages the computer (operating system, utilities, device drivers). Application software lets the user perform tasks (word processor, browser, spreadsheet).

Operating system tasks: managing files, managing memory, managing input/output devices, managing processes, providing a user interface, managing security and user accounts, and handling hardware/peripheral drivers.

InterruptsAn interrupt is a signal sent to the CPU by a device or program requesting immediate attention. The CPU finishes its current instruction, saves its current state, runs the interrupt service routine (ISR), then restores its state and resumes. Examples: a key press, a printer out of paper, division by zero, a disk drive ready.

4.2Languages, translators and IDEs

High-level languageLow-level language (assembly/machine code)
Closer to English; easier to read, write and debug; portable across machinesCloser to machine code; specific to that processor
Must be translated before executionAllows direct control of hardware; faster and more memory-efficient
CompilerInterpreter
TranslatesThe whole program at once into an executable fileOne line at a time, executing as it goes
ErrorsReports all errors together at the end of compilationStops at the first error found
SpeedRuns faster once compiled; no translator needed to run itSlower to run; the interpreter is needed every time
Best forFinished, distributed softwareDevelopment and testing

An IDE (integrated development environment) provides: code editing with syntax highlighting, error diagnostics and reports, auto-completion and auto-correction, prettyprinting (indentation and layout), and a built-in translator and debugger with breakpoints and single stepping.

Skill check: A developer is testing new code and wants errors reported as soon as each occurs. Which translator should they use, and why?
Solution: An interpreter. It translates and executes one line at a time and stops at the first error, so the developer sees exactly where the problem is immediately, making debugging much quicker. Once the program is finished, they would use a compiler to produce a fast, standalone executable for distribution.
Topic 5 · 3 units · Paper 1

The internet and its uses

5.1The internet and the world wide web

The distinction examiners testThe internet is the global infrastructure — the physical network of interconnected computers. The world wide web is the collection of web pages and resources accessed using the internet. The web runs on the internet; they are not the same thing.

URL structure: protocol (https), domain name, and file path. HTTP transfers web pages; HTTPS is the encrypted version, using SSL/TLS and a digital certificate so data cannot be read if intercepted.

Web browser functions: render HTML and display web pages, store bookmarks and history, allow multiple tabs, manage cookies, run JavaScript, and use a cache to load frequently visited pages faster.

Retrieving a web page: the browser sends the URL to a DNS server, which returns the matching IP address; the browser then requests the page from that web server, which sends back the HTML; the browser renders it.

Cookies are small text files storing user data. Session cookies are held in memory and lost when the browser closes; persistent cookies are saved to disk and remain — used to remember logins, preferences and shopping baskets.

5.2Digital currency

Digital currency exists only electronically and has no physical form. It relies on trust in the system, since there is no central bank issuing it.

BlockchainA blockchain is a decentralised digital ledger of time-stamped transactions. Each block contains the transaction data, a time stamp and a hash of the previous block, forming a chain. Copies are held across many computers, so altering one block would change its hash and break every following block — making tampering detectable and the record extremely hard to alter.

5.3Cyber security

ThreatWhat it doesMain protection
Brute-force attackTries every password combination until one worksStrong passwords, limited login attempts, two-step verification
Data interceptionPacket sniffing to steal data in transitEncryption, WPA on wireless
DDoS attackFloods a server with requests so genuine users cannot access itFirewall, proxy server
HackingUnauthorised access to a systemFirewalls, strong passwords, access levels
MalwareVirus, worm, trojan horse, spyware, adware, ransomwareAnti-malware software, not opening unknown attachments
PhishingFake emails trick users into revealing detailsUser awareness, spam filters, checking sender addresses
PharmingMalicious code redirects the user to a fake websiteAnti-malware, checking the URL and certificate
Social engineeringManipulating people into breaking security proceduresTraining and clear procedures

Solutions to know: access levels, anti-malware, authentication (passwords, biometrics, two-step verification), automatic software updates, checking spelling and tone of communications, checking the URL, firewalls, privacy settings, and proxy servers.

Confusing a firewall (monitors and filters traffic entering and leaving a network against a set of criteria) with anti-malware (scans files already on the system and removes malicious software). Questions frequently ask for the difference.
Topic 6 · 3 units · Paper 1

Automated and emerging technologies

6.1Automated systems 6.2Robotics

Automated systems combine sensors, a microprocessor and actuators. The sensor reads data continuously, an ADC converts it, the microprocessor compares it with stored values, and if action is needed it signals an actuator (via a DAC) to respond — a continuous feedback loop.

Advantages: faster and more accurate than humans, works continuously without breaks, safer in hazardous environments, consistent quality, lower long-run labour costs. Disadvantages: expensive to install and maintain, job losses, vulnerable to faults and power failure, and inflexible if the task changes.

Robots have three characteristics: a mechanical structure, electrical components, and programmability. They may be independent (no human intervention) or dependent (needing a human interface). Used in industry, agriculture, medicine, domestic tasks, entertainment and exploration.

6.3Artificial intelligence

DefinitionArtificial intelligence (AI) is the simulation of human intelligence by machines — systems that can collect data, apply rules, reason and adapt.

Expert systems have four parts: a knowledge base (facts), a rule base (IF–THEN rules), an inference engine (applies the rules to reach conclusions) and a user interface. They are used for medical diagnosis, mineral prospecting, financial planning and fault diagnosis.

Machine learning systems improve through experience by finding patterns in data rather than following only fixed rules.

Impacts: greater efficiency and access to expertise in remote areas, and the ability to work in dangerous settings — set against job displacement, high development cost, over-reliance on systems that can be wrong, and ethical concerns about bias and accountability.

Paper 2 · essential reference

Pseudocode reference

ConventionsKeywords in UPPER CASE (IF, REPEAT, PROCEDURE). Identifiers in MixedCase (NumberOfPlayers). Assignment uses . Comments start with //. Indent by four spaces inside a block.
// Declaration and assignment DECLARE Counter : INTEGER DECLARE Name : STRING CONSTANT Pi = 3.142 Counter ← 0 Name ← "Ayesha"
// Selection IF Score >= 50 THEN OUTPUT "Pass" ELSE OUTPUT "Fail" ENDIF CASE OF Grade "A" : OUTPUT "Excellent" "B" : OUTPUT "Good" OTHERWISE OUTPUT "See teacher" ENDCASE
// Count-controlled loop — use when the number of repeats is known FOR Index ← 1 TO 10 OUTPUT Index NEXT Index // Pre-condition loop — may run zero times WHILE Total < 100 DO Total ← Total + 5 ENDWHILE // Post-condition loop — always runs at least once REPEAT INPUT Password UNTIL Password = "OpenSesame"
// Arrays DECLARE Scores : ARRAY[1:10] OF INTEGER Scores[3] ← 75 // Procedure and function PROCEDURE ShowTotal(Value : INTEGER) OUTPUT "Total is ", Value ENDPROCEDURE FUNCTION Square(X : INTEGER) RETURNS INTEGER RETURN X * X ENDFUNCTION
// File handling OPENFILE "Data.txt" FOR READ READFILE "Data.txt", LineOfText CLOSEFILE "Data.txt" OPENFILE "Data.txt" FOR WRITE WRITEFILE "Data.txt", "New record" CLOSEFILE "Data.txt"
Data typeHoldsExample
INTEGERWhole numbers42
REALNumbers with a decimal part3.75
CHARA single character'A'
STRINGA sequence of characters"Hello"
BOOLEANTRUE or FALSETRUE
Choosing the wrong loop. Use FOR when you know how many repeats; WHILE when it might need zero repeats (test first); REPEAT when it must run at least once (test last). A menu that must appear at least once is a REPEAT; validating input that may already be correct is a WHILE.
Topic 7 · Paper 2

Algorithm design and problem-solving

7Algorithm design and problem-solving

Program development life cycle: analysis → design → coding → testing. Decomposition breaks a problem into inputs, processes and outputs; abstraction keeps only the details that matter and removes the rest.

Algorithms can be expressed as structure diagrams, flowcharts or pseudocode.

Flowchart symbolMeaning
Oval (terminator)Begin / End
ParallelogramInput / Output
RectangleProcess
DiamondDecision
ArrowFlow of control
Validation vs verificationValidation checks that data is reasonable — range check, length check, type check, presence check, format check, check digit. Verification checks that data has been accurately copied or entered — double entry, or a visual/screen check. Validation cannot detect a wrong-but-plausible value; verification can.

Test data types: normal (accepted and typical), abnormal/erroneous (should be rejected), extreme (at the limits of acceptability) and boundary (the largest accepted value and the smallest rejected value, or vice versa).

Trace tables — how to score full marksDraw one column per variable plus a column for OUTPUT. Work through the algorithm one line at a time, writing a new value every time a variable changes. Do not calculate ahead in your head — that is exactly how marks are lost. Include the final loop check that causes exit.
Worked example — trace table
Total ← 0 FOR Count ← 1 TO 4 Total ← Total + Count NEXT Count OUTPUT Total
CountTotalOUTPUT
0
11
23
36
41010

Standard methods you must know: a linear search (check each item in turn until found or the list ends), a bubble sort (repeatedly compare adjacent items and swap if out of order until a pass makes no swaps), and using totalling, counting, finding maximum, minimum and average.

Worked example — validation with a WHILE loop

Write an algorithm that repeatedly asks for a mark until a valid mark between 0 and 100 is entered.

OUTPUT "Enter a mark between 0 and 100" INPUT Mark WHILE Mark < 0 OR Mark > 100 DO OUTPUT "Invalid. Enter a mark between 0 and 100" INPUT Mark ENDWHILE OUTPUT "Mark accepted: ", Mark

This is a range check. A WHILE loop is right because a valid first entry should not trigger the error message at all.

Skill check: For a range check accepting 1–50, give one item of normal, abnormal, extreme and boundary test data.
Solution: Normal: 25 (typical and accepted). Abnormal/erroneous: "cat" or −7 (wrong type or clearly outside). Extreme: 1 or 50 (at the limits but still valid). Boundary: the pair 0 and 1, or 50 and 51 — the largest rejected and the smallest accepted value either side of the limit.
Topic 8 · 3 units · Paper 2

Programming

8.1Programming concepts

The three programming constructs: sequence (statements in order), selection (IF / CASE) and iteration (FOR / WHILE / REPEAT). Every algorithm is built from these.

Operator groupOperators
Arithmetic+   −   *   /   ^   DIV (integer division)   MOD (remainder)
Comparison=   <>   <   <=   >   >=
LogicalAND   OR   NOT
Worked example — DIV and MOD

Evaluate 17 DIV 5 and 17 MOD 5, and explain a use for MOD.

  1. 17 DIV 5 = 3 (the whole number of times 5 goes into 17)
  2. 17 MOD 5 = 2 (the remainder)
  3. MOD is commonly used to test divisibility: if N MOD 2 = 0 then N is even.

Library routines you should know: MOD, DIV, ROUND, RANDOM. Procedures and functions break a program into manageable named sub-programs — the key difference is that a function returns a value and a procedure does not. Both may take parameters. Benefits: code can be reused, is easier to test and debug, and several people can work on different modules.

Local vs global variablesA local variable exists only inside the sub-program where it is declared — safer, since it cannot be changed accidentally elsewhere, and its memory is freed after use. A global variable can be accessed anywhere in the program — convenient but riskier, as any part of the code can change it.

8.2Arrays

An array stores multiple values of the same data type under one identifier, accessed by index. A 1D array is a list; a 2D array is a table with rows and columns.

DECLARE Names : ARRAY[1:5] OF STRING // 1D DECLARE Grid : ARRAY[1:3, 1:4] OF INTEGER // 2D: 3 rows, 4 columns Names[2] ← "Bilal" Grid[2,3] ← 17
Worked example — totalling an array
DECLARE Scores : ARRAY[1:5] OF INTEGER DECLARE Total, Index : INTEGER Total ← 0 FOR Index ← 1 TO 5 INPUT Scores[Index] Total ← Total + Scores[Index] NEXT Index OUTPUT "Average is ", Total / 5
Worked example — linear search
Found ← FALSE Index ← 1 INPUT SearchName WHILE Index <= 5 AND Found = FALSE DO IF Names[Index] = SearchName THEN Found ← TRUE ELSE Index ← Index + 1 ENDIF ENDWHILE IF Found = TRUE THEN OUTPUT "Found at position ", Index ELSE OUTPUT "Not found" ENDIF

8.3File handling

Files provide persistent storage — data survives after the program ends, unlike variables. You must be able to open a file for reading or writing, read from and write to it, and always close it afterwards.

Worked example — write then read
// Writing OPENFILE "Students.txt" FOR WRITE INPUT StudentName WRITEFILE "Students.txt", StudentName CLOSEFILE "Students.txt" // Reading OPENFILE "Students.txt" FOR READ READFILE "Students.txt", LineOfText OUTPUT LineOfText CLOSEFILE "Students.txt"
Forgetting CLOSEFILE, or opening a file FOR WRITE when you meant to add to it. Opening FOR WRITE typically overwrites existing contents — a mark is often awarded specifically for closing the file.
Topic 9 · Paper 2

Databases

9Databases

TermsA single-table database stores data in one table. A record is one row (all the data about one item); a field is one column (one attribute). The primary key is a field that uniquely identifies each record — no two records may share it.
Data typeUse for
Text/alphanumericNames, addresses, codes containing letters
CharacterA single letter or symbol
BooleanYes/No, True/False fields
IntegerWhole numbers — quantities, ages
RealNumbers with decimals — prices, measurements
Date/timeDates and times
SQL — the four clauses to master
SELECT FieldName(s) or * // which fields to show FROM TableName // which table WHERE condition // which records ORDER BY FieldName ASC|DESC // sort order SUM(FieldName) COUNT(FieldName) // aggregate functions
Worked example

From a table Stock with fields ItemID, ItemName, Price and Quantity, write SQL to list the name and price of all items costing more than 50, sorted from most to least expensive.

SELECT ItemName, Price FROM Stock WHERE Price > 50 ORDER BY Price DESC

To count how many items are in stock: SELECT COUNT(ItemID) FROM Stock

Putting text values without quotation marks. Text conditions need them — WHERE ItemName = 'Bolt' — while numeric ones do not. Also remember ORDER BY comes last.
Skill check: Write SQL to show all fields for students in class '10A', sorted by surname alphabetically, from a table called Students.
Solution:
SELECT *
FROM Students
WHERE Class = '10A'
ORDER BY Surname ASC
Topic 10 · Paper 2

Boolean logic

10Boolean logic

GateBehaviourTruth table (A, B → output)
NOTOutput is the opposite of the input0→1, 1→0
ANDOutput 1 only if both inputs are 100→0, 01→0, 10→0, 11→1
OROutput 1 if either or both inputs are 100→0, 01→1, 10→1, 11→1
NANDNOT AND — output 0 only if both inputs are 100→1, 01→1, 10→1, 11→0
NORNOT OR — output 1 only if both inputs are 000→1, 01→0, 10→0, 11→0
XOROutput 1 if the inputs are different00→0, 01→1, 10→1, 11→0
Building a truth table for a circuit
  1. List every input combination — 2n rows for n inputs (3 inputs = 8 rows).
  2. Add a column for each intermediate gate output, working left to right through the circuit.
  3. Complete the final output column last.
Work systematically: 000, 001, 010, 011, 100, 101, 110, 111 — counting in binary guarantees you miss no combination.
Worked example

Complete the truth table for X = (A AND B) OR (NOT C).

ABCA AND BNOT CX
000011
001000
010011
011000
100011
101000
110111
111101

Logic expressions from a scenario are a standard question: read each condition carefully and decide whether it needs AND (both must be true), OR (either), or NOT (the opposite). "An alarm sounds if the door is open AND the system is armed, OR if the panic button is pressed" becomes X = (D AND S) OR P.

Skill check: A heater turns on (X = 1) when the temperature sensor reads below 18 °C (T = 0 means below) and the system is switched on (S = 1). Write the logic expression.
Solution: The heater needs the temperature not to be at or above 18 °C, and the system on — both conditions must hold, so use AND with a NOT: X = (NOT T) AND S.
Track your progress

Study planner & progress

Every syllabus unit. Tick one when you can answer a past-paper question on it unaided. Your ticks are saved on this device only — nothing is sent anywhere, and there is no account to create.

Loading…

Reference

Free past papers & how to revise

Official (free)

  • Cambridge International — 2210 subject page: syllabus, specimen papers, past papers, mark schemes and examiner reports.
  • Examiner reports name the exact questions candidates got wrong each series — read them for every paper you attempt.

Free archives

How to revise this subject

  1. Drill number conversions daily until they are automatic without a calculator — binary ↔ denary ↔ hexadecimal. They appear on Paper 1 every series.
  2. Write pseudocode by hand. Typing in an IDE does not prepare you for hand-writing correct syntax under time pressure.
  3. Practise trace tables line by line. Do not skip steps mentally — write every value change, including the final loop check.
  4. Learn definitions precisely. Paper 1 rewards exact terminology: "validation" vs "verification", "compiler" vs "interpreter", "RAM" vs "ROM".
  5. For every hardware/software topic, learn one clear purpose plus one advantage or drawback — that is the usual shape of a 2–3 mark question.

Edvia Free Resources — O Level Computer Science 2210. Original notes and worked examples written for the Cambridge O Level Computer Science 2210 syllabus for examination in 2026–2028. An independent free study resource, not affiliated with or endorsed by Cambridge University Press & Assessment. Syllabus reference codes are used for navigation. Share it freely — it will always be free.

All subjects · Chapter handouts · Practice ·

Like how this is taught?

This guide is one subject. Imagine every subject taught this way, in person, with a mentor who knows your name — that is Edvia College.

Apply to Edvia → WhatsApp Admissions