louiscb Posted December 11, 2014 Share Posted December 11, 2014 Simple question but I couldn't find any straight forward answers. I have a customer details table with: customer ID, name, address, email. I also have an delivery table with delivery ID, customer ID, order ID. How can I link the customer ID column from the customer table to the delivery table so that when changes occur on the customer table they subsequently alter all other tables? I know it might use foreign keys but I couldn't find any online resource that explained how to use them properly. Cheers Quote Link to comment Share on other sites More sharing options...
Barand Posted December 11, 2014 Share Posted December 11, 2014 (edited) Use foreign keys with the ON UPDATE and/or ON DELETE actions set to CASCADE http://dev.mysql.com/doc/refman/5.6/en/create-table-foreign-keys.html Edited December 11, 2014 by Barand Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.