To create a relationship between attributes in a diagram:

  1. Click on the attribute in the diagram, hold the mouse down and drag it to another attribute. This creates a relationship between the two attributes.
  2. Click OK on the confirmation dialog.

    Note

    To create composite foreign keys, create two or more relationships between the same tables and give them all the same non-empty constraint name.

  3. The relationship is created.
  4. It is possible to create more than one relationship between two entities by linking two or more attributes. In the example below, we have created links between the following attributes:
    • product_code
    • prod_line_code
    • prod_group_code
  5. To have these relationships displayed in the diagram as separate links (as below), go to Tools > Settings>Repository>Category>Diagram>General and set the Link connection to Attributes.
  6. To have these multiple relationships displayed in the diagram as a single link (as below), right click on the category in the tree and select Settings > Diagram > Show relations between entities.

    Notice that the link line is thicker and darker to show that this single line represents multiple relationships.
  7. If the attribute you want to create a relationship to does not already exist in the table, 3D can add it automatically when creating the relationship. To do this, click on the header of the entity in the diagram and drag it to an attribute in the diagram.
  8. The confirmation dialog gives you the option to enter the name of the attribute that will be created. By default it is that same as the name of the attribute you dragged it to. Click OK.
     
  9. The attribute and relationship are created.

Note

When creating a relationship in a logical model, some additional options are available on the Create relationship dialog box.

To start with a Relationship type option is added, giving the option to create a Subtype/Supertype relationship instead.

When Subtype/Supertype is selected some more options related to subtype relationships are available.

  • Constraints - If the relationship type is Subtype / Supertype, this field is enabled. The options are Inclusive or Exclusive. Visually these are displayed as black or white arrows respectively.
  • Layout subtypes - ticking this checkbox enables the diagram to be refreshed immediately, displaying the new subtype / supertype relationship.

To create relations between attributes for multiple entities, refer Derive Foreign Key Joins Wizard for details.

  • No labels