Creating a Query

In this topic, you will learn to write a simple prompted query that retrieves everything in a table - all of the columns and rows. For this example, the Query Design window that produces a prompted query is used.

To create a new query:

  1. Open a new Query Design window.

    SQLWizard displays the Add Table dialog box.

  2. Click one of the tables from the Table Name list box. If you do not see the table you want to use, you may have to change the Location or AuthID.
  3. Once you have highlighted a table, click the Add button to copy the table to the Query Design window. Notice that the columns in the selected table are shown in a Column Selection List.
    Note: When adding tables to a Query Design window, you can pick more than one table. A query that gets data from more than one table is called a join. For now, just select a single table.
  4. Click the Done button to close the Add Table dialog box. If you click the Done button before you add a table to the query, you will need to use the Add Table command from the Query menu.
    Note:


    Catalog Browser button

    Add button
    Click the Add button on the toolbar or, from the Catalog Browser dialog box, drag a table to the Table Display Area.

  5. Examine the Column Selection List in the Table Display Area of the Query Design window. The table name is shown in the title bar. Beneath the title bar is a list box containing all column names in the selected table. You can select one column to be added in your query or you can use the asterisk (*) to select all columns in the table.
  6. Click the asterisk in the Column Selection List to add all of the columns in the table to the query.

    Notice that the columns are added to the Query Conditions Grid in the order they appear in the Column Selection List.