删除所有选修了课程号(course_id)为dep04_b001的学生。(分别用相关子查询和不相关子查询完成)
时间: 2023-05-31 17:04:26 浏览: 116
删除学生信息
5星 · 资源好评率100%
相关子查询:
```
DELETE FROM student WHERE id IN (SELECT student_id FROM course_selection WHERE course_id = 'dep04_b001');
```
不相关子查询:
```
DELETE FROM student WHERE id IN (SELECT student_id FROM course_selection WHERE course_id IN (SELECT id FROM course WHERE course_id = 'dep04_b001'));
```
阅读全文