Download Unit 1 Databases - Portlethen Academy

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Oracle Database wikipedia , lookup

Open Database Connectivity wikipedia , lookup

IMDb wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Ingres (database) wikipedia , lookup

Concurrency control wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Functional Database Model wikipedia , lookup

Database wikipedia , lookup

Clusterpoint wikipedia , lookup

Relational model wikipedia , lookup

ContactPoint wikipedia , lookup

Database model wikipedia , lookup

Transcript
Information System Design & Development National 5 Unit 1 Database What is an Information System? An Information system is a combination of hardware and software which is
used to input, process and store data and then output information.
Business firms and other organizations rely on information systems to carry
out and manage their operations, interact with their customers and suppliers,
and compete in the marketplace. For instance, corporations use information
systems to reach their potential customers with targeted messages over the
Web, to process financial accounts, and to manage their human resources.
Governments deploy information systems to provide services cost-effectively
to citizens.
Digital goods, such as electronic books and software, and online services,
such as auctions and social networking, are delivered with information
systems. Individuals rely on information systems, generally Internet-based, for
conducting much of their personal lives: for socializing, study, shopping,
banking, and entertainment.
Watch the video – “What is an Information System”
Information Rich & Poor We live in an age where information and knowledge are so important that
society can be divided up into two groups. These are “information rich” and
“information poor”.
If you are information rich you have access to many TV and radio channels,
books, newspapers, magazines, journals, and of course access to the World
Wide Web.
Those who are information poor tend to not have access to the Web and
probably find it difficult to access relevant books and journals. Even in general
conversations a discussion about a TV programme shown on satellite TV will
be lost on people who only have 4 or 5 free view channels.
To help us remember all the information that we need we use an Information
System, which is a combination of hardware and software which is used to
input, process and store data, and then output information.
2
Data
What do the following items mean to you?
•
•
•
12 34 24 33 19 11 21-11-1998
AAAAA
Probably nothing - this is because they have no specific meaning or
application. They are examples of Data. Data consists of unprocessed, raw
facts and figures – they do not have any meaning until they are processed
and turned into something useful. Data comes in many forms, the main ones
being letters, numbers and symbols.
Information When data is processed, (known as data processing), and given meaning
and context it becomes information which Is suitable for someone to understand and make use of. For example:
•
•
•
Lottery Draw for 12/01/2013: 12 34 24 33 19 11
Date of Birth: 21-11-1998
Predicted Higher Grades: AAAAA
Therefore, information is processed data that has been given
meaning and context. In order for information to be useful it
must be interpreted by someone with knowledge.
Knowledge Knowledge is our understanding of the information which
occurs from having the ability to apply information, i.e. it is an
understanding of rules. For example:
•
•
•
The lottery draw numbers 12 34 24 33 19 11 match the numbers on
your ticket. - You have won the lottery.
Your friend’s date of birth is 21-11-2000 - She is 13 and too young to
vote
Predicted Higher Grades: AAAAA - You should be able to go to a
good university
3
Activity: Data, Information & Knowledge 1. Summarise the explanation of Data into your own words.
2. Summarise the explanation of Information into your own words.
3. Summarise the explanation of Knowledge into your own words.
Key Points to Remember
•
An Information System is a combination of hardware and software
which is used to input, process and store data, and then output
information.
•
Data consists of unprocessed, raw facts and figures.
•
When data is processed and given meaning and context it becomes
Information
What is a Database? A database is an organized collection of information or data. Putting
information into a computer database gives you far more flexibility in
organising, displaying and printing that information.
The contacts feature on a mobile phone and the products listed and grouped
on a games, clothes or music website are all databases. A database is simply
a list of items, all of the same kind, organised in a way that makes it easier to
choose or read from the list.
Watch the video – “What is a Database”
Why do we use Databases? To the right is a picture of a paper filing cabinet. These are still
used today in offices but not as much as they used to be.
Computerised databases are now much more popular and
widely used. There are many reasons for this.
Advantages
Paper filing cabinets were big and bulky and needed a
lot of organisation to make sure everything was stored
correctly.
A computerised database doesn’t take up lots of room and can be
easily edited without having to re-print things.
4
Computerised databases also have other advantages such as it is
much quicker to search for a certain pieces of information rather than
having to trawl through hundreds of records.
It is also easier to sort a database for example by a person’s surname
which previously in a paper based database would have taken a long
time to manually sort the database on a different field.
In short databases are stored electronically because this makes them quicker
and easier to edit, search and sort, and they take up less physical space.
•
Editing a database is when new details are added to the database or
existing details are changed.
•
Searching a database simply involves finding a particular set of
information from the database, for example everyone whose surname
is Smith.
•
Sorting a database is the act of reorganising the database into another
order, for example in ascending alphabetical order by surname from A
to Z or in descending numerical order by age from oldest learner to the
youngest learner.
Who Uses Databases? Databases are used by many groups of people, for example:
•
•
•
•
by schools, so that they know which pupils are absent
by supermarkets, so that they know what items are in stock
by banks, so that they know how much money their customers have.
Police use databases to keep information on people with criminal
records.
A database application (such as MS Access) is required to create an
electronic database. A database application is a program that organises the
data entered into a computer.
The computer user enters into the computer the data that he or she wants to
keep, for example a list of customers or all the people in a club.
The database application arranges the data into a table.
5
How is a Database Organised? There are three key terms you must know:
•
•
•
The whole set of data in a database is called the file
The set of information on one single subject (for example, one pupil in your
school) is called a record
Each separate heading of information inside a record (for example, your
date of birth) is called a field
Here is a data table from an example film database.
Film
Certificate
Genre
Goodfritters
18
Gangster
Diary of a Lazy Kid
PG
Kids
The Armwrestler
15
Drama
Inglorious Bar Stewards
18
War
Record
Field
To create a database requires the user to define the file structure. This
involves creating fields by entering each field name and its appropriate field
type.
You will learn about eight different field types. These include text, numbers,
date, time, graphics, calculated, link and Boolean.
All the data for one film is called a record (not to be confused with a row in a
spreadsheet). The Armwrestler is suitable for people aged 15 years and over
and is a drama.
Each piece of data for a film – the name, the certificate and the genre – is
called a field in the data table.
6
When planning and designing a database the types of field used must be
considered. There are a number of different field types to choose from:
• text
hold word, for example fornames of pupils
• numbers
holds numbers, for example exam marks. Can be integers
(whole numbers) or real (floating point), eg 1.34
• date
hold dates, for example date of birth in different formats,
01/01/2013; 1 January 2013
• time
holds times, for example the start time of an exam in different
formats, 23:30:00 or 11:30 pm
• graphics
databases can hold images, for example photographs of
employees or a picture of a product.
• calculated
similar to a spreadsheet, calculated fields carry out a
calculation on another field or fields and displays the result for
example averages or totals
• link
used to store links to files on :
ƒ
ƒ
ƒ
a computer
a network
the internet
• Boolean
designed to store two values for example Yes or No, True or
False.
• OLE
Object field – in Microsoft Access, for example, and object
field can hold a Word document, and Excel spreadsheet or a
Paint graphic.
OLE Field
7
Activity: Field Types Forename: John
`
House Number: 5
Town: Kinlochleven
Phone No: 01399 772221
Facebook: www.facebook.com/johnsmith
Surname: Smith
Address: Riverside Road
Postcode: PH33 7QR
Date of Birth: 26/09/2003
Gets bus to school: Yes
Photograph:
1. From the information given in the box above pick out the field names
and then state what field type each field is.
2. State three advantages of using a computerised database compared to a
paper based database.
3. State what a file is.
4. State what a record is.
5. State what a field is.
6. What is Boolean?
7. Explain what an information system is.
8. Describe what information rich and information poor means.
9.
8
Activity: Smart Phone Database 1. Go into the shared area and copy over the “National 5
Database Tasks” folder.
2. Inside that folder there should be a file called, “Smart Phone
Database”
3. Follow the instructions step by step.
Exercise 1.
You own 100 computer games and you want to keep information about
them all on computer. You should use a:
(a)
(b)
(c)
(d)
2.
spreadsheet
database
word processing program
drawing program.
Here is part of a database where information about cars is stored.
Name of field
x
Model of car
Number of doors
Type of field
Text
Text
y
Sample data
Ford
Focus
5
The letter x shows the name of a missing field. Study the sample data
and decide on a name for field x:
A
B
C
D
3.
In the database above, the letter y shows the missing type of field for the
number of doors on the car. Choose the correct field type for y:
(a)
(b)
(c)
(d)
4.
text
number
date
graphic.
You keep a database of film stars. When a new star appears in a film
you need to:
(a)
(c)
Bob
colour of car
car registration
make of car.
edit a star’s record
add a new record
(b) add a new field
(d) create a new file
9
Key Fields: Primary Key Imagine what would happen if Mrs Smith telephoned the school to ask the
secretary to pass on a message to her daughter Charlotte.
If there were nothing to uniquely identify the students' records, the secretary
would have to search for all of the 'Charlotte Smiths' in school and then say,
'sorry to keep you waiting Mrs Smith, could you just tell me if your daughter is
in S1, S2, S3, S4, S5 or S6? And if she is in S2, which one of these five girls
is she?'
How about a patient going to have an operation. 'Oh hello Mr Jones, I have 4
Mr Joneses having an operation today, can you tell me if yours is to remove
your tonsils, your arm, put your leg in a cast or give you a hair transplant?’ I
think that would be one very worried patient!
Therefore, it is important that every single record in a database has
something to uniquely identify it and this is called the 'Primary Key' or
sometimes the 'Key Field'.
When you started school, you were given a 'student ID' or an 'office number'
(primary key).
10
Key Fields: Foreign Key A foreign key is used to link tables together and create a relationship. It is a
field in one table that is linked to the primary key in another table.
= Primary Key
= Foreign Key
11
Validation Validation is the process of checking that data entered into a system is of the
correct type and structure.
You need to know about the following types of validation:
•
Presence check: this simply checks that the data has been entered
and that the data field has not been left blank.
•
Restricted choice: this type of validation presents the user with a
choice, such as a dropdown menu with a range of numbers or textbased items to choose from.
•
Field Length check: this specifies the size of a field, for example
stating the number of characters a field can hold. This restricts the
amount of characters the user can input into the field.
•
Field range check: this specifies the range of numbers a field can
hold, for example >0 and < 100
12
Database Operations Once you have created your information system using a database you can
use it to carry out the following operations.
•
Adding records – A new record can be added to a file when, for
example, a new car comes onto the market.
•
Simple Search ( a search on one field) – A search is also called query
or a find. A simple search on the database file involves searching on
one field only, for example search for those records where the
first_name field = “Jack”.
•
Sort on one field – You can arrange, or sort, the records into order
based on the contents of one field, for example sort on the
second_name field in ascending order (from ‘a’ to ‘z’).
•
Complex Search (a search on more than one field) – A complex
search is based on two or more fields, for example search for those
records where the first)name field = “Jean” AND the second_name field
= “Brown”.
•
Sort on more than one field – This is where two or more fields are
used to arrange the data, for example sort class file on grade field and
second_name field, both in ascending order. This will sort the records
so that the grades are in order, with all those with grade 1 followed by
grade 2 etc, and each of these groups is sorted into alphabetical order
of second name/surname. The screenshot below shows an example of
this.
Activity: Searching and Sorting Simple Searching To do this you will need to create a query.
Before we can do this we need to check what information we want to find.
Lets find all the pupils in our database who went to Newtonhill Primary school.
We will list them in alphabetical order by Surname.
13
To do this we need to use a query planning sheet see below
Purpose of Query :
To find all pupils who went to Newtonhill Primary School Displayed in alphabetical order by Surname Close your open table and go to the query tab. You will note that there are no entries in the window. Field name Criteria Order Firstname Surname ascending Tutor group Primary school Laurencekirk Now we have planned the query we can create it. The example used here is
for Laurencekirk.
™ Click on the Queries Tab.
™ You need to create a new query. The simplest way to do this is to use
the Design view.
™ To do this, click once on New and on Design View on the pop-up
window that appears.
™ Now click once on the OK button.
14
The following window will appear
™ Choose the
Class
table
and click Add
You should now see the design view layout as shown below.
™ Double click on each of the field headings you require in the Class field
window, in this case Firstname
Surname
Tutor group
Primary School
15
Your window should look like this :
™ Now we can add the criteria and the order
™ Under the criteria box under the Primary School field type
“Newtonhil”.
™ Under Surname choose click on the sort box and choose
ascending from the drop down menu.
16
The query should now look like this
™ Now save your query as Newtonhill Pupils.
™ Now click on the orange Exclamation mark icon to run the query.
™ It will then open the query output window (below). 17
Task 3 ‐ Simple Searching You will need to collect a database planning sheets for each of these
1 Create a query to show all pupils who are in 3T1 sorted alphabetically.
2 Create a query to show all pupils who have Mr Fleming as their tutor, sort
then by youngest first.
3 Create a query to show all pupils who went to Newtonhill who are in 3C1.
Please check your answers with your teacher.
Wild Card Searches This is used when you are looking for a group or range of data. For example
if we are looking for all pupils in Cookston house. We could look for all pupils
in 2D and 3E
However we can also use a wild card. This is the * symbol . It is used to
replace any text that is not required
Eg *j* will find all pupils in something J something. The something can be
any text.
Create a Query Using *C under Tutor Group Now try these Database queries
You will need to collect a database planning sheets for each of these
1 Create a query to show all pupils who’s surname begins with W.
2 Create a query to show all pupils that are in Auchlee house
3 Create a query to show all pupils born in the month of June
4 Create a query to show all pupils who are in Bourtree and went to
Fishermoss primary.
5 Create a query to show all pupils whose initials are M W
Please check your answers with your teacher.
18
Flat File Database The database you created with the smartphone information is a flat file
database as it only has one table and each row of the table is unique.
A flat-file database is like an electronic card index file. In this type of
database, the data is stored in a single table. In the case of a games rentals
system, the table would store data about both members and games, as
shown in the table below.
Cost
Date
rented
Date
returned
Fallover 3
£2.50
03/09/12
05/09/12
Date
membership
started
03/09/11
003
GBH 5
£2.50
02/09/12
05/09/12
02/09/11
003
GBH 5
£2.50
10/09/12
14/09/12
10/09/11
008
Headband 4
£2.50
03/09/12
05/09/12
03/09/11
011
Blacktops 2
£2.50
12/09/12
14/09/12
12/09/11
011
Blacktops 2
£2.50
15/09/12
17/09/12
15/09/11
014
Toilet Rim
£2.50
03/09/12
06/09/12
03/09/11
015
Farmers
Field 3
£2.50
06/09/12
09/09/12
06/09/11
Game
code
Game title
001
Member
name
Telephone
number
Billy Whizz
Beryl the
Peril
Desperate
Dan
Dennis the
Menace
Burglar Bill
Bob
Hoskins
Freddie
Flintoff
Tom
Thumb
123344
234454
545454
676767
876454
986453
667854
454378
Flat-file databases have a number of problems:
• Data can be duplicated. Because a new record is created for each game
rented, the member details would have to be copied onto each new record,
which is inefficient.
• Duplicating data increases the chance of human error when typing in the
same customer’s details a number of times. It can then be hard to be sure
which the correct entry is.
• It is not possible to store information about a member without entering
details of a game rental. In other words a customer’s details can only be
recorded once they rent something.
• Removing a game from the database may remove the only record that
stores details of a member.
19
Relational Databases A well-designed database should avoid duplicating data. An efficient
design should use foreign keys to link to data already held in a table in the
database and avoid the need for re-entry and duplication.
An improvement on flat-file databases is the use of a relational database. A
relational database stores data in more than one table. The idea is to ensure
that data is only entered and stored once, so removing the possibility of data
duplication and inconsistency. In the above example this would mean that
there would be a separate game table, rental table and customer table.
A relational database package allows you to create
several files, or tables and have them linked together. A
table is another name for a file, i.e. a collection of records.
Before 2 or more tables can be related they need to have a
field in common. In the example shown each table has a field called
“AccCode”.
In a school database there could be a table for the pupils’ personal
information (name, address etc) and a separate one for the subjects they are
studying
If the data is stored in separate tables it makes it easier to manage. For
example, if a pupil changes their address only the personal details table will
need to be altered. If a subject choice changes then only the subject table
needs to be altered.
Example – consider a library database system
The data to be stored will be member surname, forename, address, town,
postcode, subject, ISBN, date borrowed, date returned.
As there may be more than one member with the same name or living at the
same address neither of these fields can be used as a key field. It is
necessary to introduce a new field to hold the member ID number. (Surrogate
key)
Surrogate Keys A surrogate key is a field that is introduced into the database to create a
primary key when no unique data is present.
20
In a manual, paper based, system the structure may look as follows:
Table 1
ID
surname
forename
address
town
post
code
subjec
t
ISBN
00
1
Bell
John
23 High
Street
Arbroath
DD7
5FT
Fiction
0091870364
date
borrowe
d
12/4/05
01
3
Smith
Emma
17 Main
Street
Carnoustie
DD7
5VF
Fishing
Fiction
0071675439
0091870364
19/4/05
20/4/05
06
7
Roberts
Susan
The Elms
Arbroath
DD7
8HG
Autobio
graphy
0063489654
18/4/05
date
returned
19/4/05
24/4/05
This system is not very efficient for the following reasons:
• One member has 2 books out on loan, recorded in the same record – this
is called having multi-valued fields.
• Every time a member borrows a book the whole file will have to be loaded
in and changed.
• If a member changes their address the whole file will require to be altered.
Computer databases do not allow more than one value to be stored in a field.
If the data was being stored in a flat-file database the structure would now
look like this:
Table 2
ID
Surname
Forename
Address
Town
001
Bell
John
23 High
Street
Arbroath
001
Beel
John
23 High
Street
013
Smith
Emma
067
Roberts
Susan
Post
Code
DD7
5FT
Subject
ISBN
Fiction
0091870364
Date
Borrowed
12/4/05
Arbroath
DD7
5FT
Fishing
0071675439
19/4/05
17 Main
Street
Carnoustie
DD7
5VF
Fiction
0091870364
20/4/05
The Elms
Arbroath
DD7
8HG
Autobio
graphy
0063489654
18/4/05
21
Date
Returned
19/4/05
24/4/05
There are a number of problems associated with storing the data in this form
as a single table.
• There is duplication of data. John Bell’s details are entered twice.
• If data is duplicated it could lead to data inconsistency. For example,
human error could result in Beel being entered instead of Bell in one of the
records.
• It is not possible to store information about a member without storing
details of a book - insertion problem.
• Removing a book from the database may result in removing the only
record that stores information about a member - deletion problem.
These problems can be overcome by storing the data in a relational
database. In a relational database data is only entered and stored once, so
removing the possibility of data duplication and inconsistency.
Linked Tables This is a process used to design a database in the most efficient way so that
data is not repeated, the data is easy to search and edit and related tables are
linked together.
Table 1 shows how the data would look before it has been normalised. It
has not been normalised as it contains multi-valued fields. The fields subject,
ISBN, date borrowed and date returned contain more than one value for the
member John Bell.
In normalisation one of the processes is to remove the repeating values and
place them in a table of their own.
If a database is in First Normal form (1NF), it does not have any multi-valued
fields.
To put the library database into 1NF it is necessary to create separate tables
for member and for loan:
MEMBER(MemberID, Surname, Forename, Address, Town, Postcode)
LOAN(ISBN, Subject, DateBorrowed, DateReturned, *MemberID)
MemberID is the primary key in the MEMBER table.
ISBN is the primary key in the LOAN table. MemberID is a foreign key in the
LOAN table.
22
Member Table
ID
Surname
Forename
Address
Town
Post
Code
DD7
5FT
001
Bell
John
23 High
Street
Arbroath
013
Smith
Emma
17 Main
Street
Carnoustie
DD7
5VF
067
Roberts
Susan
The Elms
Arbroath
DD7
8HG
MEMBER(MemberID, Surname,
Forename, Address, Town,
Postcode)
Loan Table
ISBN
Subject
0091870364
Fiction
Date
Borrowed
12/4/05
Date
Returned
19/4/05
ID
001
0071675439
Fishing
19/4/05
001
0091870364
Fiction
20/4/05
013
0063489654
Autobiography
18/4/05
24/4/05
LOAN(ISBN, Subject,
DateBorrowed, DateReturned,
*MemberID)
067
Primary Key is identified by Underline Foreign Key is identified by Asterisk Watch the video – “More About Databases”
“Even more about Databases”
Activity: Relational Databases 1. Open the “Splitting Tables” task sheet and complete the Puppy Task
23
Relational Databases Normally most databases will have been converted to a relational database
where repeating data is present.
You should have already normalised the Litter database. Now we are going
to create them.
Litter Sire
ID
1
2
Dame No. in Date
Puppy Puppy
Litter of
Name ID
Birth
Rover Susie 4
5/11/99 Rex
12
Sam
13
Jooles 14
Pretty 15
Saul
Judy 2
7/12/99 Punch 16
Jamie 17
Sex Cost
of
Puppy
M £500
M £450
F
£600
F
£250
M £170
M £270
LITTER (LitterID
Sire
Dame
No in Litter
Date of Birth)
PUPPY (Puppy ID
Puppy Name
Sex
Cost of Puppy
LitterID *)
You will see that we have 2 tables.
Task 5
™ Create the two tables within 1 database file called Dogs
™ The table structure is shown above
™ Litter Id and Puppy Id are Primary Keys.
24
You should have the following tables.
™ Now we have to link the data in the
two tables.
™ The field we are linking them with is
Litter ID
™ Now go into the PUPPY table
design view
™ Select lookup
wizard from the
drop down
Menu
™ Now click on
™ And press next
™ Now
select
Litter
Table and press next.
™ Select all the fields
and press next
™ Uncheck the box and
press next for each
screen until you click finish.
™ And save the table.
This process has linked the Litter ID of both tables thus creating a Foreign
Key in PUPPY.
25
Task 6 To finish the process we need to complete the relationships
™ On the home screen click on the relationships icon
This will open the window below.
™ Double click on the line between the two tables.
.
™ Check the box next to Enforce Referential Integrity.
You have now successfully linked the two tables.
26
Activity: Linked Tables In this activity you will create another table that will be linked to your
Smartphone table. We will link the tables using the unique identifier of the
smartphone product number.
1. Open the file “Linked table to customer info” from the shared area
2. Work your way through the task step by step.
Task 7 ‐ Validation ™ To complete the design of these tables we are going to set up the Sex
field in PUPPY to only allow the letters M and F. this is called a
restricted choice.
™ To this choose the Sex field and in the data type select lookup wizard
as above.
™ This time select I will type in the values I want.
™ Enter the following values M and F and then click Next > till you get to
Finish.
27
™ Now save the table.
™ Now enter in the data. You must enter the data into the Litter table
first.
™ What happens when you enter data into the following fields.
Litter ID and Sex in the PUPPY table
Task 8 – Complex Queries Using Multiple Tables Clearly we need to get the data from the correct table
Look at the query below :
Purpose of Query : All puppies that are worth £270 or more. List their names and the Sire and Dame they came from. Sort the query on alphabetical order of sire. Field name Table Criteria Order Puppy name Cost of Puppy Sire Dame PUPPY PUPPY LITTER LITTER >=270 ascending ™ Create the Query but this time add both the tables in query design
view.
™ Select the fields from the correct tables
28
Your query should look like this
™ Save and then view the results.
Task 9 Now try these Database queries for the Dogs table
You will need to collect a relational database planning sheets for each
of these
1.
2.
3.
4.
Find all male puppies in litter 1
Find all the sires with over 2 puppies per litter.
Find all puppies with a name beginning with a P
Find all puppies in litter 1 over £500
Task 10 ‐ Reports and Forms Databases are used to display information to the people using them.
This can be in the form of :
Reports:
printed out details from the queries or tables
Form :
user friendly layout for inputting and editing data.
29
Creating a Report Use the Class Database
™ Click on the Report Tag from the
home screen
™ Click create a report by using
wizard
™ Click on correct table / query and include all the fields you want to
see on the report
™ Click next through the next 2 and then pick Tabular and any of the
layouts.
™ Click finish.
™ Save the report
30
Your report should look like this:
Task 11 ‐ Forms Try the different styles of reports (columnar and justified) and save each of
them
You are now going to design your own form for additional records to be
entered.
™ Open your classes Database
™ Select Forms from the Objects section
then Select New
31
The window on the right will appear:
™ Select Design View and choose the Class table from the drop down
menu
™ Click Ok
The following window will appear:
Field List
Blank Form
Corner
™ Resize the form by holding down the mouse button on the corner
and pulling the cursor out (shown above)
If the field list doesn’t appear select View/ Field List
32
™ Select each of the Field names from the list (so that all appear on
the form) and place on the form
™ Make sure you leave enough room for the Label and the Text Box
™ Use the grids to align the Labels and the Text Boxes
When you select a box handles will appear and a hand this allows you to
position each box on the form neatly
™ You can change the appearance of your form by right clicking and
choosing Fill Back Colour
™ You can rightclick on the name box and change the size/font and
colour of text
™ Add all the fields
™ Save Form as Class input
™ Select View to see your finished form
33
Task 12 Create a form for the input of data to the doggies relational database.
Database User Interfaces: Forms This form on the left is from Thomas Cook, the travel agents,
website. In previous activities you have designed a
database. This was you designing the “back end” of the
system.
As a user of a database
we tend to use an interface called a form to
manipulate the system. This can be referred
to as the “front end”.
In this example you can see I have input
information into the form. When I click on
search this will search the database and
then display my results.
Can you think of any other forms
you have used whilst being
online?
Activity: Create a Form The Smart Phone database you have created was only the “back end”. You
are now going to create the “front end” form.
1. Open the “Phones 4 U Form” from the shared area
2. Follow the instructions step by step
34
Activity : Adding Buttons to Forms In the previous task you created a form. This is an example of an information
system as you have used a combination of hardware and software to input,
process and store data, and then output information.
In this activity you are going to add buttons to your form that do a specific job
such as go to previous record, go to next record and add a new record.
1. Open the “Adding New Buttons to Phones 4 U Form” from the
shared area
2. Work your way through the task step by step
Macros Small programs called macros can be written within some existing application
packages rather than using a standalone programming environment. For
example, a series of complex or frequently used actions in a spreadsheet or
database package can be recorded and then repeatedly activated in the
future by a single key press or combination.
Macros save time by executing a complex set of frequently used instructions
quickly, time and time again. An inexperienced user can use powerful tools
without having to know the detailed steps behind them.
Macros can be created within an application by selecting the macro function
from the menu, giving the macro a name, assigning the key/keystrokes that
will activate it and then recording the instruction/actions. Another way of
creating macros is by using a scripting language.
Activity : Create a Macro 1. Open the “Macros” task from the shared area
2. Work your way through the task step by step.
Activity : Adding a Switchboard 1. Open the “Switchboard” task from the shared area
2. Work your way through the task step by step.
35