TFREC Intranet
Navigation bar
 

 

Database query examples

Simple count
In this example, we generate a count on the use of pheromone traps:

  1. Select the table "General survey responses." Click "Next"
  2. Select "Pheromone traps"
  3. Select "N (Count)" from the "Observations" pull-down box.
  4. Select "Display results" at "Do what with query results?" Click "Query"

Generate percents
In this example, we generate the percentage breakdown on the use of pheromone traps. This will illustrate the use of a temporary table and percentages:

  1. Select the table "General survey responses." Click "Next"
  2. Select "N (Count)" from the "Observations" pull-down box. Click "."
  3. Select "Use results in further query" Click "Query"
  4. This creates a table consisting of a single row with a count of the number of surveys. Click on "Continue"
  5. Select the table "General survey responses." Click "Next"
  6. Select "Pheromone traps"
  7. Select "N (Count)" from the "Observations" pull-down box.
  8. Select "Use results in further query" Click "Query"
  9. This creates a table consisting of a row for each possible value with its count. Click on "Continue"
  10. Select the table "Temporary Table B"
  11. Select the table "Temporary Table A" from the " Merge with information from table" pull-down menu. Click "Next"
  12. Select "phertrap"
  13. Select "as % of" from the "COUNT" pull-down box.
  14. Select "A: COUNT" from the pull-down box following the "/".
  15. Select "Display results" at "Do what with query results?" Click "Query"

Use a subset of the data
Here we will generate the average number of sprays containing insecticides per grower for each region:

  1. Select the table "Chemicals applied." Click "Next"
  2. Select "Use Catgeory"
  3. Select "Use results to choose a subset from a single table." Click "Query"
  4. Select "INS-ACR," the code for insecticides-acricides. Click "Select"
  5. This creates a table consisting of the chemical data with just the insecticides included. Click on "Continue"
  6. Select the table "Temporary Table A." Click "Next"
  7. Select "who" and "appl"
  8. Select "Distinct observations only"
  9. Select "Use results in further query;" Click "Query"
  10. This creates a table consisting of one row per application per survey for the sprays that included insecticides. Click on "Continue"
  11. Select the table "Temporary Table B." Click "Next"
  12. Select "who"
  13. Select "N (Count)" from the "Observations" pull-down box.
  14. Select "Use results in further query;" Click "Query"
  15. This creates a table consisting of one row per survey with a count of the sprays that included insecticides. Click on "Continue"
  16. Select the table "Temporary Table C."
  17. Select the table "Region" from the " Merge with information from table" pull-down menu. Click "Next"
  18. Select "N (Count)" from the "Observations" pull-down box.
  19. Select "Mean" from the "COUNT" pull-down box.
  20. Select "Region"
  21. Select "Display results" at "Do what with query results?" Click "Query"

Created Tuesday, September 17, 2002

 

 

Contact us: tangren@wsu.edu (Webservant) 509-663-8181| Accessibility | Copyright | Policies
Tree Fruit Research & Extension Center, Washington State University,1100 N Western Ave., Wenatchee, WA, 98801 USA

Introduction Apple 1989 Pear 1990 Apple 2000 Pear 2000 Cherry 2000 Survey report TFREC home