ComputingRevision.net

3.2.1 Uses of Data in Different Contexts

Data Types

Before data can be processed, it must be stored. Humans are smart: we can understand the context of data, but computers are not smart. They need to be told what type of data they are using so they know how to use it.

Defining Data Types

The data types used in IT are the same as the ones used in Excel with Spreadsheets. They are not the same as used in programming. Your project requires you to ensure you use appropriate data types.

Text Data Types

Text

text
Description
  • Any character
  • Includes letters, numbers, and symbols
Example
  • &ow5<
Possible uses
  • Storing passwords

Alphanumeric

alphanumeric
Description
  • Letters and numbers only (no symbols or spaces)
Example
  • user123
Possible uses
  • Usernames

Boolean

Boolean
Description
  • A data type with only two possible values
Examples
  • TRUE or FALSE
  • YES or NO
Possible uses
  • Managing stock, e.g.: Item in stock? YES
  • Making comparisons, e.g.: 5 > 7 = FALSE

Date

Date
Description
  • Day, month, and year
  • In the UK, written as DD/MM/YYYY
Example
  • Today's date is
Possible uses
  • A deadline in a to-do list
  • A best before date on a food product

Numeric Data Types

Numeric data types are based on numbers. The computer can perform calculations on them and automatically format the number type (e.g. adding a £ symbol to currency).

Currency

Bag of money
Description
  • Numbers with a currency symbol, decimal point, and two decimal places
Example
  • £9.99
Possible uses
  • Price of a product

Decimal / Real

Two little ducks
Description
  • Numbers with a decimal point
  • In programming, these would be a float
Example
  • The weight of a product
Possible uses
  • A deadline in a to-do list
  • A best before date on a food product

Integer

A hole number
Description
  • A whole number
Examples
  • 42
Possible uses
  • Recording quantities of a product in stock

Percentage

Percentages
Description
  • Numbers out of 100, shown with a percentage symbol
Example
  • 42%
Possible uses
  • VAT of 20% is added to the price of a product

Quick Quiz

Click the purple circle to select your answer

A shop system stores the number of items in stock. Which data type should be used?

Real / Decimal
Currency
Boolean
Integer