Learning objectives:
- Know common data types and when each is used (6.4.1)
- Understand how structured and unstructured data relate to data types (6.4.2)
- Understand how data type affects transformation (6.4.3)
- Judge suitable data structures, types and transformations (6.4.4)
Common data types
| Data type | Definition | Example |
|---|---|---|
| Integer | A whole number | Number of tickets: 3 |
| Real | A number with a decimal part | Price: 12.99 |
| Character | A single letter, digit or symbol | Grade: 'B' |
| String | A sequence of characters | Name: "Priya" |
| Boolean | True or False | Paid: True |
| Date | A calendar date (and possibly time) | 28/11/2026 |
| Blob | Binary large object: binary data such as an image, audio, video or document stored as one item | A profile photo |
Choosing the right type means data is stored efficiently and can be processed correctly. Storing a price as a string, for example, stops you adding prices up.
Structured, unstructured data and data types
- Structured data is organised into fields with set data types, such as a table of orders with an integer quantity, a real price and a date.
- Unstructured data often has no predefined type for its contents, such as free text, images or video. It is usually stored whole, for example as a long string or a Blob.
Data types and transformation
- Integers and reals can be totalled, averaged and compared.
- Strings and characters can be searched, sorted and split.
- Dates can be sorted, compared and used to find durations.
- Booleans can be counted and used to filter.
- Blobs cannot be processed like numbers or text; they need special tools to analyse their contents.
Making judgements
Pick the combination that suits the task. To report average spend per month you need structured data with real prices and dates, processed with calculations. To review customer feedback, you need unstructured text that may first be codified into categories before it can be analysed.