Online Documentation for SQL Manager for DB2

Creating relations


Creating material relations

 

To establish a new material relation (which is the foreign key in terms of database management):

  • click the Create Relation button on the New object toolbar;
  • click the entity where the referential constraint should be created;
  • click the referred entity;
  • specify the new foreign key properties using Foreign key Editor.

 

VDBD - Creating relations

 

 

Creating virtual relations

 

SQL Manager for DB2 provides an ability to build virtual relations between any tables.

Virtual relations do not exist physically, they are only stored in the diagram. They are designed for building database structure visually. A virtual relation can be materialized further into a Foreign Key.

 

To establish a new virtual relation (which is implemented as a virtual foreign key):

  • click the Create Virtual Relation button on the New object toolbar;
  • click the entity where the virtual referential constraint should be created;
  • click the referred entity;
  • specify the new virtual foreign key properties using Foreign key Editor.

 

Hint: To create a relation, you can also use the corresponding item of the context menu.

 

 

Once the relation is created, it is displayed as a line between two entities in the diagram area. The style the line is drawn is determined by the diagram notation.

The context menu of this line allows you to view the foreign key using Foreign key Editor, or drop the foreign key (or virtual relation) from the database.

 

VDBD - Creating relations - Context menu