0

我想创建两个表。产品、成员和类别。我希望表的结构如下:

类别:两个字段:(Category_ID)(Category_Name),我希望 Category_ID 成为主键

产品:三个字段 (Product_ID) (Product_Name) (Product_Price),(Category_ID),我希望 Product_ID 为主键,Category_ID 为外键。

我已经为此工作了几个小时,并且不断收到约束错误。如果有人愿意向我展示他们将在我的情况下使用的 SQL 语句,那就太好了。

4

1 回答 1

1

If you're using phpMyAdmin you can do it all with the GUI. And once you've created your tables with the GUI, you can look at the SQL it used to create them, or the alter statements it used to create the PK / FK constraints.

于 2009-10-19T20:11:44.850 回答