What action does SET NULL perform on foreign keys when the referenced record is deleted?…
- User
What action does SET NULL perform on foreign keys when the referenced record is deleted? Group of answer choices
Deletes the record
Sets foreign key to NULL
Updates the key
Leaves the key unchanged
Assistant
The correct answer is: Sets foreign key to NULL
Explanation:
-
SET NULL is a referential action that can be specified for a foreign key constraint. When the referenced record (i.e., the parent record) is deleted, the foreign key column(s) in the referencing table (i.e., the child table) that point to the deleted record are set to NULL.
-
For SET NULL to work, the foreign key column(s) must be defined to allow values. If they are defined as , using will result in an error upon attempting to delete the referenced record.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.