View previous topic :: View next topic
|
Author |
Message |
arunsingh
New User
Joined: 21 Jun 2006 Posts: 1 Location: Pune
|
|
|
|
Given a qustion and only 1 answer is correct.
Q. Which of the following options you prefer if your business need to keep your TABLE data on "T1" intact but allows referencing table data on "T2" to be deleted. Assume a foreign key on T1 references an unique key on T2.
1) ON DELETE CASCADE
2) ON DELETE SET NULL
3) ON DELETE RESTRICT
4) NONE |
|
Back to top |
|
|
Jerry
New User
Joined: 16 Sep 2005 Posts: 42
|
|
|
|
Hi Arunsingh,
I would choose ON DELETE SET NULL. |
|
Back to top |
|
|
stly Warnings : 1 New User
Joined: 25 Jul 2005 Posts: 93
|
|
|
|
ON DELETE CASCADE
should be selected.if the parent rows are deleted,teh corresponding rows in the child will also be deleted. |
|
Back to top |
|
|
Jerry
New User
Joined: 16 Sep 2005 Posts: 42
|
|
|
|
Hi Stly,
Did you note that arunsingh had said:
Quote: allows referencing table data on "T2" to be deleted. |
|
Back to top |
|
|
stly Warnings : 1 New User
Joined: 25 Jul 2005 Posts: 93
|
|
|
|
yes jerry,
ih u chhose cascade then the cirresponding child info will also be deleted when ever parent info iss deleted.but according to u the child info will not be deleted but it will be set to NULL.
RESTRICT WILL NOT ALLOW TO DELTE ANY RECORDS IN THE APRENT TABLE IF IT HAS CORRESPONDING R3ECORDS IN THE CHILD TABLE.
CORRECT ME IF I M NOT CORERCT |
|
Back to top |
|
|
stly Warnings : 1 New User
Joined: 25 Jul 2005 Posts: 93
|
|
|
|
HI ARUN,THE CORECT ANSWER FOR UR QUESTION IS NONE AS PER THE OPTIONS.PLEASE GO THRU TEH EXP OF THE OTEHR ONES GIVEN BY ME. |
|
Back to top |
|
|
|