← VCE Data Analysis

Choosing a data type for a value

Pick the data type by what you will do with the value: calculate (number), sort by date (date/time), test true or false (Boolean). Postcodes are text, not numbers, as you never do maths on them.

Understanding Choosing a data type for a value in VCE Data Analysis

What it does: A date/time type lets a system sort and compare values by time, which plain text cannot do correctly. Yes/no values are tested as true or false, so Boolean is the type that matches how the value is used. Postcodes are labels, not quantities. Stored as an integer, 0800 would lose its leading zero and become 800. Prices with cents have decimal places, so floating point is used. An integer would drop the cents and give wrong totals. A value made of digits is not always a number. Phone numbers and postcodes look numeric but are never used in calculations, so they are text.

Common mistakes: Postcodes are never used in calculations, so they should be Text. An Integer drops leading zeros (0800 becomes 800). The line should be Postcode : Text. InStock is tested as true or false, so it should be Boolean. Text would let any word be stored and makes true/false tests unreliable. It should be InStock : Boolean.

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 15–24) and word search (Modules 3–24).

Take this worksheet further — free with Cloodit

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

Learning
Duo
A school database stores a student's postcode, such as 0800 for a remote area. Which data type is best?
Integer, because a postcode is made of digitsText, because you never do maths on a postcode
Matches
postcode: Integer (0800 is stored as 800)
↓
Postcode was given a number type, so the leading zero is dropped and the postcode is now wrong
Applying
Meanings
Term
data type
Meaning
Pick the data type by what you will do with the value: calculate (number), sort by date (date/time), test true or false (Boolean). Postcodes are text, not numbers, as you never do maths on them.
Practice
Postcode : Text (no maths, keeps leading 0)
Testing
Gaps
Postcode:
Check Answer
Spots
1Table: Customer
2Postcode : Integer

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

The 'Moon Jellyfish' badge — Orbital Streak, 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. A school database stores a student's postcode, such as 0800 for a remote area. Which data type is best?
A. Text, because you never do maths on a postcode ✓
B. Integer, because a postcode is made of digits
Postcodes are labels, not quantities. Stored as an integer, 0800 would lose its leading zero and become 800.
2. You want to add up the price of every item in a canteen order, such as $4.50 and $3.95. Which data type suits the price field?
A. Floating point, because prices have cents ✓
B. Integer, because prices are numbers
Prices with cents have decimal places, so floating point is used. An integer would drop the cents and give wrong totals.
3. You need to sort a list of events from earliest to latest. Which data type should store the event day?
A. Text
B. Date/time ✓
Date/time values sort in true calendar order. Text dates such as 10/02/2025 sort letter by letter, so the order can be wrong.
4. A field records whether a student has returned their permission form (yes or no). Which data type is the best choice?
A. Boolean, because the value is only true or false ✓
B. Text, because you type the word Yes or No
When you only need to test true or false, Boolean is the best fit. It is smaller and easier to test than text.
5. Which statement about choosing a data type is correct?
A. Choose the type based on what the value looks like
B. Choose the type based on what you will do with the value ✓
A value made of digits is not always a number. Phone numbers and postcodes look numeric but are never used in calculations, so they are text.

Match the Pairs

postcode: Text → Store a postcode as text because you never do maths on it and it can start with 0 (like 0800)
price: Floating point → Store a price as a number with decimals so you can add, multiply and work out totals
Choose the data type by what you will do with the value, such as sorting events in order of when they happen → event_date: Date/time
A value that you only test as true or false should use the Boolean type → has_paid: Boolean
postcode: Integer (0800 is stored as 800) → Postcode was given a number type, so the leading zero is dropped and the postcode is now wrong
price: Text (total of $5 + $10 gives "510") → Price was given a text type, so values are joined together instead of added, giving a wrong result

Key Term

data type
Pick the data type by what you will do with the value: calculate (number), sort by date (date/time), test true or false (Boolean). Postcodes are text, not numbers, as you never do maths on them.

Fill in the Blanks

1. Postcode: Text
Hint: Type the data type for a value you never do maths on, even though it looks like digits.
2. Price (e.g. 12.50): Floating point
Hint: Type the numeric data type that stores values with cents, such as dollars and decimals.
3. DateJoined: Date/time
Hint: Type the data type that lets you sort records in calendar order.
4. IsMember: Boolean
Hint: Type the data type used when you only need to test true or false.
5. Quantity: Integer Total ← Quantity * 5
Hint: Type the data type for a whole-number count, so the calculation gives a correct result.

Spot the Error

Question 1
A Table: Customer
B Postcode : Integer
C Price : Float
D Joined : Date/time
Line B — Postcodes are never used in calculations, so they should be Text. An Integer drops leading zeros (0800 becomes 800). The line should be Postcode : Text.
Question 2
A Table: Product
B Name : Text
C Price : Float
D InStock : Text
Line D — InStock is tested as true or false, so it should be Boolean. Text would let any word be stored and makes true/false tests unreliable. It should be InStock : Boolean.
Question 3
A Table: Order
B OrderID : Integer
C OrderDate : Text
D Total : Float
Line C — You sort orders by date, so OrderDate needs the Date/time type. As Text, 10/02 would sort before 2/03. It should be OrderDate : Date/time.
Question 4
A price ← 4.50
B qty ← "3"
C total ← price * qty
D OUTPUT total
Line B — The quotes make qty Text, so you can't multiply it by price. A quantity you calculate with should be a whole number: qty ← 3.
Question 5
A Table: Member
B Name : Text
C Postcode : Text
D Age : Text
Line D — Age is used in calculations such as averages and comparisons, so it should be a number. As Text it can't be added or averaged. It should be Age : Integer.

Student with a class code? Join your class →