Learn in your language
Skip to content
IGCSE · Cambridge (CIE) · 0478

Choose text and character data types

Use text or alphanumeric data for labels and codes, and CHAR when a field contains one character.

Cambridge IGCSE Computer Science 0478 · Databases · 2026–2028 Version 6 · Topic 9
Exam scope and assessment notes

This sequence follows Cambridge IGCSE Computer Science 0478, 2026–2028 syllabus Version 6, Topic 9. It covers single-table databases only and the specified SELECT, FROM, WHERE, ORDER BY, SUM, COUNT, AND and OR content. The official specimen also demonstrates NOT in a filter. Multi-table joins, GROUP BY, database implementation and the separate 2029–2031 syllabus are not mapped here. Practice is original, self-checked and does not award an official Cambridge grade. Full timed papers and human subject-teacher review remain outstanding.

Before you begin

  • Be able to read a small table and compare values. Each lesson introduces the database and SQL terms it uses.

Work on paper. Try each question before revealing help, and explain why your method works.

Quick readiness check

Which type best fits a field that contains a full surname?

What you will learn

  • Distinguish alphanumeric text from a single character
  • Preserve leading zeros and letters in codes
  • Choose a type that matches how the value is used

Text keeps symbols and letters together

Text or alphanumeric fields store names, labels and codes that may contain letters, digits or punctuation. Examples include a learner name, room label or code such as 0047A.

A code is not automatically a number just because it contains digits. If arithmetic is never performed and leading zeros matter, store it as text.

CHAR stores one character

Use a character type when exactly one character is required, such as a grade letter or a single initial.

If the value may contain several characters, use text instead. Match the type to the maximum intended content and how the program uses the field.

Pause and explain

A centre code is 0072 and is never used in arithmetic. Which choice is safest?

Put the idea to work

Worked example

Choose types for a learner name, a product code 0031X and a one-letter grade.

Show the worked solution
  1. The name contains several characters.
  2. The product code mixes digits and a letter, and its zero prefix matters.
  3. The grade contains one character.

Answer LearnerName: text/alphanumeric; ProductCode: text/alphanumeric; Grade: character.

Try a topic test

Choose Easy, Normal or Difficult. Save your answers and open worked review after finishing.

Test this topic →

From guided practice to a new situation

Write your answer and reasoning first. Use a hint only if you are stuck. The model solution is for self-checking; your written work is not automatically marked.

1 · Guided

Choose between character and text for a field that holds either A or B.

Give me a hint

The field always stores exactly one symbol.

Compare my reasoning
  1. There are only two possible letters.
  2. Each value contains one character.
  3. CHAR is suitable.

Use a character type because every value is exactly one character.

Look for these in your work

  • Length recognised
  • Type selected
2 · Independent

A bus route code is M07. Explain why it should be text rather than an integer.

Give me a hint

Consider whether the value is calculated or identified.

Compare my reasoning
  1. The code contains a letter.
  2. The initial zero is meaningful.
  3. Text preserves the code exactly as shown.

Use text because it contains a letter and identifies a route; it is not a number to calculate with.

Look for these in your work

  • Content assessed
  • Identifier role
3 · Transfer

A field called Initial stores the first letter of a person's name, while FullName stores the whole name. Choose a type for each.

Give me a hint

Check the expected number of characters.

Compare my reasoning
  1. Initial contains one character.
  2. FullName contains multiple characters.
  3. Use distinct types to match the two field shapes.

Initial: character; FullName: text/alphanumeric.

Look for these in your work

  • Single character type
  • Multiple-character type

Common mistakes

  • Storing a code as an integer and losing leading zeros
  • Using CHAR for a full name
  • Assuming digits always mean arithmetic data
Recall without your notes

What can you explain now?

Why is text suitable for code 0031X?

Compare with the explanation

It can preserve letters and leading zeros

The value is an identifier, not a quantity for calculation.

After trying it yourself, choose your next review. This is your self-assessment.

Your review choice appears on Today. Sign in to sync it across devices.

Make it stick

When should a digit-containing value be stored as text?

If you needed the solution, close it and solve the problem again from a blank page. A correct answer is stronger when you can explain the reason for each step.

Keep learning Computer Science

Course scope and assessment

165 original lessons map the listed objectives across all 10 main topics in the 2026–2028 Version 6 syllabus, with worked explanations and guided, independent and transfer practice. This is mapped teaching coverage, not proof of full exam readiness. Three earlier starter lessons remain available but are not counted as syllabus-mapped teaching. Practical programming experience in an executable browser workspace, full timed-paper practice, human subject-teacher review and the separate 2029–2031 syllabus remain outstanding. Practice is self-checked and does not award an official Cambridge grade.

StudyForA · Learn with understanding

Original teaching content and links to official sources. Check your exam year and qualification before using a resource.