2019-07-19
阅读量:
1184
MySQL怎么删除外键约束?
问、MySQL怎么删除外键约束?
答:
语法:alter table +表名+drop foreign key+外键名
–例:删除数据表 tb_emp2 中的外键约束
create table tb_emp2
(id int(11) primary key,
name varchar(25),
deptid int(11),
salary float,
constraint hehe foreign key(deptid) references tb_dept(id));
alter table tb_emp2 drop foreign key hehe;
150.0681
2
6
关注作者
收藏
评论(0)
发表评论
暂无数据
推荐帖子
0条评论
1条评论
0条评论

