5.1.5 Data:
Types and Terminology
A computerised database stores data in one or more organised tables. Because
the data is stored in named fields it has a context so it becomes information.
Database software is designed to make it easy and efficient to store,
edit,
sort and search information.
Database terminology:
- Field - a field is used to
store an individual item of data.
Example: typical fields might be 'surname', 'colour', 'height', 'DOB'
etc.
- Key Field - a field that is
unique for each record
in the database and can therefore be used to identify just that record.
Example: A field like 'surname' would not make a good key
field because
two records in a database of people could easily have the same surname.
- Record - a record is a
group
of related fields.
Example: In a database of doctor's patients, each patient would be a
separate record, with fields for 'surname', 'DOB', 'address', 'allergies' etc.
- File - a file is the
group of
records that make up the database.
Examples of use:
KLB school has a database with all the
pupil details on it.
- The whole database is a file.
- Each pupil is a separate record in the file
- Each record is made up of fields such as
'first name', 'surname', 'DOB', 'tutor group', 'emergency contact number',
'tutor group' etc.
- The key field is the unique 'admin number'
given to each pupil when they join the school.
Data Types:
When a database is designed, all the fields are set to accept a particular
data type. This helps check for the wrong type of data being entered
and makes sure the data is stored as efficiently as possible. It also means it
will be sorted correctly.
Examples of use:
A football club uses a database to
store details of its players.
- Data such as Surname and First name is stored in text fields.
- The players car registration is mixture of text and numbers so it
is stored in a text field.
- The height of the player (in metres) is a decimal number so it is stored
in a real number field.
- The number of goals scored is a whole number so it is stored in an
integer number field.
- The player's date of birth (DOB) is a date so it is stored in a date
field.
- The players telephone number has a space between the code and the actual
number so it is stored in a text field.
- Information such whether the player is right or left footed is stored
using a logical/Boolean field. The field is labelled as 'Right footed?'
and the entry is either a TICK or left blank.
Examination questions on this topic
You will often get a question about a table from a database. It can be very
easy to mix up a question about field names with one about
field data
types.
For example:
| Item |
Stock code |
Size (cm) |
Manufacturer |
Date purchased |
Plastic? |
| Hose clip |
T0090 |
0.90 |
Fisher |
28-07-2002 |
No |
| Hose clip |
T0135 |
1.35 |
Fisher |
28-07-2002 |
No |
| Joining clip |
K0118 |
0.90 |
Asus |
28-04-2001 |
Yes |
| Extension hose |
L0035 |
100.00 |
Fisher |
28-02-2000 |
Yes |
- If you are asked to name a field then look the row at the top
which should have all the field names. In this example, 'Item',
'Stock code' etc. are the field names.
- If you are asked to identify the key field then look for a
column of numbers or numbers/text that identifies each item
uniquely. In this example the 'stock
code' is the key field as each item in stock would be given a unique
code to avoid confusing it with any other item.
- If you are asked to describe a suitable data type for a particular
field then you must look at the type of data being stored in each
column.
- If the data is text or a
mixture of text & numbers (including
spaces or brackets etc.) then the data type would be
text.
- If the data is numeric then the data
type would be numeric but you also need
to say if it should be real or
integer. (Remember, use real if
the data has decimal places and integer when all the data is
whole numbers)
- If the data is in the form of a date
then the data type would be date. It
does not matter if the date is stored in a numeric form (i.e. 28-08-61 or
28/8/1961) or written out fully (i.e.28th August 1961).
- If the data seems to have only two options,
particularly 'yes' or 'no' then the data type should be
logical/Boolean.
For the example table above, the field names and data types
would be as follows:
| Field name |
Item |
Stock code |
Size (cm) |
Manufacturer |
Date purchased |
Plastic? |
| Data type |
Text |
Text (key field) |
Numeric (real) |
Text |
Date |
logical/Boolean |
|