How to change the engine type of a table :
>alter table reportsTransfer engine= innodb ;
How to add foreign key to a table :
>ALTER TABLE
values that contain a
>Currently, triggers are not activated by cascaded foreign key actions.
Explain doesn't works with Delete and Update statement.
>alter table reportsTransfer engine= innodb ;
How to add foreign key to a table :
>ALTER TABLE
tbl_name
ADD [CONSTRAINTNotesymbol
] FOREIGN KEY [index_name
] (index_col_name
, ...)
REFERENCEStbl_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)
> 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 keyvalues that contain a
NULL
column.Explain doesn't works with Delete and Update statement.
Comments