How to change the engine type of a table : >alter table reportsTransfer engine= innodb ; How to add foreign key to a table : >ALTER TABLE tbl_name ADD [CONSTRAINT symbol ] FOREIGN KEY [ index_name ] ( index_col_name , ...) REFERENCES tbl_name ( index_col_name , ...) [ON DELETE {RESTRICT | CASCADE | SET NULL | NO ACTION}] [ON UPDATE {RESTRICT | CASCADE | SET NULL | NO ACTION}] e.g >alter table reportsTransfer add foreign key reportsId (reportsInsertedId ) references reportsInserted (id) Note > Before adding a foreign key to table make sure both the tables ( Reference table and table having foreign key ) engine type = InnoDb . >InnoDB does not check foreign key constraints on those foreign key or referenced key values that contain a NULL column. >Currently, triggers are not activated by cascaded foreign key actions. Explain doesn't works with Delete and Update statement.