The PARTS schema is used for managing parts.
It comprises the tables ITEMS, ITEM_CAT, PURPOSE, WAREHOUSE, COLOR_TAB and TABTAB.
Figure 6: Base tables of the PARTS schema; referencing foreign keys are displayed on a gray background
ITEMS table
The ITEMS table contains information about the stocked articles. It consists of a unique item number, the item name, its color and price, the current and minimum permitted stock levels for the item.
The ITEMS table is defined as follows:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ITEM_NUM is the primary key of the ITEMS table.
The ITEMS table contains the following data:
item_num | item_name | color | price | stock | min_stock |
1 | Bicycle | black | 700.50 | 2 | 1 |
2 | Bicycle | flame | 230.00 | 1 | 1 |
10 | Frame | black | 150.00 | 10 | 5 |
11 | Frame | edelweiss | 150.00 | 10 | 5 |
120 | Front wheel | metallic | 40.00 | 3 | 5 |
130 | Back wheel | metallic | 40.00 | 12 | 5 |
200 | Handlebars | metallic | 60.00 | 1 | 5 |
210 | Front hub | metallic | 5.00 | 15 | 1 |
220 | Rear hub | metallic | 5.00 | 14 | 10 |
230 | Rim | black | 10.00 | 9 | 10 |
240 | Spoke | black | 1.00 | 211 | 240 |
500 | Screw M5 | black | 1.10 | 300 | 240 |
501 | Nut M5 | black | 0.75 | 295 | 240 |
Table 9: Data in the ITEMS table
ITEM_CAT table
The ITEM_CAT table contains two REF columns. The REF values in these columns reference BLOB objects in the BLOB tables IMAGES and DESCRIPTIONS in the ADDONS schema. The ITEM_CAT table is defined as follows:
|
|
|
|
|
|
|
|
|
The ITEM_CAT table contains the following data:
item_ | image | desc |
2 | ADDONS/IMAGES? | ADDONS/DESCRIPTIONS? |
120 | ADDONS/IMAGES? | ADDONS/DESCRIPTIONS? |
500 | ADDONS/IMAGES? | ADDONS/DESCRIPTIONS? |
501 | ADDONS/IMAGES? | ADDONS/DESCRIPTIONS? |
Table 10: Data in the ITEM_CAT table
PURPOSE table
The PURPOSE table specifies the individual components involved in the construction of an item and the number of each of these that is required. Some items are used separately and as a component of another item. The PURPOSE table contains the item number of an article in the ITEMS table, the item number of the part in the ITEMS table and the number of times that this part is used in the item (NUMBER).
The PURPOSE table is defined as follows:
|
|
|
|
|
|
|
|
|
|
|
|
|
The foreign keys ITEM_NUM and PART reference the ITEMS.ITEM_NUM primary key of the ITEMS table.
The PURPOSE table contains the following data:
item_num | part | number |
1 | 10 | 1 |
1 | 120 | 1 |
1 | 130 | 1 |
1 | 200 | 1 |
120 | 210 | 1 |
120 | 230 | 1 |
120 | 240 | 15 |
120 | 500 | 5 |
120 | 501 | 5 |
200 | 500 | 10 |
200 | 501 | 10 |
Table 11: Data in the PURPOSE table
WAREHOUSE table
The WAREHOUSE table contains information about the item stocks in the individual warehouses. It consists of an item number in the ITEMS table and the stock of the item at a given warehouse location.
The WAREHOUSE table is defined as follows:
|
|
|
|
|
|
|
|
|
|
|
The foreign key ITEM_NUM refers to the primary key ITEMS.ITEM_NUM in the ITEMS table. The WAREHOUSE table contains the following data:
item_num | stock | city |
1 | 2 | Main warehouse |
2 | 1 | Main warehouse |
10 | 10 | Main warehouse |
11 | 10 | Main warehouse |
120 | 3 | Main warehouse |
130 | 3 | Main warehouse |
130 | 9 | Parts warehouse |
200 | 1 | Main warehouse |
210 | 15 | Main warehouse |
220 | 8 | Main warehouse |
220 | 6 | Parts warehouse |
230 | 6 | Main warehouse |
230 | 3 | Parts warehouse |
240 | 11 | Main warehouse |
240 | 200 | Parts warehouse |
500 | 120 | Main warehouse |
500 | 180 | Parts warehouse |
501 | 248 | Main warehouse |
501 | 47 | Parts warehouse |
Table 12: Data in the WAREHOUSE table
COLOR_TAB
The COLOR_TAB table contains information about how individual colors can be constructed from differing proportions of red, green and blue. It consists of the name of the color and the different proportions of red, green and blue
The COLOR_TAB table is defined as follows:
|
|
|
|
|
|
|
The COLOR_TAB table contains the following data:
color_name | rgb | ||
flame | 0.98 | 0 | 0 |
orange | 0.9 | 0.3 | 0 |
skyblue | 0 | 0 | 0.99 |
aquamarine | 0 | 0.1 | 0.99 |
edelweiss | 0.99 | 0.99 | 0.99 |
black | 0 | 0 | 0 |
metallic | 0 | 0.2 | 0.3 |
Table 13: Data in the COLOR_TAB table
TABTAB table
The TABTAB table contains information about the tables present in the PARTS schema. It consists of a unique table number, the table name and the function of the table.
The TABTAB table is defined as follows:
|
|
|
|
|
|
|
|
|
TABLE_NUM is the primary key of the TABTAB table. The TABTAB table contains the following data:
table_num | table_name | comment |
1 | items | Parts data |
2 | purpose | Related bicycle data |
3 | warehouse | Warehouse locations |
4 | color_tab | Permissible colors |
5 | tabtab | Tables used |
6 | item_cat | Basic data for catalog |
Table 14: Data in the TABTAB table