8.6 Finding data
Databases allow you to display just part of the data. For example, a school may wish to just display details for the girls, or all the students who travel to school by bus, or those students who speak a language other than English.
You can search on just one request or entry, which is called a single selection search, or you can search on multiple requests or entries, which is called a multiple selection search.
Databases exercise 4
Single selection searches
Skills practised
- Single data searches
- Multiple data searches
Let’s display just the Richmond employees.
- In Microsoft Access:
- Open the
EMPLOYEE PAY QUERY
, click in one of theRICHMOND
values then click on theSELECTION
icon in the ribbon and selectEQUALS
“RICHMOND
”. - Just the Richmond employees are found and the number found is displayed in the Status Bar at the base of the screen.
- Click on the
TOGGLE FILTER
icon in the ribbon to return all the records to the list.
- Open the
- In FileMaker Pro:
- Click on the
FIND
button in the Toolbar (or press<Ctrl+F>
or<Command+F>
). - Enter
Richmond
in the box underLOCATION
and click on thePERFORM FIND
in the Toolbar (or press<Return>
or<Enter>
). - Just the Richmond employees are found and the number found is displayed in the Toolbar.
- Click on the
SHOW ALL
button in the Toolbar to return all the records to the list.
Note: It is always a good practice to return all the records to the list before you carry out new searches.
- Click on the
Multiple selection searches
Searches can be made on more than one piece of data. For example, in the Pizza Palace database, Joe might want to know how many Delivery staff work at the Keilor shop or how many Cooks work over 35 hours a week.
- In Microsoft Access:
- Open the
EMPLOYEE PAY QUERY
then click on theADVANCED
icon in the ribbon and selectFILTER BY FORM
. - Enter
Keilor
underLOCATION
Delivery
underPOSITION
. - Click on the
TOGGLE FILTER
icon in the ribbon to show the employees. Two should be found. - Click on the
ADVANCED
icon again and selectCLEAR FILTER
to return all the records to the list. - You can also do a search in the Query Design when you want to keep the search. You can duplicate the current query or create a new one. By doing this you could have a query for the Richmond employees, another for the Keilor employees, etc. In this case we will use the current query.
- Click on the
VIEW
icon in the ribbon to open theQUERY DESIGN
. - In the
CRITERIA
row enterCook
in thePOSITION
cell and>35
in theHOURS
cell. - Run the query and four cooks should be found.
- Return to the
QUERY DESIGN
, remove the entries in theCRITERIA
row and run the query to return all the records to the list.
- Open the
- In FileMaker Pro:
- Click on the
FIND
button in the Toolbar (or press<Ctrl+F>
or<Command+F>
). - Enter
Delivery
underPOSITION
andKeilor
underLOCATION
. - Click on the
PERFORM FIND
button in the Toolbar (or press<Return>
or<Enter>
) and two employees should be found. - Press
<Ctrl+F>
or<Command+F>
to perform another search. EnterCook
in thePOSITION
box and>35
in theHOURS
box. - Press
<Return>
or<Enter>
and four employees should be found. - Click on the
SHOW ALL
button in the Toolbar to return all the records to the list.
- Click on the