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
Description
- Any character
- Includes letters, numbers, and symbols
Example
- &ow5<
Possible uses
- Storing passwords
Alphanumeric
Description
- Letters and numbers only (no symbols or spaces)
Example
- user123
Possible uses
- Usernames
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
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
Description
- Numbers with a currency symbol, decimal point, and two decimal places
Example
- £9.99
Possible uses
- Price of a product
Decimal / Real
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
Description
- A whole number
Examples
- 42
Possible uses
- Recording quantities of a product in stock
Percentage
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