The following example shows how data in the LOOP and COMPONENT tables is related.
The LOOP table includes the following columns:
Column |
Example Value |
Column Status |
---|---|---|
LOOP_ID |
1000 |
Primary key |
LOOP_NAME |
F-100 |
|
LOOP_SERV |
Feed to B-101 Pass A |
|
The COMPONENT table includes the following columns:
Column |
Example Value |
Column Status |
---|---|---|
CMPNT_ID |
999 |
Primary key |
CMPNT_NAME |
FT-100 |
|
LOOP_ID |
1000 |
Foreign key |
CMPNT_SERV |
Heat exchanger inlet |
A primary key is the column or a combination of columns where the values determine the uniqueness of each record. Note that both tables include the column LOOP_ID. This column is the primary key in the LOOP table. In the COMPONENT table, the LOOP_ID column uses the value of LOOP_ID in the LOOP table to associate the tag to the loop, and is therefore the foreign key in the COMPONENT table.
In the LOOP table, there is a zero row, which is used as a reference row if you create a tag that is not associated with any loop.
The following SQL Select command retrieves loop numbers and instrument tag numbers with the associations between them:
Select component.cmpnt_name, loop.loop_name from component, loop where component.loop_id = loop.loop_id;