Interview Q&A / SQL & DBMS

INTERVIEW Q&A · 69 QUESTIONS

SQL & DBMS interview questions

Joins, keys, normalisation, indexes and transactions for placement and backend interviews.

  1. What do ON DELETE CASCADE, SET NULL and RESTRICT do in a foreign key?

    They define what happens to child rows when the parent row is deleted. CASCADE deletes the children, SET NULL clears their foreign key, and RESTRICT or NO ACTION blocks the delete.

    IntermediateQuick answer1 min read