Transcript Databases

Databases
What is a Database?
A database is a
way of storing a
collection of related
information
A database could
be manual but it is
usually computerised
Who would use a Database?
Police criminal records
database
Hospital patients
database
DVLA database
Library database
Directory Enquiries database
Examples of Manual
Databases
Telephone Directory
Dictionary
Encyclopaedia
Atlas
Diary
Filing Cabinet
A Database of Videos
Name of film
Starring
Video Number
Certificate
Category
Braveheart
Mel Gibson
1578
15
Historical Epic
VIDEO FILE
Titanic
Leon Liar Liar
Jim Carrey Star Wars
Ewan
157
MacGregor
4574
12
4657
Dra 12
U
Comedy
Sci Fiction
File, Record, Field
A database contains many files
Each file contains many records
Each record contains many fields
VIDEO
File
BRAVEHEART
Record
CATEGORY
Field
A field is a single piece of
information about a person or thing
in a record.
A record is a collection of related
fields about a person or thing
A file is a collection of records
grouped together.
Advantages of using a
Computerised Database
Speed of access
Reliability
Less storage space
Easy to add, amend,
delete records
The database can be
sorted and searched
Selected information
can be printed
Disadvantages of a
Computerised Database
Hardware and Software
must be purchased
Training must be given
Database must be
maintained
Features of Database
Packages
A database is a GPP
It has all the features of any GPP –
eg Load, Print, Save, Amend, Delete
In addition a database allows you to
Add, amend or delete records
Search and sort records
Types of Field
Text – only letters eg abc, ABC
Numeric – only numbers eg 123, 890
Date – a formatted date eg 12/12/02
Time – a formatted time eg 1500
hours
Graphic – a picture eg
Searching the Database
Records can be searched for particular
information
You can do a complex
You can do a simple
search – searching on
search – searching
two or more fields
on one field
Once you have performed your search all
the records which match the search
conditions are displayed.
You could search a database of criminals
for those over a certain height.
Sorting the Database
Sorting allows you to sort the records
in the database in a particular order.
A database of bank
customers could be
sorted in ascending
order on the field
ACCOUNT
NUMBER
A database of
employees could be
sorted alphabetically on
the field SURNAME
More on Sorting
The database could
be sorted on one
field – eg
SURNAME
The database could
be sorted in
ASCENDING or
DESCENDING
order
The database could
be sorted on 2 or
more fields - eg
SURNAME and
FORENAME
The database can be
sorted in any order.
This allows the user
to view the records
in the order most
suited to their
needs.
Creating a Database
Decide on your field names
Decide on your field type
Decide on your field size or length
(remember spaces count as
characters)
Add your data or records
Save the database with an
appropriate name
Reports
The information you print from the
database is called a Report. Before
you can print a Report you must set up
a Report Definition.
You must decide
What fields you want to include in
your report
What order you want the fields
printed in
Computed Fields
Computed or Calculated fields carry out a
calculation on another field (s).
What goes into a Computed field is
calculated by the computer and not
inserted by the user - similar to what
happens in a spreadsheet.
For example
Total Cost less Balance Paid could be the
formula in the Amount Due field. The
computer would perform the calculation and
enter the amount in the Amount Due field.
Altering Record Format
You can display the information in the
database in different ways.
You can alter what you see on the screen
(input format) and how your Report looks
(output format)
Examples of different formats are:
Table
List
Columns
Calculating the Storage
Requirements
It takes 1 byte to store 1 character
To store a name with 20 characters takes 20
bytes
To store an address with 50 characters takes 50
bytes
To calculate storage space required for one
record add up the length of each field and you will
have the total number of bytes for each record
To calculate the storage space required for the
whole database multiply the record storage
requirements by the number of records
Commercial Databases
Many companies used database to build up
customer profiles
These databases can then be sold or
exchanged with other companies
The customers details can be used to send
mail shots or junk mail using standard
letters and mail merge
Often people do not know their details are
stored on a database
Personal Privacy
With all this information potentially changing
hands some people are very worried that
information about them could be accessed.
What if the data held about YOU was
incorrect or out of date. How might it affect
you?
The Data Protection Act has been brought in
to protect people and their personal data. The
act was introduced in 1984 and updated in
1998.
The Data Protection Act
The parties involved
Data Controller (the holder of the
information)
Data Processor (the processor of the
information)
Data Subject (the person who the
data is about)
The Data Protection Act
The data subject has the right to:
to inspect information held about them
have incorrect information changed
to apply for compensation if incorrect
information has causes distress.
Data Protection Act
Information stored in a database must be
accurate – what does this mean?
A database could be created by a credit
card company showing the credit rating of
its customers
Inaccurate information in this database
could mean people being refused credit
The Act states – information held on
computer must be accurate and where
necessary kept up to date
Principals of the Data Protection
Act
Data held on computer must be:
fairly and lawfully processed;
processed for limited purposes;
adequate, relevant and not excessive;
accurate;
not kept longer than necessary;
processed in accordance with the data subject's
rights;
secure;
not transferred to countries without adequate
protection.
The Computer Misuse Act
This law makes it illegal to access a
computer system without permission
Unauthorised access
Unauthorised access with intent to
commit an offence
Unauthorised modification of data
Hacking and writing computer viruses
are both made illegal by this act.
The Copyright &
Patents Act
Most published material (including text, images, video,
music, software etc) is protected by the Copyright,
Design and Patents Act 1988.
Copyright may be infringed if, without the prior
permission of the copyright owner, you
Copy a work (including scanning or storing
electronically)
Issue copies to the public
Perform, show or play the work in public
Broadcast the work or include it in a cable
programme
Make an adaptation of the work
The Copyright &
Patents Act
If you do any of these without permission,
you are liable to be held personally
responsible. Infringing the law may be a
criminal offence.
Costs of Setting Up a Database
System
Initial costs
Replacement costs
Running costs
Staff costs
Staff training and retraining
Expert Systems
An expert system is a program that has
access to a huge database of knowledge on
one particular subject.
The program can use this database to
make decisions, draw conclusions and offer
advice on the subject.
This decisions/conclusions/advice are
based on the facts contained within the
database.
The system is an EXPERT on the subject!
More on Expert Systems
The medical profession use Expert Systems
to help diagnose patients
Patients symptoms are entered into the
computer
The computer searches its database for all
possible diseases or illnesses which match the
symptoms
The computer can then search its database
for medication/treatment and advice
Expert Systems
Knowledge Base – Like a massive
database but contains facts and rules
Inference Engine or Expert System
Shell – Compares new information
with current data on the system
Explanatory Interface (screen) –
Displays questions to the user and
displays how the system makes its
conclusions/reasoning
Artificial Intelligence
AI stared in 1950’s with people
programming computers to play chess
A program is classed as AI if it can
learn from its mistakes and perform
better next time
Verification of Data
A data processing operator might key in
hundreds of records a day
How do we know she/he hasn’t make a tyiiing
mistook!
One way would be for data to be entered
twice – perhaps by different operators
This method of verification is called double
entry
Verification of Data
Remember when you changed your
password on the network you were
asked to verify your new password by
typing it in twice. The second time you
type the password is used to verify
what you typed this first time!
Validation of Data
To validate data means to check that is it
allowable, sensible and within prescribed
limits or range
For example a day of the month must be in
the range 1 – 31
If 33 were keyed in it would not be
allowed and a message would be
displayed telling the operator that it
was an INVALID ENTRY
In Conclusion
A Database is a GPP
Databases contain files, records and fields
Databases can be searched and sorted by
field or fields
Databases are used in many businesses
Databases can help make decisions
Information stored in a database is
subject to the Data Protection Act
Key Fields
A key field is used to identify a specific piece
of information in a database
A key field is something that is unique
Date of birth could be the key field when
searching a database of school pupils. Pupils
may have the same name – John Smith – but
are unlikely to have the same name and date
of birth
Your Candidate Number would be the key
field in the SQA database