Introducing SQL Anywhere Studio
Tutorial: Designing Databases with PowerDesigner
You are now ready to add the unit_price column to the sales_order_items table. You can accomplish this task by accessing the list of columns through the Table property sheet.
To add a column
Display the column properties:
Right-click the sales_order_items table and select Properties from the popup menu.
The Table property sheet appears:
Click the Columns tab.
The list of columns appears:
Add a new column to hold the unit price.
Click the Insert a Row tool.
An arrow appears at the beginning of the line and a column with a default name (Column_6) appears.
Type unit_price in the name column. The name is automatically duplicated as the code.
From the Data dropdown list, choose Numeric. (The Data field may be too narrow to read. You can pull the sides of the column to expand it.)
The column properties P, F, and M stand for Primary Key, Foreign Key, and Mandatory, as follows:
Primary key designates a column whose values uniquely identify a row in the table.
Foreign key designates a column that depends on and migrates from a primary key column in another table.
Mandatory indicates a column that must be assigned a value.
Select Mandatory and click OK.
Examine the effect of your changes on the diagram of the database. The sales_order_items table now includes a new column called unit_price.