← VCE Spreadsheets, SQL & Visualisation

Database field data types

The kind of value a database field accepts, such as text, number, date or yes/no. It stops the wrong kind of data being entered, like words in a number field.

Understanding Database field data types in VCE Spreadsheets, SQL & Visualisation

What it does: The Yes/No data type limits a field to two choices, which suits questions that have a yes or no answer. Ages are whole numbers, so an integer field is the best fit. A long text field is for paragraphs, not numbers. Prices often include cents, so they need decimals. The number of siblings is always a whole number. Birthdays are dates, so a date type is best. It also lets the database sort them in the right order. An appointment has a date and a time, so date/time suits it. A favourite colour is just text. A date data type makes sure the value is a real date and not random words or numbers.

Common mistakes: A first name is made of letters, so it needs a Short Text field. A Yes/No field only accepts yes or no. It should be FirstName: Short Text. A price like 4.50 has cents, so it needs a Decimal field. An Integer field only holds whole numbers. It should be Price: Decimal.

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 35–44) and word search (Modules 35–54).

Take this worksheet further — free with Cloodit

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

Learning
Duo
A database field called Age stores whole numbers like 12 or 13. Which data type fits best?
Long textInteger (whole number)
Matches
Height_m: Number (integer) -> 1.65
↓
A height like 1.65 has a decimal part, so it cannot be stored in an integer field.
Applying
Meanings
Term
data type
Meaning
The kind of value a database field accepts, such as text, number, date or yes/no. It stops the wrong kind of data being entered, like words in a number field.
Practice
Table: Students
Testing
Gaps
Data type:
Check Answer
Spots
1TABLE Students
2FirstName: Yes/No

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

The 'Galaxy Phoenix' badge — Orbit Champion, 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 database field called Age stores whole numbers like 12 or 13. Which data type fits best?
A. Long text
B. Integer (whole number) ✓
Ages are whole numbers, so an integer field is the best fit. A long text field is for paragraphs, not numbers.
2. Which field should use a decimal (number with a decimal point) data type?
A. Price, such as 4.95 ✓
B. Number of siblings, such as 2
Prices often include cents, so they need decimals. The number of siblings is always a whole number.
3. True or false: A data type controls what kind of values a field will accept.
A. True ✓
B. False
A data type sets the kind of value allowed. For example, a number field will refuse the word 'banana'.
4. A field called Birthday needs to store 14/03/2012. Which data type is the best choice?
A. Date ✓
B. Yes/No
Birthdays are dates, so a date type is best. It also lets the database sort them in the right order.
5. A field called HasPermissionSlip only holds the answer 'yes' or 'no'. Which data type fits?
A. Decimal
B. Yes/No ✓
A field with only two possible answers suits a Yes/No data type.

Match the Pairs

Age: Number (integer) → The Age field only accepts whole numbers like 12 or 13, with no decimal part.
Birthday: Date → The Birthday field only accepts a valid calendar date, like 14/03/2012.
A yes/no field can only hold one of two values, like true or false. → HasPermissionNote: Yes/No
A decimal number field stores values with parts of a whole, such as a price or a height. → Price: Number (decimal)
Height_m: Number (integer) -> 1.65 → A height like 1.65 has a decimal part, so it cannot be stored in an integer field.
Comments: Short text (255 chars) -> a 3-paragraph review → A long review will not fit in a short text field, which only holds a few words or a short phrase.

Key Term

data type
The kind of value a database field accepts, such as text, number, date or yes/no. It stops the wrong kind of data being entered, like words in a number field.

Fill in the Blanks

1. Field: FirstName Data type: Short text
Hint: Type the data type for brief words, like a person's name.
2. Field: Age Data type: Integer
Hint: Type the number data type for whole numbers with no decimal point.
3. Field: Price Data type: Decimal
Hint: Type the number data type that can store cents, such as 4.95.
4. Field: BirthDate Data type: Date
Hint: Type the data type used to store a calendar day.
5. Field: IsMember Data type: Yes/No
Hint: Type the data type for a field with only two possible choices, true or false.

Spot the Error

Question 1
A TABLE Students
B FirstName: Yes/No
C Age: Integer
D Enrolled: Yes/No
Line B — A first name is made of letters, so it needs a Short Text field. A Yes/No field only accepts yes or no. It should be FirstName: Short Text.
Question 2
A Price: Integer (e.g. 4.50)
B Quantity: Integer (e.g. 3)
C InStock: Yes/No
Line A — A price like 4.50 has cents, so it needs a Decimal field. An Integer field only holds whole numbers. It should be Price: Decimal.
Question 3
A TABLE Movies
B Title: Short Text
C Summary: Date
D Length: Integer
Line C — A summary is a paragraph of words, so it needs a Long Text field. A Date field only accepts dates. It should be Summary: Long Text.
Question 4
A TABLE Events
B Cost: Date
C StartDate: Date
Line B — A cost is an amount of money, so it needs a Decimal (number) field. A Date field would reject amounts like 12.50. It should be Cost: Decimal.
Question 5
A IsMember: Date (Yes or No)
B Name: Short Text
C Score: Integer
Line A — A field that only holds Yes or No should use the Yes/No data type. A Date field would reject those values. It should be IsMember: Yes/No.

Student with a class code? Join your class →