Case II Complex Query
The first query which was completed was a simple query. In this second case a more complex query of the same data set will be shown.
Double click the layer to open the layer properties window as in the first Case.
1. Click on the Definition Query tab.
2. Delete the previous query by highlighting and pressing the delete key.
3. Click on the Query Builder button.
Double click the layer to open the layer properties window as in the first Case.
1. Click on the Definition Query tab.
2. Delete the previous query by highlighting and pressing the delete key.
3. Click on the Query Builder button.
In the Query Builder window a more complex query will be created for this data set.
The query will display census tracts which have more than 2000 people living in them HC01_EST_VC01 AND the median income HC02_EST_VC13 is equal to or greater than $30,000. The logical AND expression means that both parameters need to be true to display the information. It is critical that the query can be written in plain language so that it can be fully explained in the creation of reports. Bad data always makes for bad results.
The expression that will be created using the button and the number keys should have the appearance like the one displayed in figure 7. Select the attributes by double clicking on them use the buttons for logic functions and manually type the numeric expressions.
Once the expression has been completed click OK to exit the query builder window.
The query will display census tracts which have more than 2000 people living in them HC01_EST_VC01 AND the median income HC02_EST_VC13 is equal to or greater than $30,000. The logical AND expression means that both parameters need to be true to display the information. It is critical that the query can be written in plain language so that it can be fully explained in the creation of reports. Bad data always makes for bad results.
The expression that will be created using the button and the number keys should have the appearance like the one displayed in figure 7. Select the attributes by double clicking on them use the buttons for logic functions and manually type the numeric expressions.
Once the expression has been completed click OK to exit the query builder window.
Remember exiting the query builder does not run the query. The query will be displayed for review before it is executed. To run the query, click OK.
Figure 8: Query Results for Case II shows the results of the query. The Census tracts that appear are those that have more than 2000 people and have a median income of $30,000 or more. Both criteria must be true for the tract to be displayed. The field being displayed and the meaning of the colors are not displayed on this map since no legend has been added. Note: a second census tract county map has been displayed with a hollow fill to see those tracts that did not meet the criteria.
Figure 8: Query Results for Case II shows the results of the query. The Census tracts that appear are those that have more than 2000 people and have a median income of $30,000 or more. Both criteria must be true for the tract to be displayed. The field being displayed and the meaning of the colors are not displayed on this map since no legend has been added. Note: a second census tract county map has been displayed with a hollow fill to see those tracts that did not meet the criteria.