Define a single-table database from given requirements

Cambridge IGCSE Computer Science (0478) – Complete Revision Notes

How to Use These Notes

  • Read each section once to get the big picture, then return for focused practice.
  • Use the Check‑Your‑Understanding questions after every topic to test AO1 (knowledge) and AO2 (application).
  • When preparing for the exam, work through the End‑of‑Chapter Tasks – they target AO3 (analysis & evaluation).

Assessment Objectives (AOs)

AOWhat the exam looks for
AO1Recall factual knowledge – definitions, terminology, diagram components.
AO2Apply knowledge – write SQL, pseudocode, trace algorithms, calculate file sizes.
AO3Analyse, evaluate and justify – choose appropriate data types, optimise an algorithm, discuss security implications.

1. Data Representation (Syllabus Block 1)

1.1 Number Systems

  • Binary (base‑2), Decimal (base‑10), Hexadecimal (base‑16).
  • Conversion methods:
    • Decimal → Binary: successive division by 2.
    • Binary → Decimal: sum of bit × 2ⁿ.
    • Binary ↔ Hexadecimal: group bits in fours.

1.2 Two’s‑Complement for Signed Integers

  1. Invert all bits.
  2. Add 1.

Example: 0101 (5)1010 (-6) in 4‑bit two’s‑complement.

1.3 Binary Arithmetic

OperationRule
Addition0+0=0, 0+1=1, 1+1=0 carry 1.
SubtractionUse two’s‑complement addition.
MultiplicationShift‑and‑add (binary long multiplication).
DivisionRepeated subtraction or shift‑subtract algorithm.

1.4 Logical Shifts

  • Logical left shift – inserts 0 on the right, multiplies by 2.
  • Logical right shift – discards rightmost bit, divides by 2 (floor).

Check‑Your‑Understanding (AO1/AO2)

  1. Convert 101101₂ to decimal.
  2. Represent –23 in an 8‑bit two’s‑complement format.
  3. Add 1101₂ and 0110₂ showing any carry.

2. Data Transmission (Syllabus Block 2)

2.1 Packet Structure

  • Header – source/destination address, control information.
  • Payload – actual data.
  • Trailer – error‑checking (e.g., CRC).

2.2 Switching Techniques

TechniqueKey Feature
Circuit switchingDedicated path for the duration of a session.
Packet switchingData split into packets; each may take a different route.
Message switchingWhole messages stored and forwarded at each node.

2.3 Common Interfaces

  • USB – serial, hot‑plug, up to 5 Gb/s (USB 3.0).
  • Ethernet – 10 Mb/s, 100 Mb/s, 1 Gb/s standards.

2.4 Error Detection & Correction

  • Parity bit – even or odd.
  • Checksum – sum of data bytes, modulo 256.
  • CRC – polynomial division, widely used in networking.

2.5 Basic Encryption (AO3)

  • Symmetric (e.g., AES) – same key for encrypt & decrypt.
  • Asymmetric (e.g., RSA) – public key encrypts, private key decrypts.
  • In the IGCSE you only need to know the concepts, not the maths.

Check‑Your‑Understanding

  1. Identify the three parts of a network packet.
  2. Explain why packet switching is more efficient than circuit switching for web browsing.
  3. Give one advantage of using a parity bit over no error detection at all.

3. Computer Hardware (Syllabus Block 3)

3.1 Von Neumann Architecture

Simple von Neumann diagram
CPU in the centre, connected to Memory and I/O devices.

3.2 CPU Components

  • ALU – arithmetic & logic operations.
  • Control Unit – directs the fetch‑decode‑execute cycle.
  • Registers – small, fast storage (e.g., Program Counter, Accumulator).
  • Cache – high‑speed memory close to the CPU.

3.3 Core & Multicore

Each core can execute its own instruction stream. Multicore CPUs improve performance without raising clock speed.

3.4 Embedded Systems (AO3)

Special‑purpose computers built into appliances (e.g., microwave, digital watch). They usually have limited memory and run a single, dedicated program.

