Revision booklet 6957 2016
Transcript of Revision booklet 6957 2016
1
Exam Revision Booklet
Unit 7 (6957)
May 2016
Name: ___________________________
2
Contents
Database basics .................................................................................................................................................. 3
Normalisation ..................................................................................................................................................... 5
Data Validation ................................................................................................................................................... 8
Using Naming Conventions ........................................................................................................................... 10
Some questions ................................................................................................................................................ 13
Exam crib sheets .............................................................................................................................................. 14
Making ‘Append’ Queries .......................................................................................................................... 15
Making Macros.............................................................................................................................................. 16
Creating a Query for a report… ................................................................................................................ 17
Other useful things from past papers: ................................................................................................... 18
10 Steps to the stars – PiXl Therapy ............................................................................................................ 19
Exam Technique ............................................................................................................................................... 24
3
Database basics
Data is stored in a database so that it can be sorted and searched to provide meaningful
information
What are the advantages of RDBMS over flat file systems?
Recall the main problems of flat file databases
Redundancy
Inconsistency
Difficult to update
Program/data dependence
The aim of using a RDBMS is to eliminate (as far as possible) these problems
Entities:
A relational database consists of multiple
tables joined (linked) together by
relationships
Each table should contain data about a
single entity
Person – Employee
Object - Book
Event - Project
Relationships
Usually joined on primary/foreign key
Relationship have a degree (i.e. there are different types):
4
5
Normalisation
Normalisation made simple (hopefully)
a) 1NF - is to remove repeating groups of data. b) 2NF – is to remove part key dependents, the data that is partly dependent on a key. c) 3NF – is to remove non key dependences, data that is not dependent on other keys
The example below shows a customer order form and how to normalise the data that is on the
form.
Customer No
Customer Name
Customer Address
Order No
Order date
Product No Product
Description
Quantity Price Value
Total
Here is the data structure from the order form in its unnormalised form
Order No
Customer No
Customer Name
Customer Address
Order date
Product No
Product description
Quantity
Price
Value
Total
6
Step 1. Remove repeating groups to achieve 1NF.
Note. A repeating group data structure always has a compound key.
1NF. Remove repeating groups.
(1st box) (2nd box)
Order No
Customer No
Customer Name
Customer Address
Order Date
Order No
Product No
Product
Description
Quantity
Price
Value
Step 2. Examine the repeating group data structure and check whether any data item in its
primarily dependent on (solely) the second fields of the compound key. (i.e. any partial key
dependencies?). if such dependences exist, extract these data items to a separate data
structure with their appropriate key field.
The data will now be in 2NF
2NF. Check whether any data item is primarily dependent on (solely) the second fields of the
compound key. (Any part key dependencies)
(2nd box)
Order No
Product No
Product Description
Quantity
Price
Value
Now becomes>>> Order No
Product No
Quantity
Value
Product No
Product Description
Price
7
Step 3. Are any of the attributes primarily dependent on one of the other non-key attributes
rather than the design key?
These data structures should now be in 3NF
This stage will involve a foreign key in one of the entities
3NF. Are any of the attributes primarily dependent on one of the other non-key attributes
rather than the design key?
(1st box)
Order No
Customer No
Customer Name
Customer Address
Order Date
Now becomes>>> Order No
Customer No*
Order Date
Customer No
Customer Name
Customer Address
*Foreign key
We can now see that CustomerName and CustmerAddress is primarily dependent on
CustomerNo rather than OrderNo. In this case ant such data items are extracted to a separate
data structure with the appropriate key field.
In order to relate the second structure to the first, the key of the second structure
(CustomerNo) is also left as part of the original structure 9referred to as a ‘foreign key’).
Also at this step, any redundant data is removed e.g. fields which can be calculated. (Value and
Total in this example).
The data is now in 3NF
Customer No
Customer Name
Customer Address
Order No
Customer No*
Order Date
Order No
Product No
Product No
Product Description
8
Data Validation Type Description Use
Text Use for text or combinations of text and numbers, such as addresses, or for numbers that do not require calculations, such as phone numbers, part numbers, or postal codes.
Stores up to 255 characters. The FieldSize property controls the maximum number of characters that can be entered.
Memo
Use for lengthy text and numbers, such as notes or descriptions.
Stores up to 65,536 character
Number
Use for data to be included in mathematical calculations, except calculations involving money (use Currency type).
Stores 1, 2, 4, or 8 bytes; stores 16 bytes for Replication ID (GUID). The FieldSize property defines the specific Number type.
Date/Time Use for dates and times.
Stores 8 bytes
Currency Use for currency values and to prevent rounding off during calculations.
Stores 8 bytes.
AutoNumber
Use for unique sequential (incrementing by 1) or random numbers that are automatically inserted when a record is added.
Stores 4 bytes; stores 16 bytes for Replication ID (GUID).
Yes/No
Use for data that can be only one of two possible values, such as Yes/No, True/False, On/Off. Null values are not allowed.
Stores 1 bit
OLE Object
Use for OLE objects (such as Microsoft Word documents, Microsoft Excel spreadsheets, pictures, sounds, or other binary data) that were created in other programs using the OLE protocol.
Stores up to 1 gigabyte (limited by disk space).
Hyperlink Use for hyperlinks. A hyperlink can be a UNC path or a URL.
Stores up to 64,000 characters
9
Key Word(s) Answer
Database
Import
Form
Record
Field
Relational database
Flat file database
Data entry and Data entry form
Query
Report
Entities
Attributes
Relationships
Validisation
Presence check
Range check
File lookup check
List check
Format check
Data lengthy check
Input masks
Option buttons
Command buttons
Macros
Normalisation
First Normal form
Second Normal Form
Third Normal Form
What are the main field types?
10
Using Naming Conventions
Using naming conventions will make your database easier to create and maintain and could earn you extra marks in your project. Below shows a list of Leszynskil/Reddick naming conventions: Object Naming Convention
Table tbl
Query qry
Form frm
Report Rpt
Macro mcr
Table (lookup) tlkp
Query (select) qry
Query (append) qapp
Query (crosstab) qxtb
Query (delete) qdel
Query (update) qupd
Form (menu) fmnu
Form (message) fmsg
Form (subform) fsub
Macro (menu) mmnu
Input Masks
0: indicates numeric data, entry required
9: indicates numeric data, entry optional
L: indicates alphabetic data, entry required
?: indicates alphabetic data, entry optional
>: forces uppercase
<: forces lowercase
Example: tblClient
11
Database Naming Conventions
We need to make sure we use ‘Standard Ways of Working’. In access you have to save each
section of your work.
Add in the correct tag in the table below
Object Tag Example
Table _ _ _ Customer
Query _ _ _ ClientName
Form _ _ _ Customer
Report _ _ _ Sales
Macro _ _ _ UpdateList
Module _ _ _ IsNotLoaded
We also need to make sure we use the correct data types.
Data Type Usage Comments
Text A field can have up to 255 characters
Number Can choose a whole number or a number with a decimal point
Date/Time Access can calculate with dates so never use text to enter dates.
Currency
Yes/No Useful when there are only two possible answers
Auto Number
This is a unique number
Memo Can hold up to 64, 000 characters.
12
13
Some questions
1. In terms of database design, what is a ‘Functional Specification’? [2]
2. List two advantages of the ‘functional specification’ document. [4]
3. With regards to databases, list three examples of ‘Input’. (use any database scenario to describe your answer). [3]
4. With regards to databases, list three examples of ‘Output’. (use any database scenario to describe your answer). [3]
5. With regards to databases, list three examples of a ‘Process’ (use any database scenario to describe your answer). [3]
6. Thinking about a secondary school database system, what could be an example of a ‘generated’ piece of data? Be as descriptive as possible in your answer. [2]
7. What does HCI stand for? [1]
8. With regards to databases, what three factors would you consider to be important when designing a good front-end interface? [6]
9. Describe what a prototype is, in terms of database technology. [2]
10. What are the main advantages of creating a prototype? [3]
11. Why is it important to include a ‘testing’ phase in any large scale database implementation programme? [2]
12. Explain why an ERD may help in the database ‘design’ stage. [2]
13. What does ERD stand for? [1]
14. Explain the downfalls of a ‘many-to-many’ relationship within database systems.
[3]
15. How could a database administrator rectify a ‘many-to-many’ relationship, in order to minimise data replication and potential data loss? [3]
14
Exam crib sheets
Creating ‘New Student Form’ and generating StudentID.
To do the above, use the Expression builder, by click on the icon in the
properties / Events pane, of any object.
Remember to ‘unbound’
text boxes.
Set enabled to ‘NO’ on
this box.
Take the 1st character of
the Surname field. (taken
from the Left of the work)
Take the 1st character of
the Forename field.
(taken from the Left of
the work)
Take largest (Max)
number from the right
hand characters of
StudentID (4 from the
right), and then ADD 1.
15
Making ‘Append’ Queries
Remember to click the Append Button and select the table you want the information on the
Form you created, to ‘append’ to. (I.e. when you type information on the form, where do you
want it to go in the table?)
Click the Append Button
Right-click ‘Build’
to choose your
Form fields.
Choose the field in
the table you want
to append to.
16
Making Macros
To make your form work, you will need to assign your Macro (saved) to a Button you have
drawn on your form. (Design View)
Use the expression builder
to select Form fields and
add Is Null
Use ‘MessageBox’ to
display a message IF the
above statement is true.
If it is NOT true (i.e. the
fields are filled in), do
everything in the ELSE
section.
Draw button
Select button
On Click – set
to your
Macro
17
Creating a Query for a report…
With OR, Pseudo column names and Max / Min functions.
Click Totals in order to
to be able to do SUM,
MIN, MAX, and other
functions.
Use AND, OR etc. in this
row, to find specific
criteria.
Use TOTAL row to
include Min / Max /
Sum of columns.
Put a colon : after a
word, to make this the
field title.
18
Other useful things from past papers:
Making reports
Force new page, if you
need to print each
record on a new page. Remember to create
sections when you do
reports.
19
10 Steps to the stars – PiXl Therapy
I can explain the importance of consistency of data in a database and ways to ensure this. In order to achieve an A*, you have to be able to not only create complex relational databases for your controlled assessment but also be able to explain their uses in the exam. You must also be confident in the different uses of validation, verification and interrogating databases to extract the necessary information. Here are some generic questions that you should be asking as you read a text:
What is a flat file database? What is a relational database? Why do we use relational databases over flat file databases? How can we ensure that the data entered into our database is the correct type
and accurate? How can we interrogate (search) databases to get the information we want?
Relational Databases TASK 1: Ask pupils to define a flat file database and a relational database in no more than 30 words. Share the definitions amongst the group. Can pupils come up with any
possible advantages and disadvantages of using each type of database? TASK 2: Consider the image of the following flat file database. Label the following and explain what data types you would use for each field. Keywords: Table, record, field.
Data types: Text, Numbers, Date/Time, Currency, Autonumber, Yes/No Work with a partner to identify what the other data types could be used for?
20
TASK 3: A relational database stores data in tables that are linked together using common fields. Consider the following relational database. As a group, explain how it would provide the following advantages.
Reduces the duplication of data
Ensures that data is up to date
Reduces file sizes.
Ensure that data is consistent
Validation and Verification TASK 4: What is valid data? Why is it so important for a database to have valid data? To ensure that we get valid data, we use validation rules in our database. These make sure that data entered is correct and fit for purpose.
21
Match up the following validation rules to their definitions and images.
Validation Rule Definition Example
Length Checks Checks to see if data entered fits within a certain range e.g. between two numbers.
<= 10
Format Checks Checks that data has been entered and not left blank. Often shown by a *.
Field Size: 14
Range Checks Set the field size to only accept the necessary number of characters.
Required: No
Presence Checks Only allows certain types of data to be entered.
Format: Currency
You must learn these examples and definitions. TASK 5: You are creating a database about people at an 18 certificate film.
• What validation rule could you apply to the date of birth field to ensure that you get the correct information?
• What other data validation rules might you include in your database? Why? TASK 6: Data verification is the process of checking that data matches what it was originally. Write your own definitions of the following data verification methods.
Double Entry
Proof reading
*This is something you must do in your exam!
TASK 7: Explain the difference, using examples, between data validation and data verification.
Queries TASK 8: Queries are an extremely powerful tool for searching and sorting information in related databases. They allow the user to search through (sometimes millions) of records instantaneously and get the required information. It is likely that you will have created queries in your controlled assessments.
22
Basic Queries usually involved searching one field for specific information. Imagine I have a database of your ICT class.
I want to see how well girls do in the subject. What criteria would I have to include in the gender field of my query?
TASK 9: Complex queries are very powerful tools to search for more than one criterion. For example, if I wanted to find all the girls who scored a grade C or B in their assessment, I would use more than one criterion. Match the following logical operators to their function. Then write an example for the database above.
Logical Operator
Definition Example
AND Searches for one thing OR another.
OR Searches for one thing AND another thing.
NOT Searches for anything that is NOT a specified criterion.
See more query codes here http://tinyurl.com/d97rvyu Imagine I added a column for the age of your classmates.
Ascending is……
Descending is…..
23
Relational operators are similar to the signs you will have seen in maths.
= < > <= >=
Which operator would you use if you wanted to:
Find all the students whose age was 14?
Who were older than 14?
Who were younger than 15?
Who were older than or equal to 14?
What do the examiners say about this topic?
Students struggle to identify the difference between records and fields.
Students struggle to identify the primary key and state its function.
Students struggle to identify the advantages of using relational databases over flat file databases.
Many students do not understanding data validation or data verification (name 2 or more techniques) and cannot give examples of each or where they are best applied. Students could not clearly identify the advantages of the different techniques for data validation and verification.
What keywords do you need to know? Before students complete this table, play a game of backs to the board. A student sits in a hot seat and a word is put on the board behind them. Other students have to describe the word without using any of the words that are included in the phrase.
Primary Key
Field
Record
Data Redundancy
Data Duplication
Data Validation
Data Verification
Length Check
Range Check
Format Check
Presence Check
Ascending
Descending
24
Exam Technique
25
26