GoalName the four data types and choose the right data type for a field.
New words
data type · the kind of data that a field can storenumber · a value that you can count or calculate withdate/time · a date or a time of dayyes/no · a field that can hold only “Yes” or “No”
Explanation
Every field has a data type. The data type tells the computer what kind of data the field may hold. Text can hold letters, digits and symbols, such as a name or a phone number. Number holds numbers that we can add, count and compare, such as a weight. Date/Time holds a date or a time. Yes/No holds only the word Yes or the word No. A phone number is text, because nobody adds phone numbers and many start with 0 or +. Calculations only work on the type Number. The data type of a field stays the same for every record.
Field
Example
Data type
Name
Pip
Text
Species
penguin
Text
Date born
12/03/2019
Date/Time
Weight (kg)
6
Number
Plant eater
No
Yes/No
Worked examples
Fact
Add two of them?
Data type
weight in kg
yes, for a total weight
Number
goals scored
yes, for a total
Number
phone number
no, it makes no sense
Text
postcode
no
Text
Can we calculate with it? That is a good test for the type Number.
Data entered
Field type
Allowed?
Maybe
Yes/No
no
8
Number
yes
eight
Number
no
12/05/2022
Date/Time
yes
A field only accepts data that matches its type. A computer will refuse the wrong data.
Field
Data type
Player name
Text
Goals this year
Number
Date joined
Date/Time
Is captain
Yes/No
A table about a football club needs all four types. Each field has the data type that fits.
Class activity
Type sort (with family): write ten facts on small cards, for example a first name, a shoe size, a birthday, “Do you like swimming? Yes”, your age, a favourite colour, the time you get up, the number of books you own, a street name and a postcode. Make four piles: Text, Number, Date/Time and Yes/No. Which card was hardest to place? Why? Check each card in the Number pile: would it make sense to add two of them?
Practice
1
Choose the data type for each field: Text, Number, Date/Time or Yes/No.
Field
Data type
A Pet name
?
B Goals scored
?
C Birthday
?
D Has a bike
?
E Phone number
?
A Text, B Number, C Date/Time, D Yes/No, E Text (a phone number is text).
2
Which of these can be entered in a field of the type Number: 12, 12.5, twelve, 12 cm?
12 and 12.5. “twelve” and “12 cm” contain letters.
3
Why can you not do calculations with the data type Text?
Text may contain letters and symbols, so the computer cannot add it up. Only numbers can be calculated with.
4
A zoo keeper wants to store whether each animal has seen the vet this year, and how many times. Name the two fields she needs and give each one a data type.
For example: Seen vet this year (Yes/No) and Number of vet visits (Number).