MySql中能给一个属性设置多个外键引用吗
1个回答
展开全部
create table users(
id int auto_increment primary key,
name varchar(50)
);
create table product1(
p_id int auto_increment primary key,
p_name varchar(50),
f_id int references users(id)
);
create table product2(
p_id int auto_increment primary key,
p_name varchar(50),
f_id int,
foreign key (f_id) references users(id)
);
id int auto_increment primary key,
name varchar(50)
);
create table product1(
p_id int auto_increment primary key,
p_name varchar(50),
f_id int references users(id)
);
create table product2(
p_id int auto_increment primary key,
p_name varchar(50),
f_id int,
foreign key (f_id) references users(id)
);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询