ALTER TABLE `tabl` ADD CONSTRAINT `constraint_name` FOREIGN KEY (`column`) REFERENCES `table2` (`id`) ON DELETE CASCADE;