2020-07-06
阅读量:
953
SQL报错:外键约束
Error Code: 1452. Cannot add or update a child row: a foreign key constraint fails (`test`.`employee1`, CONSTRAINT `employee1_ibfk_1` FOREIGN KEY (`deptid`) REFERENCES `dept` (`deptno`))
建表代码如图
解决:
没有导入部门信息,先导入部门信息,再导入员工表信息,因为员工表受外键约束(部门表的编号)






评论(0)


暂无数据
推荐帖子
0条评论
1条评论
0条评论