
197
8.1 Database concepts
8
8.1.1 The limitations of a file-based approach
A file is a collection of items of data. It can be structured as a collection of
records, where each record is made up of fields containing data about the same
‘thing’. Individual elements of data can be called data items.
When a program is used for data processing, the organisation of any records
used depends on how the program is written. Records can be fixed or variable
in length and each record may also contain information about its structure, for
example, the number of fields or the length of the record. If these records are
to be processed by another program, that program must be written to use the
exact same record structure. If the structure is changed by one program, the
other program must be rewritten as well. This can cause problems if updating
programs is not carefully managed.
For example, a business keeps separate payroll files and sales files. Each file is
used by a different application.
Field – a column in a table in a database.
Tuple – one instance of an entity, which
is represented by a row in a table.
Entity – anything that can have data
stored about it, for example, a person,
place, event, thing.
Attribute (database) – an individual data
item stored for an entity, for example, for
a person, attributes could include name,
address, date of birth.
Candidate key – an attribute or smallest
set of attributes in a table where no tuple
has the same value.
Primary key – a unique identifier for a
table. It is a special case of a candidate
key.
Secondary key – a candidate key that is
an alternative to the primary key.
Foreign key – a set of attributes in one
table that refer to the primary key in
another table.
Relationship – situation in which one
table in a database has a foreign key that
refers to a primary key in another table
in the database.
Referential integrity – property of a
database that does not contain any
values of a foreign key that are not
matched to the corresponding primary
key.
Index (database) – a data structure
built from one or more columns in a
database table to speed up searching
for data.
Entity-relationship (E-R) model or E-R
diagram – a graphical representation
of a database and the relationships
between the entities.
Normalisation (database) – the
process of organising data to be
stored in a database into two or more
tables and relationships between the
tables, so that data redundancy is
minimised.
First normal form (1NF) – the status of
a relational database in which entities
do not contain repeated groups of
attributes.
Second normal form (2NF) – the
status of a relational database in which
entities are in 1NF and any non-key
attributes depend upon the primary
key.
Third normal form (3NF) – the status of
a relational database in which entities
are in 2NF and all non-key attributes are
independent.
Composite key – a set of attributes that
form a primary key to provide a unique
identifier for a table.
457591_08_CI_AS & A_Level_CS_196-216.indd 197 25/04/19 10:01 AM