2 Recap of keywords – Task 2A In your workbooks from last lesson What is a database?A DATABASE is a collection of information which is stored in a logical and structured wayWhat is a field?Each piece of information is a FIELDWhat is a record?All information relating to one thing in a database is called a RECORDWhat is a table?A TABLE stores all the same records.
3 ObjectivesUnderstand that databases are designed to be multiuserHave used queries to search for dataHave created your own queryOutcomesAll: will be able to add data into a multi-user databaseMost: will have modified an existing querySome: will have written their own query from scratch.
4 Into common K -> Temp Storage NOTESBEFORE the next taskcopy the file ‘Y7 DB TEMPLATE’ and rename it to your initials (ie. as SM)Into common K -> Temp Storage
5 True Multi-user.More than one person can use a database at any one time.Let’s try it outOpen the database from the shared area. Enter in your information.Common K Temp Storage DATABASES SM.mdbI will display the table on the board, which will show the information being displayed.
6 True Multi-user – Task 2B In your bookletsCan you do this with Excel?Why might this be useful?
7 QueriesLike 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.
8 Booklets Page 4 – TASK 2CClass demonstration of how to run a query in accessIt’s time you did some searches, like you did using an internet database.Use the queries in your database to complete the worksheet:
9 How is the query working Notice the Field & Table namesNotice the Criteria line
10 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” fieldIt will only select records that have the favourite colour as RED.If needed, use the class as database with hair colour as an example.
11 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” fieldIt will only select records that have the favourite colour as RED.If needed, use the class as database with hair colour as an example.
12 OR query CriteriaIt 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.
13 AND query Criteria It will select records that: have the favourite colour as RedANDrecords that have the first name of JohnIf needed, use the class as database with hair colour as an example.
14 Create a Query 1 2 3 4 Double click the fields you want in your query 5Click the cross to save your query – don’t forget to name it.
15 Editing a QueryRight click on the query and select Design View”
16 Your Turn – Write Queries Write your own query, you could write a query to select all the people with the same favourite colour as youNow write a query to find out if anyone has the same favourite colour and lesson as youLastly create a query that has both OR and AND criteriaPrint screen your solutions in your booklet – Task 2DAre you up for the Query Super Challenge – it is in your booklets.
17 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
18 Parameter QueryRemember this when you run some of the queries earlier.Lets see how to ask your own questions?
19 Parameter QueryTo ask the user a question and use their reply as the search criteria.Put the question inside square brackets [ ]