I am developing a bookstore website using PHP/MySQL. I have set some tables in MySQL and I'd like to ask about key constraints.
I created some testing tables I to define how to set key constrains:
There are two parent tables with one primary key each and no foreign keys
There is one child table with no primary key and two foreing keys, one from each parent table.
I'd like to be able to load .csv files using MySQL importing feature in all three tables, and also delete/change information from each of them.
Here my questions:
Should I define key constraints in both parents and child tables?
What should I set in each case for ON DELETE and ON UPDATE?