20
DATABASES – LESSON 2 Key Stage 3 ICT

D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

Embed Size (px)

Citation preview

Page 1: D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

DATABASES – LESSON 2Key Stage 3 ICT

Page 2: D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

RECAP OF KEYWORDS – TASK 2AIN YOUR WORKBOOKS FROM LAST LESSON

What is a database?

A DATABASE is a collection of information which is stored in a logical and structured way

What is a field?

Each piece of information is a FIELD

What is a record?

All information relating to one thing in a database is called a RECORD

What is a table?

A TABLE stores all the same records.

Page 3: D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

OBJECTIVES Understand that databases are designed to be

multiuser

Have used queries to search for data

Have created your own query

OUTCOMES All: will be able to add data into a multi-user database Most: will have modified an existing query Some: will have written their own query from scratch.

Page 4: D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

NOTES

BEFORE the next task

copy the file ‘Y7 DB TEMPLATE’ and rename it to your initials (ie. as SM)Into common K -> Temp Storage

Page 5: D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

TRUE MULTI-USER. More than one person can use a database at any one

time.

Let’s try it out

Open the database from the shared area. Enter in your information.Common K Temp Storage DATABASES SM.mdb

I will display the table on the board, which will show the information being displayed.

Page 6: D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

TRUE MULTI-USER – TASK 2B In your booklets

Can you do this with Excel?

Why might this be useful?

Page 7: D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

QUERIES

Like when we used Insight, we searched a database, we can also do it to the database we have just created.

This is called QUERYING the data.

Let’s look at some queries in the database we have just used.

Page 8: D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

BOOKLETS PAGE 4 – TASK 2C

Class demonstration of how to run a query in access

It’s time you did some searches, like you did using an internet database.

Use the queries in your database to complete the worksheet:

Page 9: D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

HOW IS THE QUERY WORKING

Notice the Field & Table names

Notice the Criteria line

Page 10: D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

HOW IS THE QUERY WORKING - CRITERIA

This is the part that tells query which records to select.

It will use the data in the “Favourite Colour” field

It will only select records that have the favourite colour as RED.

If needed, use the class as database with hair colour as an example.

Page 11: D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

HOW IS THE QUERY WORKING - CRITERIA

This is the part that tells query which records to select.

It will use the data in the “Favourite Colour” field

It will only select records that have the favourite colour as RED.

If needed, use the class as database with hair colour as an example.

Page 12: D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

OR QUERY CRITERIA

It will only select records that have the favourite colour as RED OR BLUE.

If needed, use the class as database with hair colour as an example.

Page 13: D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

AND QUERY CRITERIA

It will select records that: have the favourite colour as Red

ANDrecords that have the first name of John

If needed, use the class as database with hair colour as an example.

Page 14: D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

CREATE A QUERY 1

2

3

4Double click the fields you want in your query

5Click the cross to save your query – don’t forget to name it.

Page 15: D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

EDITING A QUERY

Right click on the query and select Design View”

Page 16: D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

YOUR TURN – WRITE QUERIES

1. Write your own query, you could write a query to select all the people with the same favourite colour as you

2. Now write a query to find out if anyone has the same favourite colour and lesson as you

3. Lastly create a query that has both OR and AND criteria

Print screen your solutions in your booklet – Task 2D

Are you up for the Query Super Challenge – it is in your booklets.

Page 17: D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

PARAMETER QUERIES.

The example searches for records where the favourite colour is red.

Do we need to write a separate query for each colour. Hands up for yes.

No – we can use a PARAMETER query to ask the user which colour to search for

Page 18: D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

PARAMETER QUERY

Remember this when you run some of the queries earlier.

Lets see how to ask your own questions?

Page 19: D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

PARAMETER QUERY

To ask the user a question and use their reply as the search criteria.

Put the question inside square brackets [ ]

Page 20: D ATABASES – L ESSON 2 Key Stage 3 ICT. R ECAP OF KEYWORDS – T ASK 2A I N YOUR WORKBOOKS FROM LAST LESSON What is a database? A DATABASE is a collection

PLENARY

Test your knowledge:

www.teach-ict.com/xml/finished/2242/spot.htm