37.以班级号和年龄从大到小的顺序查询student表中的全部记录
select * from student order by class desc,birthday asc;
38、查询"男"教师 及其所上的课
select * from course where t_no in(
select no from teacher where sex='男'
);
39、查询最高分同学的 score 表。
select * from score where degree in(
select max(degree) from score
);
40、查询和 “李军” 同性别的所有同学 name 。
select name from student where
sex= (select sex from student where name='李军');
41、查询和 “李军” 同性别且同班的同学 name 。
select name from student where sex=(
select sex from student where name='李军') and class=(select class from student where name='李军');
42、查询所有选修 “计算机导论” 课程的 “男” 同学成绩表。
需要的 “计算机导论” 和性别为 “男” 的编号可以在 course 和 student 表中找到,再利用子查询查找。
select * from score where c_no=(
select no from course where name='计算机导论') and s_no in( select no from student where sex='男');