Transcript document

What is a database?
A database is an organised and structured collection of data
which you can search through.
Think of a database as an Electronic Filing system.
Almost everyone who uses a computer will use a database
system for something:• banks use a database package for storing customers'
accounts information.
• schools will use a database package to store information on
all the pupils.
• police use databases to keep information on people with
criminal records.
• Driver and Vehicle Licensing Centre.
Why use a computer system over an
manual filing system?
• Information can be accessed easily and quickly.
• More space in office, less need for many filing cabinets.
• Standard of work can be higher because correction and
amendment is easier.
• Less likely to lose information.
How is a database organised?
A database file consists of records and fields.
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.
Surname: Smith
Forename: Ross
Age:
23
Street:
11 Catriona Rd
This is a FILE.
This is a RECORD.
It has 3 records.
It has 4 fields.
Surname: Smith
This shows the FIELD
called Surname.
Features of Databases
Databases have all the features common to general purpose
packages. The following features are special to databases.
• Create fields
• Add and alter records
• Search, query or find
• Sort
Creating Fields
The first thing you must do is create one or more fields to hold
information. This involves choosing a field name, field type and field
size.
Field Name – Surname
Surname: Smith
Field Name – Age
Field Type – text
Field Size - 5
Age:
23
Field Type – Numeric
Field Size - 2
Searching
Search facility allows the user to ask the computer to “pick out” or
“select” information from the database.
eg, search the pupil file using the surname field for the word “Smith”.
Complex search is a search which involves searching on more
than one field.
eg, search the pupil file using the surname field for the word “Smith”
AND age field is “12”.
Key Fields (Primary Key) – Credit
A Field which uniquely identifies one record from all the others in the
database.
Eg. A field like student number which is unique only for that record,
this is called the primary key field.
Searching for Information on CD-ROM/WWW
CD-ROM
You can search a CD-ROM, such as an encyclopaedia for information.
Internet
When searching the internet, you can use an on-line encyclopaedia
or a search engine such as Google or Ask to find information. For a
simple search you would enter one word.
Complex Search on the Internet
User can use the advanced search feature of the search engine.
Sorting
Sort facility allows the user to arrange the records in a database in
alphabetic or numeric and ascending and descending order.
eg. Sort the file pupil on the surname field in ascending order.
A
Z
Ascending Order
1, 2, 3, 4…..
Z
A
Descending Order
Z, Y, X, W……
Sort
Complex sort is a sort which involves sorting on more
than one field.
Eg. Sort on forename field, and then sort again on
surname field. Two operations have to be performed. So
that Janet Smith comes before John Smith
Reports and Layouts (Credit)
Any information on your database that you print out is a report. The
output format determines how records will be displayed on the
output screen.
The user can choose how the information in a database is presented.
This is done by altering the format of the database.
Surname: Smith
Forename: Ross
Age:
23
Street:
11 Catriona Rd
Surname
Forename
Age:
Street:
Smith
Ross
23
11 Catriona Rd
Austin
Jennifer
25
8 McGhee Street
Surname: Austin
Forename: Jennifer
Age:
25
Street:
8 McGhee St
The user may also alter the way the screen looks. This is known as
input format. This feature allows faster data entry.
Computed Field (Calculated Field) - Credit
A computed field will carry out a calculation using the contents of
other fields in the same database file.
eg. Finding the average mark of pupils test results.
Surname: Smith
Test 1:
15
Test 2:
12
Test 3:
10
Average
12
Computed Field (Test 1 + Test 2 + Test 3 / 3)
Binary
Computers only understand binary.
Bit
A binary digit, either 0 or 1.
Byte
A group of eight bits
Bit - Binary Digit (o or 1)
Byte - Made up of 8 bits
Kilobyte - 1024 Bytes
Megabyte - 1024 Kilobytes
Gigabyte - 1024 Megabytes
Terabyte - 1024 Gigabytes
Calculation of backing storage requirements in a database.
You can calculate the amount of backing storage required to hold data
in a database.
Below is an example of one record in a phone outlet company.
Field
Name
Add ress
Town
Postcod e
Phon e Make
Phon e Mode l
Phon e No.
Network
Sample Da ta
Lynn Smith
9 Pa rk Roa d
G81 2 BP
Glasg ow
Noki a
821 0
797 7688 799
Orange
Field Size
(bytes)
30
60
20
8
15
5
12
10
Maximum Number of characters
1. What is the maximum number of bytes required to store one
record of the database?
Answer
Add each field to give the maximum size of a record. = 160 Bytes
Field
Name
Add ress
Town
Postcod e
Phon e Make
Phon e Mode l
Phon e No.
Network
Sample Da ta
Lynn Smith
9 Pa rk Roa d
G81 2 BP
Glasg ow
Noki a
821 0
797 7688 799
Orange
Field Size
(bytes)
30
60
20
8
15
5
12
10
Bit - Binary Digit (o or 1)
Byte - Made up of 8 bits
Kilobyte - 1024 Bytes
Megabyte - 1024 Kilobytes
Gigabyte - 1024 Megabytes
Terabyte - 1024 Gigabytes
1. Using your answer from question 1 calculate how many
records you can store on a 1.44 Mb floppy disk.
•
Change 1.44 Mb into Kb. 1.44 * 1024 = 1474.56 Kb
• Change 1474.56 Kb into bytes. 1474.56 * 1024 =
1509949.44 bytes
•
1509949.44 bytes
160 bytes
= 9437 records
Computers and the Law
Data Protection Act
Protects data stored on a computer system.
If an organisation holds data then they must register with
the DPA.
Eight Data Protection Principles (Data User)
1. Personal data should be obtained and processed fairly and lawfully.
2. Personal data can be held only for specified and lawful purposes.
3. Personal data should be adequate, relevant and not excessive for the
required purpose.
4. The personal data should be accurate and kept up-to-date.
5. The personal data should not be kept for longer than is necessary for the
purpose for which it is collected.
6. Data must be processed in accordance with the rights of the data
subjects.
7. Appropriate security measures must be taken against unauthorised
access.
8. Personal data cannot be transferred to countries outside the European
Union unless the country provides an adequate level of protection.
The rights of data subject
• See data held on themselves
• Have errors corrected
• Compensation for distress caused if Act has been
broken
• Prevent processing for direct marketing
http://www.teach-ict.com/as_a2/topics/data_protection_act/data_protection/8_principles.ht
Computer Misuse Act
Makes it a criminal offence to gain unauthorised access
to a computer system, or hacking, or to distribute a virus.
Virus
Hacking
A virus is a program written to cause
mischief or damage to a computer
system.
Hacking means illegally accessing
other people's computer systems for
destroying, disrupting or carrying out
illegal activities on the network or
computer systems.
Copyright, Design and Patent Act
Helps to protect copyright owners from having their work
copied by others without payment.
Downloading Software (freeware, shareware)
Downloading Music
Creating Queries – Complex Sort
Sorting on two or more fields. For example, sort in order
of surname and in order of age from youngest to oldest.
Forename
Surname
Age
Susan
Crestwell
17
Frances
Davidson
21
John
Henderson
24
Jane
McNeill
18
David
Mitchell
21
Homer
Simpson
17
Lynn
Simpson
21
Alphabetical
Order/ascending order
Ascending order
Using Access
• Create a query in design view
• Insert field names
• Choose what fields your wish to sort on.
Creating Reports
Access allows you to create different layouts. You can
customise the layout to your liking.
Using Access
• Create a new report
• Choose the table you wish to use
• Insert the fields you need to use
• Customise to your liking