問題:
I have set up a table that contains a column with a foreign key, set to ON DELETE CASCADE
(delete child when parent is deleted) 我已經建立了一個表,其中包含帶有外鍵的列,並將其設置爲ON DELETE CASCADE
(當刪除父級時刪除子級)
What would the SQL command be to change this to ON DELETE RESTRICT
? 將它更改爲ON DELETE RESTRICT
的SQL命令是什麼? (can't delete parent if it has children) (如果有孩子,則不能刪除其父母)