2019-07-19
阅读量:
1016
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;






评论(0)


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