Download IBM Informix Guide to SQL Reference

Transcript
The orders and items Tables
The orders and items Tables
The orders and items tables are linked by an order_num column that
contains an identification number for each order. If an order includes several
items, the same order number appears in several rows of the items table. In
the items table, the order_num column is a foreign key that references the
order_num column in the orders table. Figure 1-3 shows this relationship.
Figure 1-3
Tables joined by the order_num column
orders Table (detail)
order_num
order_date
customer_num
1001
05/20/1991
104
1002
05/21/1991
101
1003
05/22/1991
104
items Table (detail)
item_num
order_num
stock_num
manu_code
1
1001
1
HRO
1
1002
4
HSK
2
1002
3
HSK
1
1003
9
ANZ
2
1003
8
ANZ
3
1003
5
ANZ
The stores5 Database 1-15