Insert into table but unsure of foreign key
Table Order
oid payerName address
1 james 1 brown
2 smith 2 smith
Table order_item
oid type price
1 AN94 3000
2 AK47 1000
order_item as a foreign from Order.
oid is an auto increment in Order Table but in order_item table it is
not(dont know if thats is the right way to do it)
I have an insert statement which inserts into both tables at the same
time. I was wonder if it the right to make order_item oid an auto
increment as well? because the is not other way I can make it copy the oid
from order table.
What is the best approach to this small issue.
No comments:
Post a Comment