Data Types

Data Types

When designing a database, consideration needs to be given to the data type of the field.

  • Text
  • Number
  • Date
  • Time
  • Graphics
  • Calculation
  • Link
  • Boolean
  • Key Field

Text

Used to store letters of the alphabet or a mixture of letters and numbers such as postcode

Examples:

Name:  Gavin McLeod

Registration:  SN62 FHV    

Mobile:  07545661120

 

Number

Integer  used to store whole numbers with no decimal point

Real  used to store numbers which could be decimals

Examples:

Year Established:  2005

Days Absence:  4

Weight:  12.5

 

Date

Used to store a day, month or year using a variety of formats

Examples:

Date of Birth: 31/05/2003

Date of Employment: 3 July 2020

 

Time

Used to store hours, minutes and seconds

Examples:

Appointment: 16:50

Period End: 12:45

 

Graphics

Used to store a different type of data file such as graphics, sound or video

Examples:

Club Crest

 

 

 

 

Photograph: 

 

 

 

 

Calculation

Calculations can be performed on fields using a formula

Examples:

Total Pupils

A database stores the details of each tutor class in a school. One of the fields is a numeric field called Pupils, which stores the number of pupils in the class. Total Pupils is a calculated field, adding the Pupils field from each record

Average Bill

A database stores the details of a shopping bills in a supermarket. One of the fields is a numeric field called Total Bill which stores the amount of each bill. Average Bill is a calculated field to determine the average of each bill.

 

Link

A web link

Examples:

Official Band Home Page:  www.foofighters.com

 

Contact Page:  www.vodafone.co.uk/contact-us

 

Boolean

A Boolean can store one of two values, True or False (or Yes/No)

Examples:

Club Member:  True

Driving Licence:  False

 

Key Field

Unique field that stores the key for each record

Examples:

Student ID: 07151102

Product ID: B-1201-FG7315