- Engine should be the same e.g. InnoDB
- Datatype should be the same, and with same length. e.g. VARCHAR(20) or e.g. Unsigned both
- Collation Columns charset should be the same. e.g. utf8
- Watchout: Even if your tables have same Collation, columns still could have different one.
- Unique - Foreign key should refer to field that is unique (usually primary key) in the reference table.
ON UPDAE: If you use primiary index as a forign key, it doesn't take effect
If parent table update/delete then update/delete child table(including foreign key)
ON DELETE CASCADE ON UPDATE CASCADE