aimnova.
DashboardMy LearningPaper MasteryStudy Plan

Aimnova site navigation

Stay in the loop

Get the latest study resources and updates

New features, study tips and exam insights — straight to your inbox.

IB Diploma

  • IB Past Papers
  • IB Study Notes
  • IB Question Bank
  • IB Mock Exams
  • IB Revision

IB Subjects

  • IB Math AA
  • IB Math AI
  • IB Economics
  • IB Business Management
  • IB Physics
  • IB Biology
  • View all IB subjects→

IB Past Papers

  • IB Math AA HL Past Papers
  • IB Math AA SL Past Papers
  • IB Math AI HL Past Papers
  • IB Math AI SL Past Papers
  • IB Economics HL Past Papers
  • IB Economics SL Past Papers
  • IB ESS Past Papers
  • View all past papers→

Study Resources

  • Study Notes
  • Question Bank
  • Mock Exams
  • Flashcards
  • Revision Guide
  • Exam Skills
  • Command Terms
  • Grade Calculator
  • Exam Timetable 2026

Aimnova

  • Features
  • Pricing
  • For Schools
  • For Parents
  • About Us
  • Blog
  • Contact
aimnova.

AI-powered study platform for smarter revision, past-paper analysis and examiner-style feedback.

TermsPrivacyCookies·© 2026 Aimnova. All rights reserved.8afc4e3

Aimnova is not affiliated with or endorsed by the International Baccalaureate Organization (IB).

NotesComputer ScienceTopic 3.2Data types
Back to Computer Science Topics
3.2.34 min read

Data types

IB Computer Science • Unit 3

Smart study tools

Turn reading into results

Move beyond passive notes. Answer real exam questions, get AI feedback, and build the skills that earn top marks.

Get Started Free

Contents

  • Every column declares what it holds
  • The common types
  • What the wrong type costs
  • Exam-style question
The big idea: A column's data type says what kind of value may be stored in it.

It is not a suggestion: the database refuses anything that does not fit, which is the first line of defence against bad data.
It decides more than storage: The type also decides what you can do with the values.

You can add numbers and sort dates in real order. Do the same to text and you get nonsense — "10" sorts before "9".

Free preview

This is the free notes preview

You're reading the free notes. Aimnova Pro unlocks the full study experience — and you can try it with your first topic free to keep:

  • FlashcardsLock in vocabulary and key terms with spaced repetition.
  • Practice questionsAnswer exam-style questions and get instant AI marking.
  • Mock exams & past-paper vaultSit full mocks and see exactly how examiners award marks.
  • Personalised study planA daily plan built around your exam date and weak areas.
Start Studying Free Full access to Aimnova Pro · cancel anytime

Numbers

  • Integer — whole numbers: a quantity, an ID, a year
  • Decimal — exact fractions: money, measurements
  • Float — approximate fractions, for scientific values
  • Never use float for money; small rounding errors accumulate

Text

  • Char — fixed length, padded: a two-letter country code
  • Varchar — variable length up to a limit: a name, an address
  • Text — long free text, with no practical limit
  • Varchar is the usual choice for anything human-written

Everything else

  • Date and DateTime — real dates, sortable and subtractable
  • Boolean — true or false, for a yes-or-no fact
  • Currency where the system offers it, for exact money
  • Each exists because the alternative is storing it as text
The test for choosing: Ask: will I ever calculate with it, compare it, or sort it?

If yes, it needs a real type. If it is only ever displayed — a phone number, a postcode — text is correct, even though it looks like a number.

Feeling unprepared for exams?

Get a clear study plan, practice with real questions, and know exactly where you stand before exam day. No more guessing.

Get Exam Ready FreeYour first topic is free to keep • No credit card required
1

A date stored as text

2

A number stored as text

3

A phone number stored as a number

4

Money stored as float

Consistency across tables: A foreign key must be the same type as the primary key it points at.

If StudentID is an integer in one table and text in another, joining them either fails or silently returns nothing.

How this is tested — you must name the type AND the specific problem the wrong choice would cause. It comes up two ways:

Paper 1 Section A

  • Outline or choose data types for given columns, 2-4 marks
  • State the effect of a wrong choice
  • Explain why type consistency matters

Paper 1 Section B — case study

  • Choose types for the case study's tables
  • Identify a poor choice in a given design
The classic trap: Choosing a number type because the values look like digits. A phone number, a postcode and a product code are all text — the test is whether you would ever calculate with them.
IB-style questionOutline[4 marks]

A clinic stores: patient ID, date of birth, phone number and consultation fee. Outline a suitable data type for each, with a reason.

Model answer plan

See the mark-by-mark plan — for / against / judgement, with marking guidance — in study mode.

Claim your free topic

Try an IB Exam Question — Free AI Feedback

Test yourself on Data types. Write your answer and get instant AI feedback — just like a real IB examiner.

what is meant by a null value. [2 marks]

Related Computer Science Topics

Continue learning with these related topics from the same unit:

3.1.1Relational databases
3.2.1Database schemas
3.2.2ERDs
3.2.4Building tables
View all Computer Science topics

Improve your exam technique

Command terms, paper structure, and mark-scheme tips for Computer Science

Previous
3.2.2ERDs
Next
Building tables3.2.4

20 questions to test your understanding

Reading is just the start. Students who tested themselves scored 82% on average — try IB-style questions with AI feedback.

Start FreeView All Computer Science Topics