Databases - Burgate ICT
Download
Report
Transcript Databases - Burgate ICT
Spreadsheets, Modelling &
Databases
Objectives
Understand
the basic features of Spreadsheet
Software.
Understand
the basic features of Database
Software
Understand
the need for validation & verification
Spreadsheets
A spreadsheet package is a general purpose computer
package that is designed to perform calculations.
A spreadsheet is a table which is divided into rows and
columns.
Column B
Row 7
Spreadsheets – Formulae
A formula is used on a spreadsheet to perform a
calculation using the numbers in other cells.
The result of the calculation is displayed in the cell
where the formula has been entered.
A simple formula can be used to add, subtract,
multiply or divide numbers.
To carry out these sorts of calculation symbols are
used in a formula:
+
to add
to subtract
*
to multiply
/
to divide
Spreadsheets
Formulas in spreadsheets
Data modelling in spreadsheets
Databases
A database provides tools to let the user
search through the data that has been
stored to find particular pieces of
information.
Data stored in the database must be
organised so that the computer can analyse
and search it automatically.
Databases
Data in a database is usually organised into one
or more files storing information relevant to the
organisation that has created the database.
A database keeping information for a doctors
surgery may contain the following files :
Databases
When setting up a database it is usual to
define a set of queries which will be used to
answer questions from the data in the
database.
The output that is produced by the database
is called a…
Report.
Databases
There are two different types of database package
that you are likely to find in a school. They are
Flat file databases
Relational databases.
can only contain one file.
Excel
Can store more than one file within a database. The files
can each have a different structure and relationships (or
links) can be created between the files.
Queries can answer questions by examining and
comparing data in more than one file.
Table Design
Data entered into a database is stored in
files (also known as tables).
A table is a collection of records, each of
which contains information about one
person or thing.
The data in the records is separated into
fields which each hold just one item of data.
Each field is identified by a field name.
Table Design
Example of a file, records and fields that
might be used in a doctors’ surgery to keep
information about patients.
Table Design
To create a Table you need to tell the computer the
names of the fields that will be stored in the records
in the file.
All of the records in a Table must contain the same
fields.
You will also have to specify what type of data can
be stored in each field
How much space should be reserved to store the
data.
Together, this information is known as the structure
of the record.
Table Design
Field
Record
A single item of data stored in a database such
as age or car registration number. Each field is
identified by a field name.
A record is all of the information that is stored
about a person or thing.
Table
A collection of records, each of which has the
same structure.
Field Data Types
Type
Description
Example Data
Numeric
Numbers only
1545, 1.23, 12303
Alphabetic / Text
Letters only
hello, Hi, TEST
Alphanumeric
Letters and numbers
robot 23, area 12, WA13
9IJ
Boolean / Logical
True or false
true, yes, false, no
Date
A date
12/02/98, 1/12/71
Each field in a record must have a Field Type
The Field Type refers to the kind of data that can
be stored in the field.
Only data that matches the type of a field can be
stored in a field.
Fields
Each field in a record has a fixed length.
When you create a file you must decide
whether the fixed length for each field.
Usually one particular field of each record
contains an item which is used to identify
the record. This field is called the key field.
The value in the key field must uniquely
identify each record.
Coding
Sometimes information is coded before it is
typed into a database.
E.G. Books in a library database
Fiction coded as F
Non-fiction coded as N
Reference coded as R
Coding information reduces the amount of
storage space required and speeds up the
process of typing the information in.
Data Entry
There are three important operations that you can
carry out on data in a database :
Put a new record into the
Add a Record
database.
Amend a Record
Delete a Record
Change the contents of a
record that already
exists.
Remove a record from the
database.
•Sophisticated database packages will let you specify rules
that can be used to check data as it is entered.
They are known as validation rules.
Queries
A query (also known as a filter or
search) is used to answer a question
from the data in a database.
When a query is run it produces as
output a list of all of the records that
match the condition that defined the
query.
Queries
The following
condition
could be used
to search this
file to locate
all of the
patients who
see Dr Jones
Queries Using More Then One Field
More complicated queries can be created by
linking together more than one search
condition.
This condition can be used to find all of Dr Jones’
patients who have blood type O :
Blood Type = "O" AND Doctor = "Dr Jones"
Queries Using More Then One Field
The words AND and OR can be used
to link two simple conditions together
to make a more complicated query.
The difference between using AND or
OR to join two conditions is :
AND : Find only records which match
both of the conditions.
OR : Find records that match either or
both of the conditions.
Sorting
To sort a database into an order you
must specify :
Which field in the database you wish to
use to order the records.
This will usually be the primary key
field.
Whether you want the records in
ascending (going up) or descending
(going down) order.
Reports
Typically a report will let you specify these
things :
Which fields to display.
Where to display the fields.
The order in which records should be displayed.
How records should be grouped together.
What statistics you want the database to
calculate from the records (e.g. no. of records,
average values of fields).
Designing a Database
Decide what outputs you will want the
database to produce - what questions must
it answer ?
Use the information about the outputs you
want to get to decide what tables you need
to set up and what fields you will have to
put into these tables. What will the key field
be for each file ?
Designing a Database
Decide what type each field should be and
whether the fields will be fixed or variable
length.
Could data be coded to reduce field size ?
Design the queries and reports that you
will use to get information out of the
database.
Designing a Database
Decide what validation rules to use.
Put some information into the database so
that it can be tested.
Run the queries and reports to test if the
database is operating correctly.
Design data collection forms to gather the
real information to put into the database.