Join Types
QBF allows two types of joins:
• Master/Master (one-to-one)—These JoinDefs correspond to an ordinary relational equi‑join.
• Master/Detail (one-to-many)—This type of JoinDef corresponds to a relational outer join.
The terms master and detail are meaningful only as they relate to each other. The determining factor in whether a join is one-to-one or one-to-many is the nature of the data in the tables you are joining.
Each column of each table in a Master/Master join contains singular or exclusive properties. For example, the Staff table lists each employee only once and the Managers table lists each manager only once. If you join the Name column in the Staff table to the Manager column in the Manager table, QBF returns one row of data for every employee who is also a manager.
In a Master/Detail join, each detail table contains at least one column that is not restricted to one item. That is, the column contains non-singular or non-exclusive information. The join column—the common element—is the bridge between each column in the master table and the column(s) in the following detail table:
For example, in the Tasks table both the Project and Task columns contain non‑singular information. Wallace Fielding, for instance, might have three rows showing that he works on the Portfolio project (Project column). Within the Portfolio project, he works on three different tasks: Design, Manage, Test (Task column). Each Portfolio task is on a separate row in the table.
If the EMP table (master) were joined to the Tasks table (detail) through the Name column in each, you could access information such as the tasks, projects, and hours (from the Tasks table) of employees who work for a certain manager (from the Staff table).
Thus, the many entries in the Task column of the Tasks table are accessible through the one entry in the Manager column of the Staff table. The following figure shows Jones, Betty, in the Manager field of a form for the EMP table.
The following figure displays a record retrieved for one of the employees she manages.