Adam K Dean

MySQL Relationships & Foreign Keys

Published on 21 November 2011 at 22:18 by Adam

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;


This post was first published on 21 November 2011 at 22:18. It was filed under archive with tags sql.