Reputation: 11
I have multiple tables containing different data. Some fields exist in other tables and are related to eachother. How could I make it that if I update field A in table A the related field in table C automatically updates too?
Thanks in advance
Upvotes: 1
Views: 1214
Reputation: 52645
You need to create or update the FK to Cascade the change
FOREIGN KEY (parent_id) REFERENCES parent(id)
ON UPDATE CASCADE
For more see the documentation on FOREIGN KEY Constraints
Upvotes: 5