4. Identify relations between the tables in the query.

When you have chosen two or more database tables in a query, you need to define relations between then. If you don't do this, you can create a cartesian producto and create a query that brings more records than desire. For example, a cartesian product between a customer and an orders table will relate all our invoices to each customer, without reagard to the invoice's customer. Usually, always exists key fields that relate the records of one table with the other.

This screen is divided in five sections. In the first two, the tables used in the query are shown. When you clic in a table in either one of these sections, their fields are shown in the next two sections. Here you have to choose a field from each list and press the Add button to create the relation. Press the Remove button to remove the relation from the list.

You must be careful to choose all the relations between al the table. If this isn't the case you can create a cartesian producto. This doesn't want to say that all tables have relation with all tables in the query, but that there must be a way to relate any table on the table with the rest of them. For example:

Customer -> Orders -> Order Detail -> Inventory -> Supplier

With these relations you can see wich products a client bought from which suppliers.

You can press the Next button to proceed to section 5. User's prompt creation.

The Back button will take you to section 3. Select fields from database.