Character versus text fields

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

Character versus text fields

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which data type should a Gender field storing M or F use?
A Text
B Character
2. Which data type should a Name field storing values like 'Priya' and 'Alexander' use?
A Text
B Character
3. Which statement about a character field is correct?
A It holds exactly one character
B It holds a string of any length
4. A Grade field stores one letter from A to E. Which type fits best?
A Character
B Text
5. A Postcode field stores values like 'SW1A 2AA'. Which type fits best?
A Character
B Text

Match the Pairs

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

Left columnRight column
1Gender CHAR AGrade CHAR
2Surname TEXT BA first name has many characters, so it cannot be stored in a character field. It should be TEXT.
3A grade from A to E is one symbol, so use a character field CA field that stores exactly one character, such as M or F
4A postcode such as SW1A 2AA has several characters, so use a text field DA postcode has several characters, so it needs a text field. A character field holds only one character, so it should be TEXT.
5FirstName CHAR EA field that stores a string of any length, such as Nguyen
6Postcode CHAR FPostcode TEXT

Definitions

character field

Fill in the Blanks

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

1.
Field: Gender Type: ____ Example: M
2.
Field: Surname Type: ____ Example: Nguyen
3.
Field: Postcode Type: ____ Example: SW1A 2AA
4.
Field: Grade Type: ____ Example: B
5.
A CHAR field holds exactly _ character

Spot the Error

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

Question 1
A Table: Pupil
B Gender - Character (Male)
C Name - Text
Question 2
A Table: Result
B Name - Text
C Postcode - Text
D Grade - Character (Pass, Fail)
Question 3
A Postcode - Character
B Name - Text
C Grade - Character
Question 4
A Table: Club
B Initial - Character
C Surname - Character
Question 5
A Field: Grade
B Type: Character
C Example: AB

Answer Key

Character versus text fields
Section A: Quick Questions
Q1
B — Character
Q2
A — Text
Q3
A — It holds exactly one character
Q4
A — Character
Q5
B — Text
Section B: Match the Pairs
Q1
Gender CHAR → A field that stores exactly one character, such as M or F
Q2
Surname TEXT → A field that stores a string of any length, such as Nguyen
Q3
A grade from A to E is one symbol, so use a character field → Grade CHAR
Q4
A postcode such as SW1A 2AA has several characters, so use a text field → Postcode TEXT
Q5
FirstName CHAR → A first name has many characters, so it cannot be stored in a character field. It should be TEXT.
Q6
Postcode CHAR → A postcode has several characters, so it needs a text field. A character field holds only one character, so it should be TEXT.
Section C: Definitions
Q1
character field — A character field holds exactly one character, like a grade A-E or an M/F code. A text field holds a string of any length, like a name or a postcode.
Section D: Fill in the Blanks
Q1
Field: Gender Type: CHAR Example: M
Q2
Field: Surname Type: TEXT Example: Nguyen
Q3
Field: Postcode Type: TEXT Example: SW1A 2AA
Q4
Field: Grade Type: CHAR Example: B
Q5
A CHAR field holds exactly 1 character
Section E: Spot the Error
Q1
B — A character field holds exactly one character, so the full word Male cannot be stored. The value should be a single letter code such as M.
Q2
D — Pass and Fail are strings of several characters, so they cannot go in a character field. A character grade must be one letter, such as A to E.
Q3
A — A postcode has several characters, such as BS8 1TH, so it needs a text field. A character field holds only one character.
Q4
C — A surname is a string of varying length, so it must be a text field. A character field only holds one character.
Q5
C — The field type is Character, so each value must be exactly one character. AB has two characters; a valid example is A.