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

Choose Boolean, numeric and date/time types

Select Boolean, integer, real or date/time for values with different meanings and precision.

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 represents whether a ticket has been paid?

What you will learn

  • Identify Boolean, integer, real and date/time values
  • Select integer or real according to fractional values
  • Store dates and times as temporal values

Numeric types match the precision required

INTEGER stores whole numbers, such as a number of seats. REAL stores values that may include a fractional part, such as a measured mass or price.

Do not choose REAL automatically for all numbers. Use the type that matches the requirement and the values the field may contain.

Boolean and date/time have specific meanings

BOOLEAN represents two logical states, such as TRUE/FALSE for whether a booking is confirmed.

A date/time type represents a calendar date or time. It allows the value to be understood as temporal data rather than as arbitrary text, when the database supports that type.

Pause and explain

A field stores the number of books borrowed. Which type is most suitable?

Put the idea to work

Worked example

Choose a type for seat count, ticket price with cents, booking confirmed and show date.

Show the worked solution
  1. Seat count is a whole number.
  2. Ticket price can include a fraction.
  3. Confirmed has two states; show date is temporal.

Answer SeatCount: integer; TicketPrice: real; IsConfirmed: Boolean; ShowDate: date/time.

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 types for temperature 21.6, room count 8, and whether a room is occupied.

Give me a hint

Identify fractional, whole-number and two-state values.

Compare my reasoning
  1. Temperature includes a fraction, so use REAL.
  2. Room count is whole, so use INTEGER.
  3. Occupied is TRUE/FALSE, so use BOOLEAN.

Temperature: real; RoomCount: integer; IsOccupied: Boolean.

Look for these in your work

  • Fractional type
  • Count type
  • State type
2 · Independent

Why is a date/time field preferable for a meeting start time than an integer field?

Give me a hint

A time has temporal meaning and rules.

Compare my reasoning
  1. It represents a time value directly.
  2. An integer does not explain whether 930 means 9:30 or a count.
  3. The date/time type makes the value's purpose clearer.

A date/time field identifies the value as a time and avoids an ambiguous integer such as 930.

Look for these in your work

  • Temporal meaning
  • Ambiguity addressed
3 · Transfer

A system stores a measured length to two decimal places and the number of whole items. Explain why the fields should not share one numeric type by default.

Give me a hint

The required precision differs.

Compare my reasoning
  1. Length can be fractional and needs REAL.
  2. Item count is whole and suits INTEGER.
  3. Separate types express the intended values and prevent inappropriate data.

Use REAL for length and INTEGER for item count because one permits fractions and the other represents whole quantities.

Look for these in your work

  • Precision distinguished
  • Types justified

Common mistakes

  • Using REAL for a whole-number count without need
  • Storing TRUE/FALSE as unrelated numbers without a reason
  • Treating a date as a count
Recall without your notes

What can you explain now?

Which type suits a value that may be 12.5?

Compare with the explanation

REAL

REAL can represent a fractional value.

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

What key feature distinguishes INTEGER from REAL?

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.