Field types
When creating tables in a database, it is necessary to define the type of data that will be held in each field.
Text field
- Stores words, numbers and other characters such as punctuation marks. A forename, surname and postcode are all examples of text fields.
Number field
- Stores both whole numbers and decimal numbers
- Within database packages, it is possible to define the number of values that can appear after a decimal place if storing decimal numbers
Date field
- Dates can be stored using the date field type
- Date of birth, the date of exams and events in a mobile phone calendar are all stored as date fields
- Within database packages, it is possible to set the format for how a date appears on screen e.g. dd/mm/yyyy
- Some packages use one field type to store date/time
Time field
- A time field stores a specific time
- Within database packages, it is often possible to set the format for how a time appears on screen
- Some packages use one filed type to store date/time
Boolean field
- A Boolean field stores either true or false, often showing on screen as Yes or No
- An organisation could use this to see if a member would like a newsletter or not.
Question
Fill in the field types for the following sample record from a database:
Field Name | Sample Data | Field Type |
Forename | Malcolm | ? |
Surname | Hector | ? |
Security level | 6 | ? |
Start date | 24/12/2015 | ? |
ID badge number | 4574675 | ? |
Field duty | Yes | ? |
Hours worked | 55 | ? |
Wages per hour | 10 | ? |
Field Name | Forename |
---|---|
Sample Data | Malcolm |
Field Type | ? |
Field Name | Surname |
---|---|
Sample Data | Hector |
Field Type | ? |
Field Name | Security level |
---|---|
Sample Data | 6 |
Field Type | ? |
Field Name | Start date |
---|---|
Sample Data | 24/12/2015 |
Field Type | ? |
Field Name | ID badge number |
---|---|
Sample Data | 4574675 |
Field Type | ? |
Field Name | Field duty |
---|---|
Sample Data | Yes |
Field Type | ? |
Field Name | Hours worked |
---|---|
Sample Data | 55 |
Field Type | ? |
Field Name | Wages per hour |
---|---|
Sample Data | 10 |
Field Type | ? |
Field Name | Sample Data | Field Type |
Forename | Malcolm | Text |
Surname | Hector | Text |
Security level | 6 | Number |
Start date | 24/12/2015 | Date |
ID badge number | 4574675 | Number |
Field duty | Yes | Boolean |
Hours worked | 55 | Number |
Wages per hour | 10 | Number |
Field Name | Forename |
---|---|
Sample Data | Malcolm |
Field Type | Text |
Field Name | Surname |
---|---|
Sample Data | Hector |
Field Type | Text |
Field Name | Security level |
---|---|
Sample Data | 6 |
Field Type | Number |
Field Name | Start date |
---|---|
Sample Data | 24/12/2015 |
Field Type | Date |
Field Name | ID badge number |
---|---|
Sample Data | 4574675 |
Field Type | Number |
Field Name | Field duty |
---|---|
Sample Data | Yes |
Field Type | Boolean |
Field Name | Hours worked |
---|---|
Sample Data | 55 |
Field Type | Number |
Field Name | Wages per hour |
---|---|
Sample Data | 10 |
Field Type | Number |