Which of the following options can be used with the "on delete" command? a. Set null b. Set default c. Cascade d. All of the above
Answers
Answered by
1
Answer:
C. Cascade
Explanation:
Answered by
1
Answer:
All the above is the correct answer
Set null, Set default and Cascade are used with the 'on delete' command.
Explanation:
The function of on delete:
- It helps to maintain the relation's referential integrity. Referential integrity issues arise when deleting an attribute of a relation that serves as the foreign key in another relation.
- This issue is resolved by the on delete cascade, which makes us delete the foreign key first.
The function on of on delete cascade:
- To define whether rows should be deleted in a child table when matching rows are deleted in the parent table, use the ON DELETE CASCADE option.
The function of on delete Set Default :
If the corresponding entries in the parent table are deleted, SQL Server restores the child table's rows to their default values.
The function of on delete Set null :
- When a record in the parent table is deleted, a foreign key with "set null on deletion" causes the related entries in the child table to have their foreign key fields set to null.
- The child table's records won't be removed.
#SPJ2
Similar questions