mysql数据库表,如何建外键

alter table 表名 add constraint FK_ID foreign key(你的外键字段名) REFERENCES 外表表名(对应的表的主键字段名);

你可能感兴趣的:(数据库,mysql,table)