Operation Manual

Step 9: Run the query and make some modification
After we run the query to make sure it works correctly, we will hide all of the fields that we do not
need.
Figure 257: Result of running the fuel economy query
1) Click the Run Query icon in the Design Query toolbar (Figure 248). The results are in
Figure 257.
Two of the column headers are identical. By giving these two headers different aliases, we
can distinguish them.
2) Add Aliases:
Type the aliases as they are listed in Figure 258.
Figure 258: Query table with aliases added
3) Run the query again. The results are in Figure 259.
Figure 259: Query run with aliases
Step 10: Close, save, and name the query
My suggestion for a name is Fuel Economy.
1) Click the Save icon.
2) Name the query.
3) Close the query.
4) Save the database file.
There are obviously other calculations that can be made in this query such as cost per distance
traveled and how much of the cost belongs to each of the payment types.
Note
To fully use queries requires a knowledge of set operations (unions, intersections, and,
or, complements, or any combinations of these). Having a copy of the HSQLDB User
Guide, available from http://hsqldb.org/doc/guide/, is also extremely useful.
Chapter 8 Getting Started with Base | 261