On executing the DELETE command, if you get an error “foreign key constraint” – what does it imply?
Correct answer
D. Data is present in the other table
16 views
D. Data is present in the other table
16 views
The error means data is present in the other table: rows in a child table still reference the row you are trying to delete through a foreign key.
MySQL blocks the delete to preserve referential integrity. Either delete the child rows first or define the foreign key with ON DELETE CASCADE.
Want more practice? Try the full set of Database Management Systems MCQs on MCQsExam.com.
Not sure why the answer is D? Ask here and get an explanation.