Access ch3
Access ch3
Access ch3
3
Introduction to Queries
Queries allow you to ask questions of your database. You can combine data
from different tables, permanently find or sort data, do calculations or produce
interactive dialogue boxes to allow a user to enter search data.
There are many different types of Queries, in this chapter you will be introduced to
the most common type, SELECT QUERIES.
A sample database has been prepared for you. It records employee information
in two tables. One table records the employee’s personal details, the second table
records the employee’s pay details. The following diagram summarises the structure
of the two tables.
Notice that the field EMPLOYEE ID is present in both tables. This field is called the
PRIMARY KEY and it enables two tables to be linked so that data can be used from
both of them in the Query.
4 Click on the OFFICE BUTTON, highlight SAVE AS and select ACCESS 2007
DATABASE.
5 Access your STORAGE folder and save the database as: CHAPTER 3 WAGES 1.
6 Turn off the SECURITY ALERT bar if you wish
Creating a Query
6 Close the SHOW TABLE dialogue box by clicking in its close box.
NOTE If the LINK or (RELATIONSHIP) line is not present in your tables, click
on the EMPLOYEE ID field in the PERSONAL DETAILS table and drag
the field over the EMPLOYEE ID field in the PAY DETAILS table.
3 Return to DESIGN VIEW by clicking the arrow at the base of the VIEW icon in the
RIBBON and selecting DESIGN VIEW.
2 We could type the formula directly into the cell, however, the formula will not fit
and it becomes difficult to see. To overcome this problem we can zoom in on the
cell. Hold down the SHIFT key and press the F2 key to zoom the cell.