Check‑Your‑Understanding

  1. Describe the three stages of the fetch‑decode‑execute cycle.
  2. Why does cache improve overall system speed?
  3. Give an example of an embedded system and state one advantage it has over a general‑purpose PC.

4. Input/Output Devices & Sensors (Syllabus Block 4)

4.1 Common I/O Devices

DeviceData Type Produced / Consumed
KeyboardText (STRING)
Mouse / TouchpadCoordinates (INTEGER)
ScannerImage (BINARY / BYTE ARRAY)
MicrophoneSound (BINARY, often compressed)
PrinterText / Graphics (output)

4.2 Sensors

  • Temperature – returns a REAL number (°C or °F).
  • Light intensity – often an INTEGER (lux).
  • Proximity – Boolean (object detected / not detected) or distance (INTEGER).

Matching Exercise (AO2)

Match each device to the most appropriate data type.

  1. Digital camera – _______
  2. Thermometer – _______
  3. Barcode scanner – _______

5. Data Storage & Compression (Syllabus Block 5)

5.1 Units of Information

1 bit = binary digit; 1 byte = 8 bits. Use the IEC prefixes for large units:

  • KiB = 2³⁰ bytes (1 024 bytes)
  • MiB = 2²⁰ bytes (1 048 576 bytes)
  • GiB = 2³⁰ bytes (1 073 741 824 bytes)
  • TiB = 2⁴⁰ bytes, etc.

5.2 Calculating File Size

Example – a 24‑bit colour image 800 × 600 pixels:

Pixels = 800 × 600 = 480 000
Bits = 480 000 × 24 = 11 520 000 bits
Bytes = 11 520 000 ÷ 8 = 1 440 000 bytes ≈ 1.37 MiB

5.3 Compression

  • Lossless – PNG, ZIP – original data can be perfectly restored.
  • Lossy – JPEG, MP3 – some data is permanently discarded to achieve higher compression ratios.

Practice Question (AO2)

A 5‑minute mono audio clip is sampled at 44 kHz with 16‑bit resolution. Estimate the uncompressed file size in megabytes.


6. Network Hardware & the Internet (Syllabus Block 6)

6.1 Key Hardware

ComponentRole
NIC (Network Interface Card)Provides MAC address, converts data to frames.
RouterForwards packets between different networks; uses IP addresses.
SwitchConnects devices within a LAN; forwards frames based on MAC.
ModemModulates/demodulates signals for broadband/telephone lines.

6.2 Addressing

  • MAC address – 48‑bit hardware identifier, written in hex (e.g., 00:1A:2B:3C:4D:5E).
  • IP address – 32‑bit (IPv4) or 128‑bit (IPv6) logical address. Example IPv4: 192.168.1.10.

6.3 The Web Request Cycle

  1. User enters a URL → browser parses it.
  2. DNS lookup translates domain name to IP address.
  3. TCP connection established (handshake).
  4. HTTP GET request sent.
  5. Server replies with HTML, CSS, images.
  6. Browser renders the page.

6.4 HTTP vs HTTPS (AO3)

HTTPS adds TLS/SSL encryption, ensuring confidentiality and integrity of data exchanged.

Trace‑the‑URL Exercise

Given the URL https://www.example.com/resources/report.pdf, list the steps the browser follows from typing the address to receiving the PDF file.


7. Algorithm Design & Problem Solving (Syllabus Block 7)

7.1 Decomposition

Break a problem into smaller, manageable sub‑problems (modules). Each module should have a clear input and output.

7.2 Flowchart Symbols (AO1)

  • Oval – Start/End
  • Parallelogram – Input/Output
  • Rectangle – Process/Assignment
  • Diamond – Decision (Yes/No)
  • Arrows – Flow of control

7.3 Pseudocode Conventions (AO2)

READ number
IF number MOD 2 = 0 THEN
    DISPLAY "Even"
ELSE
    DISPLAY "Odd"
END IF

7.4 Validation vs Verification (AO3)

  • Validation – Does the program do the right thing? (Check against requirements.)
  • Verification – Does the program work correctly? (Testing, trace tables.)

Trace‑Table Example

