Skip to content

Creating the Inventory Parts Table

You will now create the Inventory Parts Table for the Order Entry sample application.

Step 1: Create New Table

  1. Click the Create New Table button on the Table Explorer toolbar.
  2. In the Create New Table dialog, type Inventory as the Table Name and click Ok.
  3. The new table will open in the Table Editor.

Step 2: Add Columns

Add columns to the table schema until your column definitions look like those in the image below.

Inventory Table Columns Complete

Next, you will add indexes for this table.

Step 3: Add Indexes

  1. Click on the Add Index toolbar button on the Index tab to add a new index.
  2. Enter the Segments grid and select Item_Id as the column to add as the first index segment from the combo box. This is the only segment for the first index, meaning that we will never be allowed to have two parts with the same item ID. This is what we want.

The completed index should look like this:
Inventory Table Index 1 Complete

  1. Click on the Add Index toolbar button to add index 2. The segments of this index will be Vendor_Id, Vendor_Part_Id, and Item_Id.

The completed index should look like this:
Inventory Table Index 2 Complete

  1. Click on the Add Index toolbar button to add index 3. The segments of this index will be Description and Item_Id.

The completed index should look like this:
Inventory Table Index 3 Complete

Step 4: Add Relationships

Next, you will add relationships for this table.

  1. Click on the Add Relationship toolbar button on the Relationships tab to add a new relationship.
    This will open the Add a Relationship dialog.
  2. Select the Vendor table and click Ok.
  3. In the relationship Column Pairs grid, select Vendor_Id in the From Inventory column and Id in the To Vendor column.

The completed relationship should look like this:
Inventory Table Relationship 1 Complete

Step 5: Save the Table Schema

  1. Click the Save File toolbar button (or press Ctrl + S) to save the table schema.

The Output window will display the results of the save operation.
Note that a Data Dictionary is automatically created when you create a new table (when you save the table the first time).

Next Step

Creating the Order Detail Table