表测验 quiz_id(FK,PK) 标题
表格问题 quiz_id(FK) QuestionID(PK) 文本 困难
如何在Java中删除具有相同quiz_id的测验和问题?
我试图将2个查询用分号隔开,这是行不通的。
SET REFERENTIAL_INTEGRITY FALSE;
BEGIN TRANSACTION;
DELETE FROM quiz WHERE quiz_id IN (SELECT quiz_id FROM question WHERE
quiz_id= 2);
DELETE FROM question WHERE quiz_id= 2;
COMMIT;
SET REFERENTIAL_INTEGRITY TRUE;