For the pseudocode above, trace the values when number = 7 and number = 12.


8. Programming Concepts (Syllabus Block 8)

8.1 Variables & Data Types

Data TypeTypical Range / Example
INTEGER‑2,147,483,648 to 2,147,483,647
REALFloating‑point numbers, e.g., 3.14
STRING(n)Text up to *n* characters, e.g., STRING(30)
BOOLEANTRUE / FALSE
CHARSingle character

8.2 Control Structures

  • Sequence – statements executed one after another.
  • SelectionIF … THEN … ELSE … END IF or CASE.
  • IterationWHILE … DO … END WHILE or FOR … TO … NEXT.

8.3 Arrays (AO2)

An array stores a collection of values of the same type, indexed from 0 (or 1) to *n‑1*.

DECLARE scores[5] AS INTEGER
FOR i FROM 0 TO 4 DO
    READ scores[i]
END FOR

8.4 Simple File Handling (AO2)

OPEN "students.txt" FOR READ AS f
WHILE NOT EOF(f) DO
    READ line FROM f
    DISPLAY line
END WHILE
CLOSE f

Mini‑Programming Task (AO3)

Write pseudocode for a menu‑driven program that lets the user:

  1. Enter a new student record (ID, name, mark).
  2. Display all records.
  3. Search for a record by ID.
  4. Exit.

9. Databases – Defining a Single‑Table Database (Syllabus Block 9)

9.1 When a Single‑Table Design Is Appropriate

  • Only one entity (e.g., books, students, products).
  • No one‑to‑many or many‑to‑many relationships.
  • All attributes fit comfortably in one relational table.
  • Simple validation rules are sufficient.

9.2 Systematic Design Steps (AO2)

  1. Read the requirements. Identify the entity.
  2. List distinct data items. These become candidate fields.
  3. Select a primary key. Must be unique, non‑null, stable, and as short as possible.
  4. Choose data types. Use the syllabus list: INTEGER, REAL, STRING(n), CHAR(n), BOOLEAN, DATE.
  5. Define constraints. NOT NULL, CHECK, UNIQUE, etc.
  6. Order fields logically. Primary key first.
  7. Write the SQL CREATE TABLE statement.
  8. Insert sample records and test with SELECT.
  9. Validate against the original checklist.

9.3 Worked Example – Library Book Register

Requirements

  1. Unique identification number (ISBN).
  2. Title.
  3. Author(s).
  4. Year of publication.
  5. Genre.
  6. Number of copies owned.
  7. Availability status (at least one copy not on loan).

Field Mapping Table

RequirementField NameData Type (syllabus)Constraints / Notes
Unique identification numberISBNSTRING(13)Primary Key, exactly 13 characters
TitleTitleSTRING(255)NOT NULL
Author(s)AuthorSTRING(255)Multiple authors separated by commas
Year of publicationPubYearINTEGERCHECK (PubYear ≥ 1900)
GenreGenreSTRING(50)Pre‑defined list (Fiction, History, …)
Number of copies ownedCopiesOwnedINTEGERCHECK (CopiesOwned ≥ 0)
Availability statusIsAvailableBOOLEANTRUE if CopiesOwned > CopiesOnLoan

SQL Implementation

CREATE TABLE
CREATE TABLE Books (
  ISBN STRING(13) PRIMARY KEY,
  Title STRING(255) NOT NULL,
  Author STRING(255) NOT NULL,
  PubYear INTEGER CHECK (PubYear >= 1900),
  Genre STRING(50),
  CopiesOwned INTEGER CHECK (CopiesOwned >= 0),
  IsAvailable BOOLEAN NOT NULL
);


INSERT a sample record
INSERT INTO Books (ISBN, Title, Author, PubYear, Genre, CopiesOwned, IsAvailable)
VALUES ('9780140449136', 'The Odyssey', 'Homer', 1996, 'Literature', 3, TRUE);


SELECT – exam style
SELECT Title, Author FROM Books WHERE IsAvailable = TRUE ORDER BY Title;

UPDATE – change availability after a loan
UPDATE Books SET IsAvailable = FALSE WHERE ISBN = '9780140449136' AND CopiesOwned = 1;

