- Click the Tables node in the Data window tree view and
click the New Item button on the Data window toolbar.
- You will see the Create New Table dialog box appear.
- Type Orders in the Table Name box.
- Click the New button in the Columns area of the dialog
box.
- Type OrderID in the Name box in the Column Properties
area of the dialog box.
- Select Int in the Data Type drop-down.
- Select the Required check box and then select the Primary
Key and Auto-increment check boxes.
- Click New to continue adding columns.
- Add a second column to the Orders table called OrderDate
with the following properties:
• Name: OrderDate
• Data Type: DateTime
• Required: True (checked)
• Primary Key: False (unchecked)
- Add a third column to the Orders table called CustomerName
with the following properties:
• Name: CustomerName
• Data Type: VarChar
• Required: True (checked)
• Primary Key: False (unchecked)
• Field Size: 50 (default)
- Click OK to save the Orders table to the Orders
database.
- The Orders table appears as a Tables child node in the
Data window.
- Click the Tables node in the tree view and click the New
Item button on the Data window toolbar. Add a second table to
the Orders database called OrderDetails.
- Add a primary key column to the OrderDetails table called
OrderDetailID with the following properties:
• Name: OrderDetailID
• Data Type: Int
• Required: True (checked)
• Primary Key: True (checked)
• Auto-increment: True (checked)
- Add a second column to the OrderDetails table called OrderID
with the following properties:
• Name: OrderID
• Data Type: Int
• Required: True (checked)
• Primary Key: False (unchecked)
• Auto-increment: False (unchecked)
- Add a third column to the OrderDetails table called
ProductName with the following properties:
• Name: ProductName
• Data Type: VarChar
• Required: True (checked)
• Primary Key: False (unchecked)
• Field Size: 50 (default)
- Add a fourth column to the OrderDetails table called
Quantity with the following properties:
• Name: Quantity
• Data Type: Int
• Required: True (checked)
• Primary Key: False (unchecked)
• Auto-increment: False (unchecked)
- Add a fifth column to the OrderDetails table called
UnitPrice with the following properties:
• Name: UnitPrice
• Data Type: Money
• Required: True (checked)
• Primary Key: False (unchecked)
- Click OK to save the OrderDetails table to the Orders
database.
- The OrderDetails table appears as a Tables child node in
the Data window.