外键约束:
alter table emp add constraint fk_emp_dept_id foreign key (dept_id) references dept(id); 添加主键
alter table emp drop foreign key fk_emp_dept_id; 删除主键
标签:--,约束,dept,emp,mysql,主键,foreign,id From: https://www.cnblogs.com/yangduanduan123/p/16948886.html