Choose Boolean, numeric and date/time types
Select Boolean, integer, real or date/time for values with different meanings and precision.
Exam scope and assessment notes
This sequence follows Cambridge IGCSE Computer Science 0984, 2026–2028 syllabus Version 4, 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. Cambridge states that 0984 has the same 2026–2028 subject content as 0478, with 9–1 grading. In June and November, Cambridge lists 0984 in Administrative zone 3 and for centres in Oman and the UAE. Confirm availability for your centre and exam series with Cambridge International. The separately published 2029–2031 syllabus changes to Python 3 only and removes pseudocode; this 2026–2028 route does not cover those changes.
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?
Worked example
Choose a type for seat count, ticket price with cents, booking confirmed and show date.
Show the worked solution
- Seat count is a whole number.
- Ticket price can include a fraction.
- 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.
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
- Temperature includes a fraction, so use REAL.
- Room count is whole, so use INTEGER.
- 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
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
- It represents a time value directly.
- An integer does not explain whether 930 means 9:30 or a count.
- 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
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
- Length can be fractional and needs REAL.
- Item count is whole and suits INTEGER.
- 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
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.