Database field data types

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Database field data types

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

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)
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
3. True or false: A data type controls what kind of values a field will accept.
A True
B False
4. A field called Birthday needs to store 14/03/2012. Which data type is the best choice?
A Date
B Yes/No
5. A field called HasPermissionSlip only holds the answer 'yes' or 'no'. Which data type fits?
A Decimal
B Yes/No

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

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

Definitions

data type

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
Field: FirstName Data type: __________
2.
Field: Age Data type: _______
3.
Field: Price Data type: _______
4.
Field: BirthDate Data type: ____
5.
Field: IsMember Data type: ______

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A TABLE Students
B FirstName: Yes/No
C Age: Integer
D Enrolled: Yes/No
Question 2
A Price: Integer (e.g. 4.50)
B Quantity: Integer (e.g. 3)
C InStock: Yes/No
Question 3
A TABLE Movies
B Title: Short Text
C Summary: Date
D Length: Integer
Question 4
A TABLE Events
B Cost: Date
C StartDate: Date
Question 5
A IsMember: Date (Yes or No)
B Name: Short Text
C Score: Integer

Answer Key

Database field data types
Section A: Quick Questions
Q1
B — Integer (whole number)
Q2
A — Price, such as 4.95
Q3
A — True
Q4
A — Date
Q5
B — Yes/No
Section B: Match the Pairs
Q1
Age: Number (integer) → The Age field only accepts whole numbers like 12 or 13, with no decimal part.
Q2
Birthday: Date → The Birthday field only accepts a valid calendar date, like 14/03/2012.
Q3
A yes/no field can only hold one of two values, like true or false. → HasPermissionNote: Yes/No
Q4
A decimal number field stores values with parts of a whole, such as a price or a height. → Price: Number (decimal)
Q5
Height_m: Number (integer) -> 1.65 → A height like 1.65 has a decimal part, so it cannot be stored in an integer field.
Q6
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.
Section C: Definitions
Q1
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.
Section D: Fill in the Blanks
Q1
Field: FirstName Data type: Short text
Q2
Field: Age Data type: Integer
Q3
Field: Price Data type: Decimal
Q4
Field: BirthDate Data type: Date
Q5
Field: IsMember Data type: Yes/No
Section E: Spot the Error
Q1
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.
Q2
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.
Q3
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.
Q4
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.
Q5
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.