Entry
How can I ensure the referential integrity of MySQL tables?
Feb 8th, 2000 08:06
Nathan Wallace, Sinisa Milivojevic
You can force referential integrity in your programs.
The easiest way to do it is to check , before updating or deleting
primary key referenced by other tables, for existance of the
corresponding foreign key values in the referencing table.
Also, you could force checking , before inserting or updating foreign
key referencing primary key in some other table, for the existence of
the referenced primary key values in the referenced table.
Such practice would ensure referential integrity in your database.