DELETE – remove a book
DELETE FROM Books WHERE ISBN = '9780140449136';

Primary‑Key Reminder (AO1)

  • Unique for every record.
  • Never NULL.
  • Stable – value does not change.
  • Prefer short, simple keys (numeric auto‑numbering is common, but ISBN works here).

Field‑Validation Examples (AO3)

  • ISBN: exactly 13 alphanumeric characters.
  • PubYear: CHECK (PubYear BETWEEN 1900 AND 2025).
  • CopiesOwned: CHECK (CopiesOwned >= 0).
  • IsAvailable: Boolean – must be TRUE/FALSE.

Design Checklist (AO3)

  1. All requirements represented as fields? Yes
  2. Unique, non‑null primary key? Yes – ISBN
  3. Appropriate data types chosen? Yes
  4. Constraints enforce valid data? Yes
  5. No redundant information? No

Algorithmic View – Searching the Table (Pseudocode)

PROCEDURE FindAvailableBooksByGenre(genre)
    SET result TO empty list
    FOR each record IN Books DO
        IF record.Genre = genre AND record.IsAvailable = TRUE THEN
            ADD (record.Title, record.Author) TO result
        END IF
    END FOR
    SORT result BY Title ASCENDING
    RETURN result
END PROCEDURE

This mirrors the SQL:

SELECT Title, Author FROM Books WHERE Genre='Science' AND IsAvailable=TRUE ORDER BY Title;

Simple Table Diagram (Exam‑style)

Books table diagram
Fields listed vertically; the primary key (ISBN) is underlined.

10. Boolean Logic & Logic Gates (Syllabus Block 10)

10.1 Truth Tables

OperatorSymbolTruth Table
AND
A B | A∧B
0 0 | 0
0 1 | 0
1 0 | 0
1 1 | 1
OR
A B | A∨B
0 0 | 0
0 1 | 1
1 0 | 1
1 1 | 1
NOT¬
A | ¬A
0 | 1
1 | 0
NANDInverse of AND.
NORInverse of OR.
XORTrue when inputs differ.

10.2 Simple Logic Gate Diagram

AND feeding into OR
Two inputs → AND gate → OR gate → output.

10.3 Using Logic in Programming (AO2)

IF (score >= 50) AND (attendance >= 75) THEN
    DISPLAY "Pass"
ELSE
    DISPLAY "Fail"
END IF

Practice Question (AO3)

Design a Boolean expression that is true only when a student has either (a) a mark ≥ 80 or (b) a mark ≥ 70 and attendance ≥ 90%.


Quick‑Reference Sheet – All Ten Syllabus Topics

TopicKey Points for Revision
1 Data RepresentationBinary, hex, two’s‑complement, shifts, binary arithmetic.
2 Data TransmissionPacket structure, switching, USB/Ethernet, error detection, basic encryption.
3 HardwareVon Neumann model, CPU components, cache, cores, embedded systems.
4 I/O Devices & SensorsKeyboard, mouse, scanner, microphone, common sensors and their data types.
5 Data Storage & CompressionBits/bytes, IEC prefixes, file‑size calculations, lossless vs lossy compression.
6 Network Hardware & InternetNIC, router, switch, MAC/IP addressing, DNS, HTTP/HTTPS request cycle.
7 Algorithm DesignDecomposition, flowchart symbols, pseudocode, validation vs verification.
8 Programming ConceptsVariables, data types, sequence, selection, iteration, arrays, file handling.
9 DatabasesSingle‑table design, primary‑key rules, field validation, CREATE/INSERT/SELECT/UPDATE/DELETE, example library register.
10 Boolean Logic & GatesTruth tables, AND/OR/NOT/NAND/NOR/XOR, simple gate diagrams, Boolean expressions in code.

Use this sheet as a final checklist before the exam – make sure you can recall a key point for each topic (AO1), write a short example (AO2), and explain why a particular choice is appropriate (AO3).

Create an account or Login to take a Quiz

32 views
0 improvement suggestions

Log in to suggest improvements to this note.