I m currently making a table on primary foreign key relation....
book table
bookid bookname author
0 No book no author
1 Engg Maths Greiwal
2 Java Basics James Gosling
3 Mahabharata Ved Vyasa
4 Ramayana Valmiki
5 Harry Potter JK Rowling
usertable
userid name bookid
1 Arjun 2
2 Charles 2
3 Babbage 3
Here bookid is the foreign key in usertable and is primary key in booktable..... Now i've heard about cascading, setnull , restrict and no action constraints....
0 is set as the default value for column bookid in usertable.....
Now i want a situation when a bookid(primary) entry is deleted from the main table i.e booktable, the entires containing bookid in the user table should be updated to the default value ( i.e here 0 ).....
does there exist any method...???
all i can tell is that i m working on phpmyadmin mysql innodb......