标签: sql mysqli phpmyadmin relational-database foreign-key-relationship
正如标题所说,我已经设法通过设计器视图创建表之间的关系,但我也需要通过SQL手动创建它们。这是我想用SQL和删除Cascade实现的:
冠军实际上是什么冠军_ibfk_1
ALTER TABLE `champions` ADD CONSTRAINT `champions_ibfk_1` FOREIGN KEY (`Patch_No`) REFERENCES `info` (`Patch_No`) ON DELETE CASCADE;