Collection Contents 上一页 下一页 PDF

SQL Anywhere Studio 介绍

使用 PowerDesigner 设计数据库

第 2 课:添加列


现在,就可以向 sales_order_items 表中添加 unit_price 列了。可通过 [Table property] 表访问列的列表来完成此任务。

添加列:

  1. 选择 sales_order_items 表。

  2. 从 [View] 菜单中选择 [Properties]。

    即会出现 [Table Properties] 对话框。

    The PowerDesigner Table Properties dialog.
  3. 单击 [Columns] 选项卡。

    即会出现列的列表。

    The PowerDesigner Table Properties sheet, showing the Columns tab.
  4. 添加新列以存储单价。

    单击 [Insert a Row] 按钮。

    此时,在行首就会出现一个箭头,并显示使用缺省名称 (Column_6) 的列。

  5. 在名称列中键入 unit_price。将此名称自动作为代码进行复制。

    在 [Data Type] 列,从下拉列表中选择 [Numeric]。

    [Data] 字段可能因太窄而无法查看。可以拖动列的两侧以扩展列。

  6. 列属性 P、F 和 M 分别表示 [主键]、[外键] 和 [强制](解释如下):

  7. 选择 [强制],然后单击 [OK]。

  8. 检查所做的更改对数据库图示产生的影响。

    现在,sales_order_items 表包含一个称为 unit_price 的新列。


Collection Contents 上一页 下一页 PDF