所谓的子查询就是将这次查询的结果作为下一次查询的条件
--筛选出课程号大于6的学生信息使用子查询如下(也可以使用表连接,前提是有相同的外键约束)
select * from stu where stu_id in (select stu.id from course where course_id>6);
子查询就是where语句后面跟着还有select语句
例如:
查询前10次注册的学生
select * from stu where name in (select name from student where id<10);