Using Multiple Relationships

Just as two entities in real life can be connected in multiple ways, so can two entities in a database. For example, two people can be on a checking account together and on a mortgage together. Likewise, there are situations in real life where a relationship of one kind precludes a relationship of different kind. An example of this might be if someone has a relationship of "sibling" to one person, he or she can't also have a relationship of "married" to that same person.

Visual Query Builder has specific ways of selecting and displaying "and" and "or" relationships. When you use the Assistant to select relationships, if you select more than one relationship at the same time, Visual Query Builder interprets this as an "or" relationship. That means it will look for entities that have one relationship or the other.

This is an example of an "or" relationship in the Assistant and on the workspace. It would return entities who make deposits to or withdrawals from their account.

Alternatively, if you select more than one relationship at different times, in separate steps, Visual Query Builder interprets this as an "and" relationship. This is an example of an "and" relationship in the Assistant and on the workspace.

That means it will look for entities that have both relationships, not just one or the other. It would return entities who have credit card accounts and made payments on those accounts.