You are on page 1of 13

DATABASES

What is a database
PAPER BASED DATA
STORAGE
Data is often stored in an
organised way so that
things can be found easily.

Card file systems were


used in libraries so people
could find books easily.

There were often two sets


of cards, one organised by
author and another set
organised by book title.
PAPER BASED DATA
STORAGE

Address books and recipe


files are other examples of
commonly used filing
systems.

Offices were filled with


filing cabinets containing
files organised in one way
or another.
PROBLEMS WITH PAPER
BASED STORAGE
They are useful when searching
for data in the way in which the
data was sorted.

Searching for a phone number


when you know someone's name
is easy. However if you know the
number and want to know who it
belongs to, searching through an
address book is difficult.

Reorganising by a different field


is time consuming and difficult.
Sorting a phone book by phone
number would mean writing it
out again in order.
PROBLEMS WITH PAPER
BASED STORAGE
Inserting a new record can
be a problem especially
when dealing with the
storage. Adding a new file in
an already packed filing
cabinet may mean shuffling
and re organising draws.

Adding entries in an address


book can be a problem. May
enter under the correct
letter but then all those
entries are entered
chronologically as they were
received.
PROBLEMS WITH PAPER
BASED STORAGE
Updating a record can be
difficult. It often means the
record has to be recreated
with new data.

The layout is fixed.

The storage can be difficult


for multiple users to
access. Only one person
can access a record at a
time.
COMPUTER DATABASES
Computer databases store
related data in an organised way.

However they are more flexible


that the static records found in a
paper based database.

Records can be sorted on any


field

Records can be search on any


field and even use wildcards.

For example search for phone =


"0121"* will find all phone
numbers that start with 0121
THE STRUCTURE OF A
DATABASE
A database stores data in a table. The table
columns are fields.
A completed row is a record.
Surnam Forenam Address1 Town/City Post Phone Ward Item Description pric Date Date
e e Code Code e Loaned Returned
Simpson Homer 768 Evergreen Springfield SP12 01471 555 W4 CA1 Crutch - £25 02/05/13 05/05/13
Terrace 3WE 897 Adult

Gumble Barney 7 Beer Gardens Springfield SP24 01471 555 W6 CA2 Crutch - £25 03/05/13 14/05/13
6AW 421 Adult

Cartman Eric 1245 Snowy South Park SP 12 01247 555 W6 NCJ1 Neck Collar £6 03/05/13 10/05/13
Cresent 7UY 874 - Junior

Simpson Homer 768 Evergreen Springfield SP12 01471 555 W3 WCL1 Wheel £30 07/05/13 16/05/13
Terrace 3WE 897 Chair - 0
Large
A record
Simpson Homer 768 Evergreen Springfield SP12 01471 555 W4 CA1 Crutch - £25 07/05/13 09/05/13
Terrace 3WE 897 Adult
A field
DATABASE MANAGEMENT
SYSTEMS
A database is the store of data.

A Database Management System (DBMS) is the software used to


create, edit and search through a database.

A DBMS provides a standard way to create a database.

It provides a level of security so only authorised users can access


the database.

It makes sure that the data is stored efficiently and makes sure that
the data integrity is kept.

It provides a standard way to search through the data. Most DBMS's


use a programming language called SQL to access, and search
through a database.
FLAT FILE DATABASES
A flat file database is one where all the data is stored in one
table.

Look at the example of the hospital loans.


Surname Forename Address1 Town/City Post Phone Ward Item Description price Date Date
Code Code Loaned Returned
Simpson Homer 768 Springfield SP12 01471 W4 CA1 Crutch - Adult £25 02/05/13 05/05/13
Evergreen 3WE 555 897
Terrace
Gumble Barney 7 Beer Springfield SP24 01471 W6 CA2 Crutch - Adult £25 03/05/13 14/05/13
Gardens 6AW 555 421
Cartman Eric 1245 Snowy South Park SP 12 01247 W6 NCJ1 Neck Collar - £6 03/05/13 10/05/13
Cresent 7UY 555 874 Junior
Simpson Homer 768 Springfield SP12 01471 W3 WCL1 Wheel £300 07/05/13 16/05/13
Evergreen 3WE 555 897 Chair - Large
Terrace
Simpson Homer 768 Springfield SP12 01471 W4 CA1 Crutch - Adult £25 07/05/13 09/05/13
Evergreen 3WE 555 897
Terrace
Gumble Barney 7 Beer Springfield SP24 01471 W6 CA2 Crutch - Adult £25 21/05/13 28/05/13
Gardens 6AW 555 421
Cartman Eric 1245 Snowy South Park SP 12 01247 W6 WCJ1 Wheel Chair - £250 03/06/13 09/06/13
Cresent 7UY 555 874 Junior
Simpson Homer 768 Springfield SP12 01471 W4 CA2 Crutch - Adult £25 06/06/13 19/06/13
Evergreen 3WE 555 897
Terrace
FLAT FILE DATABASES
Surname Forename Address1 Town/City Post Phone Ward Item Description price Date Date
Code Code Loaned Returned
Simpson Homer 768 Springfield SP12 01471 W4 CA1 Crutch - £25 02/05/13 05/05/13
Evergreen 3WE 555 897 Adult
Terrace
Gumble Barney 7 Beer Springfield SP24 01471 W6 CA2 Crutch - £25 03/05/13 14/05/13
Gardens 6AW 555 421 Adult
Cartman Eric 1245 South Park SP 12 01247 W6 NCJ1 Neck Collar - £6 03/05/13 10/05/13
Snowy 7UY 555 874 Junior
Cresent
Simpson Homer 768 Springfield SP12 01471 W3 WCL1 Wheel £300 07/05/13 16/05/13
Evergreen 3WE 555 897 Chair - Large
Terrace
Simpson Homer 768 Springfield SP12 01471 W4 CA1 Crutch - £25 07/05/13 09/05/13
Evergreen 3WE 555 897 Adult
Terrace
Gumble Barney 7 Beer Springfield SP24 01471 W6 CA2 Crutch - £25 21/05/13 28/05/13
Gardens 6AW 555 421 Adult
Cartman Eric 1245 South Park SP 12 01247 W6 WCJ1 Wheel Chair £250 03/06/13 09/06/13
Snowy 7UY 555 874 - Junior
Cresent
Simpson Homer 768 Springfield SP12 01471 W4 CA2 Crutch - £25 06/06/13 19/06/13
Evergreen 3WE 555 897 Adult
Terrace
PROBLEMS WITH FLAT FILE
DATABASES
Every time a patient loans some equipment all their details need to be
entered again.

This duplication is known as data redundancy and leads to a number of


problems.

It takes up space.

What if one record is entered slightly differently. Then when searching


the results may look like two different people.

Takes time to enter all the data again. If they loan two things in one
transaction then all the data has to be entered twice, one for each
loan.

If someone moves or changes their name or phone number, do you


update all their previous records? How would you know to do so if
there were thousands of records?
PROBLEMS WITH FLAT FILE
DATABASES

Data can only be entered if it is part of a loan. If a


new item of kit was purchased then there would be
no record until it was loaned.

These issue can cause problems and they get worse


the large and more complex the data that needs to
be stored.