Lesson Objectives: students will present work in ways that include database, spreadsheet and data visualisations solutions. This section will concentrate on data types and structures relevant to databases and spreadsheets.
Many different software tools can be used to create data visualisations; most, however, are
derivatives of either a spreadsheet tool or a database tool. Data needs to be separated into
distinct fields or columns that only have one data type in them. Data types are particular
forms that an item of data can take.
A text data type consists of a ‘string of characters’. Text may also be referred to as a string, and the terms are sometimes used interchangeably to refer to the same data type. This type of field holds a mix of characters (letters, numbers, special characters), also referred to as alphanumeric.
Examples: "Sally", "3089", "0455555251"
An integer is a number without a fractional or decimal component – in other words, a whole number. Integers include negative numbers.
Data that you can do mathematic operations with.
A floating-point number is a number with a fractional or decimal component, such as a decimal number. Where decimal numbers are required, such as when dealing with financial transactions or percentages, then the floating-point data type is used. Examples of the floating-point data type are ‘3.17’, ‘–6.890’ and ‘0.001’.
A floating-point number can be split into two parts: the mantissa and the exponent. The mantissa holds all of the digits in the number, with a decimal point after the first digit that is not zero. The exponent holds the power of 10 by which the mantissa must be multiplied to regain the original number. For example, 0.00317 can be expressed as 3.17 × 10–3 , in which case the mantissa is 3.17 and the exponent is –3.
The bane of exels existance!!!
Strictly speaking, a date format is another variation on the numeric data type. The value of a date is normally based on the number of days since the ‘zero’ day built into the operating system. For example, the day ‘1’ might be displayed as 01 January 1900, while ‘42673’ would be displayed as 30 October 2016. Calculations can be performed on dates, which can be handy when considering the difference between them. Dates can be formatted to show a combination of years, months, days, hours, minutes and seconds, depending on the needs of the user. In terms of time, they can also display 12- and 24-hour clocks.
A Boolean data type can hold one of only two possible values, usually ‘true’ or ‘false’. A Boolean data type is known as a logical data type. It is often used in conditional statements to test if a condition or value is true or not, but it may also represent Yes/No or On/Off.
A character data type holds a single letter, number or symbol. Numbers stored as a character data type cannot be used in mathematical calculations. This is a text field that will only accept a single alphanumeric character. It is used when there are multiple options for a value, but they can be represented with a single character to make data entry easier and to save storage space. For example, small, medium and large sizes of the same type of wooden box might be entered as ‘S’, ‘M’ or ‘L’, respectively.
A data structure is a particular way of organising a collection of data items. Using data structures helps to improve the efficiency of the data-handling process. Three common data structures are arrays, records and files.
An array is a collection of data items that are generally of the same data type. Each item in the array is allocated an address. The table illustrates an array data structure. The structure is named ‘Number’ and it holds six data items – all integers. The value of Number (0) is 40 and that of Number (5) is 67.
A record is a collection of data items of different data types. Each element of a record is generally called a field. The record in this table consists of six fields and involves data of different data types.
A table is a collection of records that can be referred to in other parts of a file, and connected to other tables in relations
A file data structure can hold numerous data items, arrays or records. A file is saved separately from the software program that utilises the file. Large data sets can be read from, or written to, a file for storage purposes. The file is an example of a comma-separated value (CSV) file.