Click here to Skip to main content
15,850,921 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 2 table order and item.
order table

order_id
order_name
Item_id
Waite_id
TAble_no
Order_detail
time

And in item table

Item_id
Item_name
Item_price

so how to make relationship between them.if A CUSTOMER order 4 item then how to store 4 item in order table in itemid field
Posted
Comments
Tomas Takac 19-Feb-15 4:13am    
Can the same item be in multiple orders?

1 solution

Try.
crtetae 2 table for the order.
1st one for the overall order_details and 2nd one for the the item_details for the order.
like this.

Tabl_Item --Ok
SQL
Item_id(Primary_key)
Item_name
Item_price

Table_Order_master
VB
order_id(Primary_key)
order_name
Waite_id
TAble_no
Order_detail
time


Table_Order_Details
SQL
ID(Pk)
order_id(Foreign_Key  to Table_Order_master)
Item_id(Foreign_Key  to Tabl_Item )
Qty
.
.
etc
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900