The ICT Lounge
 
Section 5.1:
Data Types
 

This section will take a look at the different categories of data that can be used in a computer. We call these categories 'Data Types'.

When we structure data into a spreadsheet or a database we have to tell the computer what data type to use for each piece of data.

Key Concepts of this section:
#
#

#
What is data?
Know what data types are and how to correctly identify them
Be able to select the correct data type for different sets of data
What is Data?
Key Words:
Digital, Analogue, Text, Numbers, Dates
Definition:
"Information that is either digital or analogue and can be manipulated to produce a result."
Overview of data:
Data can exist in many forms. For example:
  • Text (letters/words)
  • Numbers (whole numbers, decimals, currency)
  • Date
 
Examples of Text
Examples of Numbers
Examples of Dates
  • This is text
  • THIS IS TEXT
  • 123456
  • 10.78
  • £99.99
  • -18
  • 19th-Aug-2012
  • 19th-August-12
  • 19-08-2012
  • 19-08-12
Categories of Data:
   
There are two main categories of data:
  • Digital Data - Data that is stored and manipulated on a comuter.
  • Analogue Data - Data which is gathered without a computer.
NOTE!
Digital data is often stored in a database. Databases allow for easy access and searching of the data.
Data Types - Overview
Key Words:
Boolean, Text, Number, Date, Currency, Percentage
 
The main types of data found in a computer system are:
  1. Boolean (True/False) - sometimes also called 'logical'
  2. Text/Alphanumeric
  3. Numeric (Numbers)
  4. Currency (Money)
  5. Percentage
  6. Date/Time

 

 
Examples of Data Types
Boolean
Yes/No - True/False - 1/0
Text/Alphanumeric
22 miles
Numeric
999
Currency
£100
Percentage
50%
Date/Time
21-06-2012 - 17:34PM
The different data types are discussed in more detail below:
Boolean Data

Boolean data can only have one of two values - true or false.

 

Booleans are used when there are only two possible responses to a question. Examples of responses that can be stored as a boolean are:

  • True / False
  • Yes / No
  • On / Off
  • Male / Female
  • 1 or 0
 
NOTE!
Booleans can also be shown using tick boxes:
  • A tick means ON
  • No tick means OFF

For example: "Tick if you agree to the terms of the website"

 
Text/Alphanumeric

Text Data:

# Text data is used for data that is made up of letters only.

 

For example:- a password using the word 'JUPITER' would be regarded as text.

 

Alphanumeric Data:

# Alphanumeric data is used for data that is made up of letters AND numbers.

 

For example:- a password of 'JUPITER123' would be regarded as alphanumeric.

Examples of Text
Examples of Alphanumeric
Dog
 
I have a dog
Cat
 
ABC123
Sunshine
 
SR67JH8
Water
 
100 miles
Holiday
 
madeup@gmail.com
House
 
13 Cairo street Egypt
Peter
 
50 pounds
Louise
 
20°C
NOTE!
Other symbols such as @, #, $, / and spaces are also considered to be alphanumeric.
Numeric Data

Numeric (number) data can be in two forms:- Integer and Real.

 

Integer Numbers:

# Integers are made up of whole numbers (numbers without decimals).

# Integers can be both positive and negative values.

 

For example:- the number 123 is an integer. -123 is also an integer.

 

Real Numbers:

# Real numbers are those that include decimals.

# Real numbers can be both positive (above zero) and negative (below zero).

 

For example:- the number 33.5 is a real number. -33.5 is also a real number.

Examples of Integers
Uses of Integers
123456
 
Number of people in a football stadium
13
 
Age of a person
8
 
Number of floors in a hotel
-57
 
Temperature (positive/negative)
-398576
 
Number of wheels on a car
0
 
Examples of
Real Numbers
Uses of Real Numbers
1.87
 
Exact height of a person in metres
24.99
 
Price of an item
5.2
 
Exact distance in miles
-12.37
 
Exact temperature
-123.9876
 
0.45
 
Currency Numbers

# Currency numbers are real numbers (decimals) that have been formatted to include money symbols ($, £ etc).

 

# Currency values that use decimals are usually shown to 2 decimal places.

 

For example:- £19.99 is a typical use of the currency value in England.

 

# Currency values can be both positive (above zero) or negative (below zero)

Examples of Currency Numbers
£100
$17.99
-£0.89
€1000000
Percentage Numbers

# Percentage numbers are real numbers (decimals) that have been formatted to show values out of 100. For example:

  • 0.6 would become 60%
  • 0.01 would become 1%
  • 1.8 would become 180%

 

# Percentage are usually shown with the percentage symbol (%).

 

# Percentage values can be positive and negative.

 

Examples of Percentage Numbers
100%
-20%
-12.5%
25.8%
Date/Time Data

# Date and Time data can be shown in many different ways. The most common ways are shown in the table below:

 

Examples of Dates
 
Examples of Times
dd/mm/yy (21/06/11)
  Long time (17:34:23)
dd/mm/yyyy (21/06/2011)
  Medium time (05:34:PM)
dd/mmm/yyyy (21/Jun/2011)
  Short time (17:34)
NOTE!

Take care to match the date/time data you are inputting to the style of date/time that your computer is set up to expect.

 

For example: American style dates follow the mm/dd/yy format and will cause problems if you try to insert data in the International style of dd/mm/yy.

Activity!

Click the above task and follow the instructions given on the sheet. Make sure that you complete both parts of the task sheet.