Chapter 05 data types

Page 1

Chapter 05 – Data Types

CHAPTER 05 – DATA TYPES

1


Chapter 05 – Data Types

Types of data There are several data types found in most computer systems: •

Logical / Boolean

Alphanumeric / Text

Numeric

Date

Logical / Boolean data Can only have two values: true or false. This works if there are only two possible responses to a question or situation, i.e. (Yes / No) (True / False) (Male / Female) (1 or 0). This is made most use of when carrying out a search in a database or on the internet. In these cases, logical operators are used which are based on true (i.e. binary 1) or false (i.e. binary 0) logic.

Uses of “AND” “OR” and “NOT” Taken from:

http://www.teach-ict.com/gcse_computing/ocr/databases/logical/miniweb/pg5.htm

2


Chapter 05 – Data Types

Alphanumeric and text data The letters A-Z are referred to as text; The letters A-Z plus the numbers 0-9 are referred to as alphanumeric (although some definitions also include the remaining keyboard characters).

Numeric data Whole numbers are referred to as integers (e.g. floors in a hotel; students in a class; wheels on a car) Numbers containing decimals are referred to as real numbers (e.g. temperatures; prices; height) Numeric data also includes positive and negative numbers, as well as zero.

Date data This can be written in many forms, for example: Number formats dd/mm/yyyy (25/03/2014) dd/mm/yy (25/03/14) dd.mm.yy (25.03.14) yyyy-mm-dd (2014-03-25)

Letter format for month dd mmmm yyyy

(25 March 2014)

dd-mmm-yyyy

(25-Mar-2014)

It is important that dates are typed in consistently so that sorts and searches are manipulated correctly by the computer.

3


Chapter 05 – Data Types

Data Structure Data is stored in files, which consist of records, which in turn consists of fields. For example, a school may set up a file to include information about their pupils in the following format: In this

example the Student No: is the “key field” or “primary key”. Each primary key is unique and is used to locate a record in a file during a search operation. In reality, the student file would be much larger, containing all the records for all the school’s pupils. This type of file is often referred to as a flat file structure. All the data is held in a table.

Databases A database is a collection of information which is structured in some way to permit manipulation and searching of data.

Why are databases used? •

They promote data consistency. When data is updated on a database it is up to date for any application which uses the database

Data duplication is reduced to a minimum since only one copy of each data item needs to be kept

It is relatively easy to expand the database if some new application is being considered

Security of data is easier to monitor and maintain. Data access can be controlled by database “front end”; the actual database will be invisible to all users except the database administrator.

4


Chapter 05 – Data Types

Relational databases Whereas in flat file databases there is a single table, relational databases consist of a number of separate tables which are related. Each table contains a primary (key) field that is also a field in at least one other table. It is then possible to combine data from different tables to produce a report which only contains the required information.

Taken from Student Handbook for ICT: IGCSE by Gareth Williams and Anne Bagwell

5


Chapter 05 – Data Types

Analogue and digital data Digital data definition: discrete, fixed values in a given range Analogue data definition: continuous physical variable, producing an infinite number of values within a given range (e.g. length, weight, temperature, pressure, etc. can take any value, depending on the accuracy to which they are measured). These values are measured by an analogue device. Speedometer represents speed by showing the position of a pointer on a dial. Thermometer represents temperature by the height of the liquid column. For the computer to accept and understand the physical data from sensors it will need to be converted from analogue to digital using an analogue to digital converter (ADC). In a control system the computer would need to also send out signals. These would need to be converted from Digital to Analogue using a digital to analogue converter (DAC)

6


Chapter 05 – Data Types Past Paper questions

7


Chapter 05 – Data Types

8


Chapter 05 – Data Types

9


Chapter 05 – Data Types

10


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.