我想通过IdProduct在表客户和表产品之间建立链接。Mysql外键
例子:
Create table customer(
idcustomer INT not null,
name Varchar(20),
idproduct INT,
);
create table Product(
idproduct INT not null,
nameProduct varchar(40)
);
我如何可以链接在一起,就像为外键系统中的两个,当我选择一个客户,我可以得到他所有的产品?这是关于数据库结构的问题。
我知道,这只是一个纯粹的例子,我只是想加入该表,当我选择一个客户,我可以把他的产品 – ThorDozer 2011-05-24 21:47:58