Define categories in a Database Model diagram

Categories are tables that are subtypes of a parent table. For example, an employee record (the parent) might contain a job-type column; category tables for that column might include engineer, technician, and administrator.

What do you want to do?


Define a category in a database model diagram

  1. Open the database model diagram.
  2. From the Entity Relationship or Object Relational stencil, drag a Category shape into the diagram.
  3. Drag a Parent To Category shape onto the drawing page. Drag one end of the Parent To Category shape to the center of the parent table so that the table is outlined, and then release the mouse button. Drag the other end of the Parent To Category shape to the center of the Category shape. When the Category shape is outlined, release the mouse button.

Both connection points appear red.

  1. Drag a Category To Child shape onto the drawing page. Drag one end of the Category To Child shape to the center of the Category shape so that the Category shape is outlined, and then release the mouse button. Drag the other end of the Category To Child shape to the center of the child table. When the child table is outlined, release the mouse button.

Both connection points appear red and the primary keys from the parent table are added as foreign keys to the child table.

  1. Repeat step 4 for each child table.

Top of Page Top of Page

Define a category with the Connector tool

  1. Open the database model diagram.
  2. From Entity Relationship or Object Relational, drag a Category shape into the diagram.
  3. Click the Connector tool on the Standard toolbar, and then click the Parent To Category shape. Position the Connector tool over the center of the parent table so that the table is outlined, and then drag to the center of the Category shape. When the Category shape is outlined, release the mouse button.

Both connection points appear red.

  1. With the Connector tool, click the Category To Child shape. Position the Connector tool over the center of the Category shape so that it is outlined, and then drag to the center of the child table. When the child table is outlined, release the mouse button.

Both connection points appear red and the primary keys from the parent table are added as foreign keys to the child table.

  1. Repeat step 4 for each child table.

Top of Page Top of Page

Set a Category shape as complete or incomplete

  1. Open the database model diagram.
  2. Double-click the Category shape whose properties you want to edit to open the Database Properties window.
  3. In the Categories list, click Definition, and then do one of the following:
    • Clear the Category Is Complete check box to mark the category as incomplete.
    • Select the Category Is Complete check box to mark the category as complete.

The database model diagram is updated automatically.

Top of Page Top of Page

Specify a category discriminator attribute

  1. Open the database model diagram.
  2. Double-click the Category shape whose properties you want to edit to open the Database Properties window.
  3. In the Categories list, click Definition, click This attribute, and then select the column from the parent table that you want to define as the category discriminator.

The database model diagram is updated automatically.

Top of Page Top of Page

 
 
Applies to:
Visio 2007