Results 1 to 9 of 9
Thread: Key constrains
Jun 20, 2012, 08:48 #1
- Join Date
- May 2011
- 1 Post(s)
- 0 Thread(s)
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?
Thanks a lot!!