xxxxxxxxxx
/*for existing tables*/
ALTER TABLE `accounts`
ADD CONSTRAINT `FK_myKey` FOREIGN KEY (`customer_id`)
REFERENCES `customers` (`customer_id`) ON DELETE CASCADE ON UPDATE CASCADE;
/*in create table*/
CREATE TABLE accounts(
account_id INT NOT NULL AUTO_INCREMENT,
customer_id INT( 4 ) NOT NULL ,
PRIMARY KEY ( account_id ),
FOREIGN KEY (customer_id) REFERENCES customers(customer_id)
);