< Previous | Next >

Adding a column to a table by using the overview diagram and the Properties view

In the last lesson, you created a simple overview diagram that contains a subset of the tables that are in the sample_model.pdm physical data model. In this lesson, you will modify the overview diagram, and also use the overview diagram to modify the underlying data model.

Now that you have created the simplified overview diagram of your data model, you can use the diagram palette to add notes and objects to your data model. The diagram editor can help you visualize the changes to your data model and how the objects in the model interact. By adding a column to the EMP_EMPLOYEE_DIM schema, you can track the middle initial of each employee. You can later use this middle initial column to make unique foreign-key and primary-key relationships between data objects.

Some of the objects on the palette are used for annotation only, and do not change the underlying data model. For example, you can add notes or text objects to the diagram to document information about model objects or relationships. You can also add geometric shapes to the diagram that contain text or that visually group diagram objects together. You can modify the display characteristics of the diagram by changing font or color options, or by changing diagram properties in the Properties view. All of these options change the diagram properties, but do not modify the underlying data model.

The Data area of the palette contains data model objects. When you add or modify data model objects by using the palette or the diagram surface, you modify the underlying data model. Changes that you make to data objects in a diagram are automatically saved to the diagram, but you must explicitly save the model file to save the changes to the model.

In the Properties view, you can view and modify the properties of data model objects. Typically, you use the diagram editor and the Properties view together to modify data model objects. When an object is highlighted in either a diagram or the Data Project Explorer, the Properties view changes to show the properties of that object.

To add relationships between tables by using the overview diagram and the Properties view:

  1. Add a note to the diagram to describe the diagram:
    1. Click the Note object (Note object, located on the diagram editor palette) on the diagram palette. If the Note object is not visible, click the drop down arrow at the top of the diagram palette to see available annotation objects.
      Screen capture showing the diagram palette.
    2. Click the diagram surface to add the Note object to the diagram. Hold the left mouse button on the diagram surface, and drag the Note object to size it on the diagram. When you release the left mouse button, your cursor is active in a text box inside the Note object.
    3. Add text to the note to describe the diagram. In the text box inside the Note object, type myGOSALESDW schema diagram.
  2. Display the key and non-key objects in the tables. In the Filters tab of the Properties view, select the Show key and Show non-key check boxes.
  3. Arrange the tables in the diagram. Right-click in the diagram surface, and select Arrange All.
  4. Find the EMP_EMPLOYEE_DIM table in the diagram:
    1. Click a blank area in the diagram and press Ctrl+F.
    2. In the window that opens, type EMP_EMPLOYEE_DIM in the Find field.
    3. Click Find Next.
    4. Click Close to close the window.
    The EMP_EMPLOYEE_DIM table is moved to the visible area of the diagram and highlighted. In the Properties view, you can see properties of the EMP_EMPLOYEE_DIM table.
  5. Create a new MIDDLE_INITIAL column within the table. In this step, you use the diagram to modify the underlying data model by adding a column to the EMP_EMPLOYEE_DIM. You add the MIDDLE_INITIAL column to document the middle initial of the name of an employee.
    1. Click the Columns tab in the Properties view.
    1. Click the New icon (New icon).
    2. Type MIDDLE_INITIAL in the Name field.
      Screen capture showing the MIDDLE_NAME column that is added to the table
    3. Move the MIDDLE_INITIAL column to the proper position in the table. Click the Move Column Up arrow icon (Move Column Up arrow icon) until the MIDDLE_INITIAL column is below the FIRST_NAME column but above the LAST_NAME column.
      Screen capture showing the MIDDLE_NAME column in the correct position
    Now that you modified the data model by using the diagram, the label for the sample_model.pdm file has an asterisk (*) character next to it in both the Data Project Explorer and in the physical model editor title bar. This asterisk indicates that changes have been made to the model that have not yet been saved.
    Screen capture showing the asterisk (*) character displayed, as described.
  6. Save your diagram changes to the model by clicking File > Save All from the main menu.
< Previous | Next >

Feedback