91热爆

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 field 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.
A database table.

Question

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

Field NameSample DataField Type
ForenameMalcolm?
SurnameHector?
Security level6?
Start date24/12/2015?
ID badge number4574675?
Field dutyYes?
Hours worked55?
Wages per hour10?
Field NameForename
Sample DataMalcolm
Field Type?
Field NameSurname
Sample DataHector
Field Type?
Field NameSecurity level
Sample Data6
Field Type?
Field NameStart date
Sample Data24/12/2015
Field Type?
Field NameID badge number
Sample Data4574675
Field Type?
Field NameField duty
Sample DataYes
Field Type?
Field NameHours worked
Sample Data55
Field Type?
Field NameWages per hour
Sample Data10
Field Type?