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?
Asked
Active
Viewed 48 times
0
-
does primary_key and forien_key should have same column names in both tables? – Prasad Patel Dec 12 '16 at 10:50
-
Sorry I am new to 'stackoverflow' so I made that mistake. I removed that tag. – Prasad Patel Dec 12 '16 at 11:00