Structures and linksField types

Information systems like databases are used to store and present information, making it easier to visually interpret and understand, faster to search, update and check for errors.

Part ofComputing ScienceInformation system design and development

Field types

Depending on the information stored, the field type chosen to store it is very important.

Text field

  • Stores words, numbers and other characters such as punctuation marks. Think of a text message in a mobile phone: this is similar to a string variable.
  • Your address, your forename, your postcode and email address are all examples of Text Fields.

Number field

  • Stores both whole numbers and decimal numbers. This is similar to a single/real/integer variable.
  • Your height 1.62m (number field - real), the number of marks in your exam (62/100 number field - integer), and the number of days you have been absent from school (number field - integer)are all number fields.

Date field

  • These store dates. A dentist’s database would keep track of all patients' details. If you are due a check-up, a date field would store when that is.
  • Date of birth, the date of exams and events in a mobile phone calendar all use date fields.

Time field

  • A time field stores a specific time.
  • In a police report, the exact time when an incident took place would use a time field. Any important appointments and meetings would all use a time field to store start and finish times.

Graphic field

  • A graphic field stores pictures and images. A picture on the school database, a profile picture on Facebook, and an image of a product on eBay would all be stored in a graphic field.

Calculated field

  • This could have a type such as Number or Text, but the database works out what to put in there using a formula usually based on the contents of other fields in the record.
  • For example, weekly wages may be calculated by multiplying an hourly pay rate by the number of hours worked.
  • The percentage of attendance at school, age, and weekly wages would all be calculated fields.

Question

Fill in the field types for the following sample record from a database:

Field NameSample DataField Type
ForenameAnn?
SurnameOther?
Home townPortree?
Contract start date24/12/2019?
Height1.68?
Time of inspection08:45?
ID badge number345245?
Field NameForename
Sample DataAnn
Field Type?
Field NameSurname
Sample DataOther
Field Type?
Field NameHome town
Sample DataPortree
Field Type?
Field NameContract start date
Sample Data24/12/2019
Field Type?
Field NameHeight
Sample Data1.68
Field Type?
Field NameTime of inspection
Sample Data08:45
Field Type?
Field NameID badge number
Sample Data345245
Field Type?