Result:
此时如果想删除和posId相关的外键,只需要 alter table employee drop foreign key employee_ibfk_3;
找出以employee为REFERENCED_TABLE的所有约束
select TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME from INFORMATION_SCHEMA.KEY_COLUMN_USAGE where CONSTRAINT_SCHEMA ='vhr' AND REFERENCED_TABLE_NAME = 'employee';Result: