← IGCSE Computer Science Paper 2

Character versus text fields

A character field holds exactly one character, like a grade A-E or an M/F code. A text field holds a string of any length, like a name or a postcode.

Understanding Character versus text fields in IGCSE Computer Science Paper 2

What it does: A grade is always one letter, so the character data type is the best fit. A postcode is a string of several characters, so it needs a text field, not a character field. Each value is exactly one character, so a character field is the best fit.

Common mistakes: A character field holds exactly one character, so the full word Male cannot be stored. The value should be a single letter code such as M. Pass and Fail are strings of several characters, so they cannot go in a character field. A character grade must be one letter, such as A to E.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 500–522) and word search (Modules 500–538).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which data type should a Gender field storing M or F use?
TextCharacter
Matches
FirstName CHAR
↓
A first name has many characters, so it cannot be stored in a character field. It should be TEXT.
Applying
Meanings
Term
character field
Meaning
A character field holds exactly one character, like a grade A-E or an M/F code. A text field holds a string of any length, like a name or a postcode.
Practice
Gender: character
Testing
Gaps
Type:
Check Answer
Spots
1Table: Pupil
2Gender - Character (Male)

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Fox' badge — Cunning Debugger, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which data type should a Gender field storing M or F use?
A. Text
B. Character ✓
Each value is exactly one character, so a character field is the best fit.
2. Which data type should a Name field storing values like 'Priya' and 'Alexander' use?
A. Text ✓
B. Character
Names have different lengths and are longer than one character, so a text field is needed.
3. Which statement about a character field is correct?
A. It holds exactly one character ✓
B. It holds a string of any length
A character field stores a single character. A text field is the one that stores a string of any length.
4. A Grade field stores one letter from A to E. Which type fits best?
A. Character ✓
B. Text
Each grade is a single letter, so character is the best choice.
5. A Postcode field stores values like 'SW1A 2AA'. Which type fits best?
A. Character
B. Text ✓
A postcode has several characters, so it cannot fit in a character field. Use text.

Match the Pairs

Gender CHAR → A field that stores exactly one character, such as M or F
Surname TEXT → A field that stores a string of any length, such as Nguyen
A grade from A to E is one symbol, so use a character field → Grade CHAR
A postcode such as SW1A 2AA has several characters, so use a text field → Postcode TEXT
FirstName CHAR → A first name has many characters, so it cannot be stored in a character field. It should be TEXT.
Postcode CHAR → A postcode has several characters, so it needs a text field. A character field holds only one character, so it should be TEXT.

Key Term

character field
A character field holds exactly one character, like a grade A-E or an M/F code. A text field holds a string of any length, like a name or a postcode.

Fill in the Blanks

1. Field: Gender Type: CHAR Example: M
Hint: Type the data type for a field that holds a single letter code.
2. Field: Surname Type: TEXT Example: Nguyen
Hint: Type the data type for a name, which can be any length.
3. Field: Postcode Type: TEXT Example: SW1A 2AA
Hint: A postcode has several characters, so type the data type that allows a string.
4. Field: Grade Type: CHAR Example: B
Hint: A grade from A to E is only one symbol, so type the matching data type.
5. A CHAR field holds exactly 1 character
Hint: Type the number of characters a character field can store.

Spot the Error

Question 1
A Table: Pupil
B Gender - Character (Male)
C Name - Text
Line B — A character field holds exactly one character, so the full word Male cannot be stored. The value should be a single letter code such as M.
Question 2
A Table: Result
B Name - Text
C Postcode - Text
D Grade - Character (Pass, Fail)
Line D — Pass and Fail are strings of several characters, so they cannot go in a character field. A character grade must be one letter, such as A to E.
Question 3
A Postcode - Character
B Name - Text
C Grade - Character
Line A — A postcode has several characters, such as BS8 1TH, so it needs a text field. A character field holds only one character.
Question 4
A Table: Club
B Initial - Character
C Surname - Character
Line C — A surname is a string of varying length, so it must be a text field. A character field only holds one character.
Question 5
A Field: Grade
B Type: Character
C Example: AB
Line C — The field type is Character, so each value must be exactly one character. AB has two characters; a valid example is A.

Student with a class code? Join your class →