Mysql: Create Foreign Key

October 12th, 2008 by jeremychone

Assuming 1 to M from Person to Address:

ALTER TABLE address ADD
CONSTRAINT FK_address_person_id
FOREIGN KEY (person_id)
REFERENCES person(id) ON DELETE CASCADE

MySQL - SQL Table Basics - Table Relationships

Leave a Reply