我有3個表格創建連接表的問題!
客戶,菜單和訂單。
訂單表假定加入客戶和菜單表,幷包含兩者的主鍵。以下是我嘗試在phpmyadmin上創建訂單表的方法。
create table order(
customerID int not null,
itemID int not null,
primary key (customerID, itemID),
foreign key(customerID) reference customer(ID),
foreign key(itemID) reference menu(itemID)
)
這是行不通的。我究竟做錯了什麼?!!
你可以繼續發佈所有三個表的DDL嗎? – 2011-06-04 01:28:10