0

I have developed few projects till now but I never used a foreign key relation ship between any 2 tables. Can anyone please tell me what is the benefit of using the foreign key of one table referencing to a primary key of other table. I truely need to know about it because the project which I will do now its going to be a big project which will have a relationship between all the tables. I will be using mysql database as a backend. Also while I was creating foreign key mysql is asking that 'ON DELETE' and 'ON UPDATE' with a dropdown, what it means? Also want to know does primary_key and forein_key columns should have same name in both tables? and what should I set it? Can anyone please explain me bit briefly?

Prasad Patel
  • 707
  • 3
  • 16
  • 53

0 Answers0