Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
n ternationa INTERNATIONAL
l
COMPUTER
Com p
IC
ce
DL
DRIVING
cen
ut
er Li
D riving ã LICENCE ã
MODULE 5
TABLE OF CONTENTS
INTRODUCTION ................................................................................. 3
Purpose of this Study Guide ........................................................ 3
INTRODUCTION
This study guide is part of the complete set of World Links training material
which includes:
Phase O: Computer Literacy (seven modules)
Phase I: Introduction to the Internet for Teaching and Learning
Phase II: Introduction to Telecollaborative Learning Projects
Phase III: Curriculum and Technology Integration
Phase IV: Evaluation and Diffusion of Technological Innovations
Phase V: Planning for School-Based Telecenters
Phase VI: The World Of ICT: A Seminar for Policy Makers
PRACTICAL EXERCISES
There are practical exercises that the user should attempt after every section
of the study guide. The exercises are designed to meet the requirements of
the ICDL test. For ease of recognition, the exercises have all been put into
boxes like the one below.
Exercise
TIPS
The study guide will also contain tips, to help shed light on some
of the instructions.
DATABASE CONCEPTS
A database is an organised store of information constructed around a
particular theme. It consists of a series of rows (called records in Access)
and columns (fields)
For instance, a business might use a database to store information about
sales and stock inventories. A doctor might search a database to find
information about particular medical symptoms.
How you organise information in a database depends on how you intend
to use it. So a doctor might use one kind of database to find information
about each patient’s symptoms, and the doctor's receptionist might use a
different kind to store personal details and financial records of patients.
In addition to making it easier to retrieve information, databases can serve
as a tool for analysing information. You can use a database to find patterns
and trends in large volumes of data that are otherwise hard to detect. In
businesses and scientific research this is often a key function of databases.
A database is made up of tables, queries and reports. The tables contain
the data. The queries contain instructions on how the information is to be
retrieved, and the reports contain layouts to dictate how the retrieved
information will be printed. Each table is made up of records and each
record contains fields that relate to that record.
Each different table, query or report within the database file is called an
object. An object that has been opened is termed an active object.
Hence the hierarchy is:
x A field is a single item/fact such as First Name, Surname, Date of
Birth, etc.
x A record is a collection of fields
x A table is made up of a group of records
x An object is a table or a query or a report (as necessary to extract
information from the table)
x A database is made up of objects. It may contain several tables, and
the related queries and reports
DATA TYPES
When creating a database you need to know the type of data you are
going to enter into the database. For example, are you going to enter text,
numbers or dates?
Data Type Description
Text This is the default type for all new fields. Text fields can contain
up to 255 characters and may include letters, numbers and
symbols. In cases where the data contains more than 255
characters, then you will need to use the Memo data type.
Memo Memo type fields are used to keep information such as notes,
comments or explanations. They hold up to 64 000
characters of alphanumeric data.
Number These are numeric fields and are used to store only numbers
that will be used to perform calculations. Performance of
the database will be better if numbers that are for
identification/information only and will not be used in
calculations are stored as text. Numbers are stored in any
one of five fixed sizes:
x Byte size from 0 to 255 without decimals, occupying
1 byte
x Integer Size is from -32, 786 to 32 767 without decimals,
occupying 2 bytes
x Long Integer size is from -2 147 483 648 to 2 147 483 647
without decimals occupying 4 bytes
x Single Size is up to 38 digits, with or without decimals,
occupying 4 digits
x Double size takes up to 398 digits with or without decimals
and occupies 8 bytes
Date/Time These fields contain date and time formats. Date fields can
be used for calculations such as age. It should be noted
that date/time fields have their width being set automatically.
Examples of some formats are short date, long date, general
date, short time etc.
Currency Used to store currency data in a special fixed format with
four decimal places to prevent rounding errors. Currency
entered can be up to 15 digits.
TYPES OF DATABASES
Databases are usually structured according to one of the following models:
x The hierarchical model
x The network model
x The relational model
The hierarchical model is organised in terms of parent-child relationships.
The hierarchical model is also known as the tree model because it follows
an inverted tree-like structure. This means that you can access several
child records from a single parent record. And child records can be grouped
according to parent records.
The network model simply extends the hierarchical model by allowing
more flexible linkages between parent and child objects. For instance, a
child record may have more than one parent record.
The network and hierarchical models are suitable for information that is
organised in a predetermined and fixed structure. These models are used
in products such as CD-ROM-based encyclopaedias.
The relational database model is used when data needs to be organised in
a flexible manner. Records in a relational database can be grouped in many
different ways according to specific needs. In a relational database you
can construct queries that retrieve data that is grouped in meaningful ways.
For instance, you might use a database that has information about turnover
and geographical location. By constructing a query, you can extract turnover
statistics for a particular geographical location from the database.
TABLES
In a relational database, data is described using two-dimensional tables.
Tables consist of columns and rows. Columns are used to list the various
attributes of data. Rows are used to contain the individual records
So in a table that contains information about customers, you might have
columns for:
x Names
x Telephone numbers
x Postal addresses
Each customer that is entered into the Customers table is a record. Rows
are generated whenever a record is captured into a table. Each row consists
of fields that correspond to the different columns. So one might refer to the
Names field in the Customers table.
A flat-file database consists of a single table. For instance, you can think of
a Microsoft Excel spreadsheet as a flat-file database.
A relational database consists of several tables. Tables in a relational
database are related to each other by shared columns.
So the Names column in the Customers table might also be a column in
the Sales table. This allows you to construct queries that link records in the
Customers table to records in the Sales table.
Relational databases can be constructed and maintained using a relational
database management system (RDBMS). Microsoft Access provides an
extremely flexible environment within which to design databases, allowing
you to change your basic design over time.
F IELDS
While planning your tables, you need to decide on the fields you will use in
each table. Fields should break down information into its smallest logical
parts. So instead of having a single field for addresses, you might have a
field for postal codes, another for street addresses, and a third field for
telephone numbers.
It's not usually a good idea to include data that has already been processed
in your table. So you should try to avoid creating columns that contain
totals derived from existing fields. It's more efficient to build derived data
into your database when you create reports.
Note that if you choose the Blank Access Database, you will be taken to
the File New Database window, which prompts you to provide a name
for the database.
The use of the tabs was covered in Module 2. As a recap, the tab in use
appears raised higher/is different from the rest. In this diagram, the selected
tab is Tables. To select a different tab, just click on the tab.
This shows the name of the database that is in use and minimise, maximise
or restore and close buttons for that database window are displayed on
the far right side of the bar.
OBJECTS TAB
Use this tab to view the desired objects such as Tables, Queries, Forms,
Reports etc. Once you choose a tab a list of objects will be displayed, from
which you can select the desired one.
Using Help
No matter how proficient one can become with using any package, there
are times when there is need to use the help features.
All Office packages come with a help facility. In Microsoft Access (as in
other Office programs) there is an Office Assistant that can answer
questions, offer tips and provide help for the feature selected.
Double-click on a category
such as this one to see the
help topics that go with it.
The Index tab allows you to see a list of index entries, just scroll through
the list to see entries that do not fit into the screen. This option is also
flexible in that it allows you to search for entries faster by giving you the
option of typing the word (or first few letters of it) you are looking for.
The Find tab can be used to search for words or phrases that may be
contained in a particular Help topic.
1. Click on Help
1
2. Select Contents and Index
2
3. Make sure that the Index tab is selected.
4. Type sa (for save) in the textbox as we
would like to search for help on how to
save in Access.
(Notice that as the first few characters
of the phrase are typed it moves to help
5 on words starting with sa…)
5. Select using toolbar button for the index
5 entry we want help on
Notice that the particular topic's name
6
3 is written in the text box for the word
we are looking for
6. Click the Display button so that you are
able to see the help topic associated
with saving using the toolbar button
The What's This icon is also a very useful tool to make of use
when one is using dialog boxes. If there is an option in the dialog
box that you do not understand, click the What's This icon from
the dialog box's title bar and click on the option to see the help
topic pertaining to the option.
Just as all textbooks have a contents page of what they contain, the
Windows Help facility is
no exception.
1. Click on Help 1
2. Select Contents
and Index
2
3. Click on the
Contents tab to
select it
4. From the list of topics that appear all you need to do is to double-click
on the icon of the major category containing the help topic you want
5. Select the help topic you want from the list that appears.
4
5
FIELD NAME
RECORD
FIELD ITEM
NAVIGATING BUTTONS
TOTAL NUMBER
OF RECORDS IN A
TABLE
CURRENT
RECORD CLICK TO ADD A
CLICK HERE TO GO NEW RECORD
TO FIRST RECORD
MAIN OPERATIONS
Creation of a database requires a valid reason for doing so and some of
the steps to be taken have been explained in previous ICDL modules.
Planning steps should involve making decisions on:
x What data will be stored
x Where the data will come from
x Validation rules for data entry
x Which unique data field will be used as the primary key
x An appropriate filename for the database
x Where (i.e. in which folder) the database will be stored.
1. Click on File
2. Click on New …
The New Dialog Box appears
3. From the New dialog box, click on the Database icon
4. Click on OK
5. Type a name for the database in the File name text box
6. Click the Create button
CREATING A TABLE
In the following exercise, the table to be created should contain fields
appropriate to store each student's:
x File number
x First name
x Surname
x Date of birth
x Home town
The following exercise will lead you into entering data into the table that
was created in the previous exercise.
Defining Keys
Setting up an Index
An index is used in Microsoft Access to find and sort records. Microsoft
Access uses indexes in a table as you use an index in a book to find required
chapters. It looks up the location of the data in the index. You can create
indexes based on a single field or on multiple fields. Multiple-field indexes
enable you to distinguish between records in which the first field may have
the same value.
Updating a Database
Each time that any additional records are added into any of the tables
within the database, if changes are made to table properties, or additional
objects such as queries and reports inserted, the database file should be
saved.
1. Open the Student database so that you can be able to open the
Student Information table
2. Click on the Add New record button ( ) from the navigating
buttons at the bottom of the Access screen
The navigating button now shows that the table has 5 records
3. Add a new record with the following field details:
TM06 ; Tanatswa ; Colin ; 21/12/2001, Chinhoyi
4. Go back to the field for Surname in the new record and delete Colin
replacing it with Mupinda
Your record should now have the information similar to that given
below:
TM06 Tanatswa Mupinda 21/12/01 Chinhoyi
The rules as for deleting text in Microsoft Word apply when deleting
data in a table.
5. Click on Edit (after making sure that the row selector is in record 5 as
this is the record to be deleted. If it is not, click on any field in the
record or in the row selector button to select record 6)
6. Select Delete Record
7. Click the OK button to confirm you want to delete the record
OR instead of steps 5 and 6, with the record to be deleted selected,
click the Delete Record button ( )
Another way is to click the row selector button for record 5 so that it is
selected. Simply press the Delete key on the keyboard!
Notice that you cannot undo a deletion of a record
8. Go to Record 2 and change the name Justin to Munyaradzi
9. Click the Undo button or from the Edit menu, select Undo
10. You will notice that the full text of the Student File No field is not visible
Go to the Format menu, select Column Width…
11. You can either type in a new column width or better still, use the Best
Fit button which changes the size of the column to accommodate the
largest entry in the column OR instead of steps 10 to 11, you can
double-click the column selector cross hair between the Student File
No. and Name fields.
Moving Columns
12. Click on the Town field button to select the whole column
13. Move the cursor to the button area and ensure it is tilted
14. Drag to the line between Surname and Date of Birth columns to move
the column to this new selection
15. Save changes and close the table
PRINTING A TABLE
Printing is just the same as with all the other packages. One of the things
to highlight is that you can choose to print certain record.
Table Design/Layout
2. In the lower portion of the window, click the Field Size property box
For a text field, type the maximum number of characters to allow in the
field (up to 255).
This is how the input looks like in the Design view window for the currency
example.
Note that where you do not add validation text, as done above, the general
error message is the one that appears. It is good practice to enter your
own validation text so as to make your table more user-friendly.
Using these examples, create a table to test each of the data types. As an
example, for the currency field enter values such as $59 999, $60 000,
$500 000, $900 000, $901 000, $1 000 000. In other words, enter values
at the limits, in-between the limits, outside the limits as well as just outside
the limit to test.
TYPES OF RELATIONSHIPS
Microsoft Access allows you to link tables using the following types of
relationship:
x One-to-one
x One-to-many
x Many-to-many
x Many-to-one
A one-to-one relationship allows you to link each record in one table to a
single record in another table. One-to-one relationships can be used to
break up tables that have a large number of fields. Although one-to-one
relationships are the simplest kind of relationship, they are not that common
because it's usually easier to use a single table. In order to create a one-to-
one relationship between two tables, you must use fields that are primary
keys to link the tables.
A one-to-many relationship allows you to link each record in one table to
several records in another table. For instance, each employee entered into
the Employees table might be linked to a large number of records in the
Sales table. But each sale that generates a record in the Sales table is
linked only to a single record in the Employees table.
In a one-to-many relationship, only one of the fields being linked can be a
primary key. The primary key must be located in the table that contains
one record for the many records in the other table. So in the case of the
Employees and Sales table, the Employees table holds the primary key.
Many-to-one relationships are useful when updating multiple records that
are linked to a single value in another table – such as Employees from a
particular region.
A many-to-many relationship between two tables allows you to create one-
to-many relationships from either table. So if you have a table for clients
and a table for sports, you can link several sports to a single client. And
you can link several clients to a single sport, such as golf. Or you can
retrieve several records from the Sports table for several clients.
JUNCTION TABLES
To create a many-to-many relationship between two tables, you need to
create a third table, called a junction table. This table will contain a primary
key with at least two fields – one for each foreign key from the tables that
you are relating. One-to-many relationships are created to the junction
table from the tables to join them in a many-to-many relationship.
Let's create a diagram of tables and relationships for a database called
Customer Orders that is needed by Award Sportswear.
You start by gathering information on the purpose of the database. After
interviewing a range of employees at Award Sportswear, the following
information needs in relation to the Customer Orders databases are
identified:
x Information on each customer's payment record
x Records of which products particular customers order
You start by deciding what tables to create, and in this case they are:
x A Customers table
x An Orders table
x A Products table
x A Payment table
You now determine appropriate fields for each table, informed by your
earlier research into the needs of employees at Award Sportswear. You
decide to create an ID field for each table to serve as the table's primary
key. You start by determining relationships from the central table – in this
case the Orders table. One customer can place several orders, but each
order is placed by a single customer. So you define this as a one-to-many
relationship as shown.
Because some orders are paid off in instalments but each instalment is for
a single order, you define a one-to-many relationship between the Orders
table and the Payment table. Each payment is for a particular order. Several
different products can be ordered in a single order. And each product can
be ordered many times. So you need to create a many-to-many
relationship between the Products table and the Customers table. In order
to create a many-to-many relationship between orders and products, you
create a junction table called Order Details.
The primary keys of both the Orders and the Products table are included
in the Order Details primary key.
You can also include fields in the junction table that are not included in the
Orders and Products tables, such as Quantity.
USE OF FORMS
It was mentioned earlier that data can be viewed in two ways, namely form
view and datasheet view. In this section you will learn how to create, modify
and use a form.
Creating a Form
Microsoft Access provides tools to easily create forms.
To quickly create a form, use the AutoForm Tool. The tool will create a
form showing all the fields from the table in use, in the sequence in which
they would appear in the datasheet.
SAVING A FORM
1. Click on File
2. Click on Save
The Save As dialogue box
appears displaying the name
of the table you created a
form for
3. Type a name for the form
4. Click on the OK button
After doing the previous exercise your datasheet should now look like the
one below
FORM VIEWS
There are three views associated with an open form. These are Design
View, Form View and Datasheet View. To switch from one view to another,
click on the View menu or click on the View button on the toolbar.
You will arrange the fields in such a way that, the Student File No field will
be at the top middle position and the Name and Surname fields side by
side just below the Student File No Field and finally below the Name and
Surname fields there should be the Date of Birth and Town fields side by
side in the same row as shown below
RETRIEVE INFORMATION
WHAT IS A QUERY?
A query is the most important tool for turning the data in a database into
information. A query must be based on the table. Queries are mainly used
to search for several fields based on certain criteria, for example in the
database you have been creating you can decide to look for all those students
who live in Gweru and only students from this town should be displayed.
Basic Operations
With a query you can
x Search on several fields
x Specify several conditions(known as criteria) on one field
x Sort the results in the order of your choice
x Save the design of the query so that it can be run regularly
x Perform calculations on the data
x Also base forms and reports on stored queries
11. Click on the View button on the tool bar to go to the Design
View
12. Click on the Save button on the toolbar and type Students
from Gweru
13. Click on OK
14. Close the Query Design form
12
If you want to see the values that match both criteria, type the criteria on a
single row (in each individual field) in the QBE (Query By Example) grid. If
you type criteria in a wrong field, no results will be available. If you type
criteria in a blank field you will receive the error message shown below.
9. Click in the next Field row list box and select the Town
10. In the Criteria row type Banda in the Surname column
Notice that Microsoft Access encloses text in apostrophe
marks
11. In the Criteria row type Gweru in the Town column
The other Banda will not appear as their town is not Gweru.
The criteria looks for all records with Banda as a surname
as well as (and) resident in a town called Gweru
13. Click on the Save button on the toolbar and type And
condition as the name of the query in the Query Name
text box
14. Click on the OK button
15. Close the Select Query dialog box
If you want to see the values that match either of the criteria (Or condition),
type the criteria on different criteria rows in the QBE.
Make sure that you type the criteria in the correct field, for example ensuring
that you type Gweru in the Town field and not in any other criteria row.
As an example we will use the Studentdata database to find the people
who either live in Gweru or have Banda as a surname
9. Click in the next Field row list box and select the Town
10. In the Criteria row type Banda in the Surname column
Notice that Microsoft Access encloses text in apostrophe
marks
11. In the Or Criteria row type Gweru in the Town column
12. Click the Run button
13. Click on the Save button on the toolbar and type Or
condition as the name of the query in the Query Name
text box
14. Click on the OK button
15. Close the Select Query dialog box
16. Open the query and go to design view. Find out what is
wrong about typing Gweru in the or criteria row of the
surname column.
Adding Filters
Filters are used to display records or sort records using form view or
datasheet view. You may have used these in Ms-Excel when doing ICDL
Module 4 Spreadsheets.
Refine a Query
MULTI-FIELD SORTING
When many fields are used in sorting, Microsoft Access processes the sort
specifications from left to right. The most important sort field is the leftmost
field and the less important sort fields are placed in order of importance to
the right of the most important sort field. This only applies if you use the
Design view screen of the query as shown below:
As an example, if you Sort Ascending for both the Surname and the
Name the results will be as follows. Access will sort the data first by
Surname (in alphabetical order) but where surnames are similar (that is
they are the same), it will sort that surname based on the alphabetical
order of the names.
If you need to sort your data using one field only, then you can make use
of the Sort icons (available from the Datasheet toolbar) shown below:
Sort Ascending icon Sort Ascending icon
Remember that the value must be written in the criteria row of the field you
want. For example if you have a field called Salary, then while in Design
view, move the cursor to the criteria row of the Salary column and type, for
example <20000. This will result in only those salaries below 20000 being
displayed.
You can also choose to sort the results in ascending or descending order
or by multiple criteria.
FUNCTIONS OF REPORTS
Microsoft Access reports use the concept of "What you See Is What You
Print". Because you have control over the size and appearance of everything
on a report, you can display the information the way you want to see it.
x You can group and sort the data in the report. By choosing to group
the report on a field that contains repeating values, you can ensure
that the value is shown only once on the report
x Do calculations on the data in the report
x Show data from more than one table as long as the tables are related
x Display graphics and images
CREATING A REPORT
Creating a Report from scratch is laborious and tiresome. In Microsoft Access
it is easy and fast to create reports by using the Wizards. It is recommended
that you use some of the following Wizards for simple reports, Auto Report
Columnar, Auto Report Tabular, Report wizard or Label Wizard.
Modifying a Report
There are so many things that can be modified on a report. We will look at
some of these things.
The appearance of the whole report can be changed by clicking on the
Autoformat button . Select the AutoFormat that you want.
If when you created the Employee table you did not change the default text
size (50), you will notice that for example the figures do not all come out.
We need to enlarge the fields for the salary fields as well as the grand total
fields.
Just as with Microsoft Word, you can format the appearance of the text in
any way you like. We have done most of this when we were looking at the
section on Forms. The procedures are also the same for reports. All you
need to do is to select the label controls of the text and then applying the
appropriate formats from the formatting toolbar.
The data in the detail section can also be changed so that it appears
differently. All you need to do is to select the control and then right-click (or
click on the Properties button). Set the format properties you want.
As an exercise, open the Employees report in design view and change the
salary data so that it does not have any decimal places. (Hint: Select the
Salary control from the detail section, right-click and select Properties. From
the Format tab, look for the decimal places row and change it to 0. Close
the dialog box and preview the report to see the effect.). Change a number
of formats so that you can be used to changing formats.
Should you want to include new labels in your report, click the Label button
. This button is available after you have clicked the Toolbox button
. Drag an area in the report where you want the label to appear and
then type in the text for the label. Press the Enter key or click out side the
control.
To edit the text in a label, select the text and type in the new text.
Deleting a Report
1. Make sure that the report you wish to delete is closed.
If this is not done, you will get an error message similar to the one
below
2. Click on the Database icon or press the F11 key from the
keyboard to open the Database window if you are not in it.
3. Click the Reports tab to see all the reports available for the database.
4. Click on the name of the report you wish to delete.
Press the Delete key from the keyboard or click on the Delete
icon from the Database window toolbar.
PREPARING OUTPUTS
Set page setup options for a table, query, form, or report
1. On the File menu, click Page Setup.
2. Click the following tabs for the options you want to set:
PRINTING A REPORT
Before you print a report for the first time, you might want to check the
margins, page orientation, and other page setup options. For more
information, click .
1. On the File menu, click Print.
2. Enter the settings you want in the Print dialog box.