MySQL创建表时出错

时间:2017-02-12 21:41:28

标签: mysql

我是SQL新手。我创建了一个完整的表请求文件,除了一个以外都可以正常工作。该错误与Orders_Info表中的ProductPrice外键有关。我无法看到或发现我做错了什么。有人能帮忙给我一个指针吗?

Create table Orders
(
Order_Number INT (11) NOT NULL AUTO_INCREMENT,
Date Date, Account_Number INT(11),
FOREIGN KEY (Account_Number) REFERENCES User_Accounts(Account_Number) ON   DELETE CASCADE,
Address_ID INT(11),
FOREIGN KEY (Address_ID) REFERENCES Address_Book(Address_ID) ON DELETE CASCADE,
Order_Status VARCHAR(30) NOT NULL, PRIMARY KEY (Order_Number)
)ENGINE=InnoDB;

Create table Order_Info
(
Order_Number INT (11),
FOREIGN KEY (Order_Number) REFERENCES Orders(Order_Number) ON DELETE CASCADE,
Product_Number INT (11),
FOREIGN KEY (Product_Number) REFERENCES Products(Product_ID) ON DELETE CASCADE,
Product_Quantity INT (11), ProductPrice Decimal(10,2) NOT NULL,
FOREIGN KEY (ProductPrice) REFERENCES Products(ProductPrice) ON DELETE CASCADE
)ENGINE=InnoDB;

0 个答案:

没有答案