ALTER TABLE `SWIMMER`
ADD CONSTRAINT `fk5` FOREIGN KEY (`CoachID`, `Country`) REFERENCES `TEAMMEMBER` (`MemberID`, `Country`),
ADD CONSTRAINT `fk1` FOREIGN KEY (`MemberID`, `Country`) REFERENCES `TEAMMEMBER` (`MemberID`, `Country`);
我正在使用此SQL查询,但不幸的是它运行了,但是phpmyadmin中的设计器模式没有显示TeamMember表和Swimmer表之间的关系,该表是该数据库中的超类型和子类型关系。请让我知道您是否可以执行这种SQL查询,或者是否需要建立其他连接。
ALTER TABLE `SWIMMER`
ADD CONSTRAINT `fk5` FOREIGN KEY (`CoachID`, `Country`) REFERENCES `TEAMMEMBER` (`MemberID`, `Country`),
ADD CONSTRAINT `fk1` FOREIGN KEY (`MemberID`, `Country`) REFERENCES `TEAMMEMBER` (`MemberID`, `Country`);