Introduction To Data Bases 1
Introduction To Data Bases 1
0
Candidates should have an
understanding of how organizations use
ICT, including
sequential file systems (batch processing e.g.
payroll);
Indexed sequential & random access files
(e.g. . payroll and personnel records.
Relational database systems (e.g. customer
database linked to sales records)
Youshould be able to describe these
systems, giving the hardware and
Datais the lifeblood of most
businesses and organizations. Why
do they collect and store data?
Because data is processed (sorted,
filtered, searched) to give us
A database is a collection of data
that is stored in an organized or
logical manner so that data can be
processed effectively or retrieved
quickly and efficiently.
You should recall the following from
GCSE:
Tables
Fields
Records
Some databases exist
solely to process data
automatically – for
example databases held by
utility companies
Some databases exist to
give us information when
we need it: for example,
the school database.
The purpose of the
database obviously affects
the way that data is stored,
Different Which phone
Person? No is right? Inconsistent?
BOOK TABLE
Relational Diagram
one-to-one
Products and bar-codes in a supermarket.
one-to-many
One video club member may loan a number
of videos.
many-to-many
Pupils and Teachers in a school.
Entity-relationship diagram - diagrammatic way of representing
the relationship between entities in a database.
An entity-relationship diagram shows the links between tables.
One-to-one
E.g. Products in a supermarket each have a
unique barcode number.
It must...
allow users to create and edit the data
and provide facilities to search the data
using a query language.
allow other applications to use the
data.
create and maintain the data
dictionary
maintain the integrity of the database. On a
multi-access system, this is done by locking
a record or table when a user is editing it.
This means that another user is unable to
edit it at the same time. When the data is
saved it is unlocked.
check passwords of individual users and
only allow that user access to certain parts of
the database.
ensure that recovery is possible if the
database is corrupted.
There are four types of file
organization that you need to know
about:
Serial
Sequential
Indexed Sequential
Direct /Random Access
A serial file is one in which the
records have been stored in the
order in which they have arisen.
They have not been sorted into
any particular order.
Federer
r
Potte
Windsor
Cole
Hermione Grang
Britney Spears
Cheryl Tweedy
Kate Middleton
Simple file design
Very efficient when most of the
records must be processed e.g. Payroll
Very efficient if the data has a natural
order
Can be stored on inexpensive devices
like magnetic tape.
Entire file must be processed even if a
single record is to be searched.
Transactions have to be sorted before
processing
Overall processing is slow, because you
have to go through each record until you
get to the one you want!
Each record of a file has a key field
which uniquely identifies that record.
An index consists of keys and
addresses, just like an index in a
book:
The pages in a book are stored
sequentially, so you can read through it
page by page
OR
You can look up the page you want
in the index and flick straight to it
An indexed sequential file is a
sequential file (i.e. sorted into order
of a key field) which has an index.
A full index to a file is one in which
there is an entry for every record.
Because each record has an index, we
can access individual records directly,
without having to scroll through all the
other records first.
Indexed sequential files are
important for applications where
data needs to be accessed.....
sequentially , one record after another
OR
randomly using the index.
A company may store details about its
employees as an indexed sequential file.
Sometimes the file is accessed....
sequentially. For example when the
whole of the file is processed to produce
pay slips at the end of the month.
Sometimes the file is accessed....
randomly. Maybe an employee
changes address, or a female employee
gets married and changes her surname.
An indexed sequential file can only be stored
on a random access device e.g. magnetic disc
or CD.
This is because we need a device that will allow
us direct access to random files, rather than
the sequential access that magnetic tape
allows.
Provides flexibility for users who
need both type of access with the
same file
Faster than sequential
Extrastorage space for the index is
required, just like in a book: your text
book would be 372 pages without
the index (go on, check!) but is 380
pages with the index.
Records are read directly from or
written on to the file.
The records are stored at known
address.
The address is calculated by applying
a mathematical function to the key
field.
A random file would have to be stored
on a direct access backing storage
medium e.g. magnetic disc, CD, DVD
Example : Any information retrieval
system. Eg Train timetable system.
Any record can be directly accessed.
Speed of record processing is very
fast.
Up-to-date file because of online
updating.
Concurrent processing is possible.
More complex than sequential
Does not fully use memory
locations
More security and backup problems