mysql数据库问题,“Cannot add foreign key constraint”求大神帮忙啊 30
mysql>createtabletb_orderItem(orderItemIdintprimarykeyauto_increment,orderIdint,bookI...
mysql> create table tb_orderItem
(
orderItemId int primary key auto_increment,
orderId int,
bookId int,
bookName varchar(50),
price float,
bookNum int,
foreign key(orderId) references tb_order(orderId),
foreign key(bookId) references tb_book(bookId)
);
1215 - Cannot add foreign key constraint 展开
(
orderItemId int primary key auto_increment,
orderId int,
bookId int,
bookName varchar(50),
price float,
bookNum int,
foreign key(orderId) references tb_order(orderId),
foreign key(bookId) references tb_book(bookId)
);
1215 - Cannot add foreign key constraint 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询