slide 1 standard grade computing databases. slide 2 standard grade computing definitions databasea...
TRANSCRIPT
Standard Grade ComputingSlide 1
Databases
Standard Grade ComputingSlide 2
DefinitionsDatabase A database is a structured collection of
similar information which you can search
through. Eg) Police National Computer
File A collection of structured data on a particular topic. A file is made up of records. Eg) Police criminal file
Record Information held about one person or thing. A record is made up of fields.Eg) Information about a criminal
Field A single item of information.Eg) The criminals hair colour, name, eye colour etc
Standard Grade ComputingSlide 3
Example
Photo
ID 1Surname Winters
Forename PaulHair BlackEyes Blue
Height (m) 1.8Age 32
Conviction RobberyNick Name Scar Face
Field
Record
File
Standard Grade ComputingSlide 4
Types of Fields
Text holds letters, numbers and symbols
Numeric hold numbers for calculations
Date holds a date
Time holds a time
Graphic holds a picture
Standard Grade ComputingSlide 5
Size of a Field
This is the total number of characters, including spaces, needed to hold the information in a field.
Eg
Forename Surname Date of Birth Sex
Jonathan O'Reilly 08/02/1990 M
Cheryl Thompson 12/09/1989 F
Kevin Delury 23/05/1990 M
Pamela Hamilton 19/12/1989 F
Sarah - Louise Cunningham 31/07/1989 F
Field sizes
15 15 8 1
Standard Grade ComputingSlide 6
Field Name Field Size
Forename 15 characters = 15 bytesSurname 15 characters = 15 bytesDate of Birth 8 characters = 8 bytesSex 1 characters = 1 bytes
Size of 1 record = 15 + 15 + 8 + 1 = 39 bytes
For 50 records storage size = 39 X 50= 1950 bytes= 1950 1024= 1.9 kilobytes
Standard Grade ComputingSlide 7
Create record
When you create a record you must first consider –
• How many fields should there be.• The data type for each field.• What size each field should be.
Standard Grade ComputingSlide 8
Add record
A new record is added to the database.
Eg When a criminal has to be added to the police crime database.
Eg When a new pupil joins a school, their details need to be added to the school database.
Standard Grade ComputingSlide 9
Edit record
Is when details in a record need to be updated.
Eg A criminal’s record will need to change when they commit another crime. (Entry in conviction field would change.)
Eg A pupil’s record will need to change if they move house. (Entry in address field would change.)
Standard Grade ComputingSlide 10
Create field
Extra information may need to be added to each record in the database.
This means adding a new field.
The new field would be added to all of the records in the database.
Standard Grade ComputingSlide 11
Example 1
A new field called colour has been added
Make Model Reg Number
Mercedes SLK M1 ARK
Audi TT S3 ARA
BMW Z4 P21 ETE
Lotus Elise STO 53 THD
Make Model Reg Number Colour
Mercedes SLK M1 ARK Silver
Audi TT S3 ARA Black
BMW Z4 P21 ETE Yellow
Lotus Elise STO 53 THD Red
Standard Grade ComputingSlide 12
Forename Surname Date of Birth Sex
Jonathan O'Reilly 08/02/90 M
Cheryl Thompson 12/09/89 F
Kevin Delury 23/05/90 M
Pamela Hamilton 19/12/89 F
Sarah - Louise Cunningham 31/07/89 M
Example 2
Name field changed into 2
fields
Name Date of Birth Sex
Jonathan O' Reilly 08/02/90 M
Cheryl Thompson 12/09/89 F
Kevin Delury 23/05/90 M
Pamela Hamilton 19/12/89 F
Sarah - Louise Cunningham 31/07/89 M
Standard Grade ComputingSlide 13
The search facility allows you to look for information in the database.
A search may be:
Simple Look for records with a match on one field ( They have one thing in common.) Eg Hair = “Brown”
Complex Look for records with a match on more than one item in one or more fields.
Eg Hair = “Brown” AND Eyes = “Blue”
Searching
Standard Grade ComputingSlide 14
Comparison Operators
< Less than< = Less than or equal to= Equal to> = Equal to or greater than> Greater than< > Not equal to
Eg To find all records for 1st to 3rd year in a schooldatabase you could search for:
Year <= “3rd”
Eg To find all records for criminals who do not have black hair
Hair <> “Black”
Standard Grade ComputingSlide 15
In a complex search we need to link the searches together using one of the following operators:
AND Both items required in each recordOR One item required in each record
Eg To search a school database for all Standard Grade Computing pupils you could search for:
Year = “3rd” OR Year = “4th” AND Subject = “Computing”
Standard Grade ComputingSlide 16
Searching on the Internet – Simple Search
This is when you search the internet for web pages that contain one keyword.
E.g. Hotels
Standard Grade ComputingSlide 17
Searching on the Internet – Complex Search
This is when you search the internet for web pages that contain more than one keyword.
E.g. Hotels + Paris
Standard Grade ComputingSlide 18
Searching on CD-ROM – Simple Search
This is when you search on a CD-ROM for information that contains one keyword.
E.g. Music
Standard Grade ComputingSlide 19
Searching CD-ROM – Complex Search
This is when you search on a CD-ROM for information that contains more than one keyword.
E.g. Rap + music
Standard Grade ComputingSlide 20
Sorting allows you to arrange the records in a database in alphabetic or numeric order.
This can be ascending (A to Z or 1 to 9) or descending (Z to A or 9 to 1)
A sort may be:
Simple A sort on the contents of one field only.Eg Hair in ascending order.
Complex A sort on the contents of two or more fields. Eg Hair in ascending order AND eyes in descending order
Sorting
Standard Grade ComputingSlide 21
Alter record format
Databases can be displayed in different ways.
There are 2 different formats for organising your database –
• Card Format• List or Table format
Standard Grade ComputingSlide 22
Example of card format
Forename JonathanSurname O'Reilly
Date of Birth 08/02/90Sex M
Forename Thompson
Surname Cheryl
Date of Birth 12/09/89
Sex F
Forename DelurySurname Kevin
Date of Birth 23/05/90Sex M
Forename Sarah - LouiseSurname Cunningham
Date of Birth 31/07/89Sex F
Standard Grade ComputingSlide 23
Example of list or table format
Forename Surname Date of Birth Sex
Jonathan O'Reilly 08/02/90 M
Cheryl Thompson 12/09/89 F
Kevin Delury 23/05/90 M
Pamela Hamilton 19/12/89 F
Sarah - Louise Cunningham 31/07/89 M
Standard Grade ComputingSlide 24
Computed Field - Credit
A calculated field allows you to carry out a calculation on another field or fields and return the answer in the calculated field.
It is similar to using formulae in a spreadsheet.
Eg Item Cost Number Sold Total Cost
Coke £0.50 17 £8.50
Chocolate £0.35 23 £8.05
Crisps £0.27 5 £1.35
Irn Bru £0.50 11 £5.50
The computed field Total Cost would contain the formula
Total Cost = Cost * Number Sold
Standard Grade ComputingSlide 25
Keywords - Credit
This is the text used to search a file for a particular entry.
Eg) If you were searching the library database and you searched for “potter” you would get books with the word “potter” in their title.
For example Pottery, Harry Potter …
Standard Grade ComputingSlide 26
Input and output format - Credit
The user can alter the format of the input screen to make it easier to enter data.
Eg) Enter all of one field before moving onto the next record.
The user can customise the output from a database.
Eg) Creating a report
Standard Grade ComputingSlide 27
Standard Grade ComputingSlide 28
Standard Grade ComputingSlide 29
Standard Grade ComputingSlide 30
Standard Grade ComputingSlide 31
Standard Grade ComputingSlide 32
Standard Grade ComputingSlide 33
Standard Grade ComputingSlide 34