Question

1.
2.
3.
4.
Answer (Detailed Solution Below)

Option 3 : The department row and all 12 referencing employee rows are deleted / विभाग पंक्ति और संदर्भ देने वाली सभी 12 कर्मचारी पंक्तियां हट जाएंगी

Advertisement

Detailed Solution

सही उत्तर The department row and all 12 referencing employee rows are deleted / विभाग पंक्ति और संदर्भ देने वाली सभी 12 कर्मचारी पंक्तियां हट जाएंगी है।

Key Points
Helpful?
PrepSnapprepsnap.in • Part -A

Question:

Dept(Did) is the parent table and Emp has a foreign key Did referencing Dept(Did) with ON DELETE CASCADE. A department with 12 employees is deleted from Dept. What happens? / Dept(Did) जनक तालिका है और Emp में Dept(Did) का संदर्भ देने वाली विदेशी कुंजी Did है जिस पर ON DELETE CASCADE है। 12 कर्मचारियों वाला एक विभाग Dept से हटाया जाता है। क्या होगा?

1.
Deletion is blocked until the employees are reassigned / कर्मचारियों के पुनः आबंटन तक हटाना अवरुद्ध रहेगा
2.
Only the department row is deleted; the 12 employee rows remain with a dangling key / केवल विभाग पंक्ति हटेगी; 12 कर्मचारी पंक्तियां निराधार कुंजी सहित रहेंगी
3.
The department row and all 12 referencing employee rows are deleted / विभाग पंक्ति और संदर्भ देने वाली सभी 12 कर्मचारी पंक्तियां हट जाएंगी
4.
The department row is deleted and the 12 foreign keys are set to NULL / विभाग पंक्ति हटेगी और 12 विदेशी कुंजियां NULL हो जाएंगी

Correct Answer: The department row and all 12 referencing employee rows are deleted / विभाग पंक्ति और संदर्भ देने वाली सभी 12 कर्मचारी पंक्तियां हट जाएंगी

ON DELETE CASCADE propagates the deletion: removing the parent row automatically deletes every child row that references it. So the department plus its 12 employees disappear; nothing is blocked and no NULLs are set. / ON DELETE CASCADE हटाने का प्रसार करता है: जनक पंक्ति हटाने पर उसका संदर्भ देने वाली प्रत्येक शिशु पंक्ति स्वतः हट जाती है। अतः विभाग सहित उसके 12 कर्मचारी विलुप्त हो जाते हैं; कुछ अवरुद्ध नहीं होता और कोई NULL नियत नहीं होता।

Downloaded from PrepSnap (prepsnap.in)