MySQL Relationships & Foreign Keys
Published on 21 November 2011 at 22:18 by
Just another snippet of code that I will forget...
ALTER TABLE `accounts`
ADD CONSTRAINT `FK_myKey` FOREIGN KEY (`customer_id`)
REFERENCES `customers` (`customer_id`)
ON DELETE CASCADE ON UPDATE CASCADE;