答案(2)

答案28-45

28.

select tname,prof from teacher where prof not in(select prof from teacher where depart='计算机系' and prof in(select prof from teacher where depart='电子工程系'))

29.

select * from score where cno='3-105' and degree>any(select degree from score where cno='3-245')

30.

select * from score where cno='3-105' and degree>all(select degree from score where cno='3-245')

31.

select sname,ssex,sbirthday from student
union
select tname,tsex,tbirthday from teacher

32.

select sname,ssex,sbirthday from student where ssex=''
union
select tname,tsex,tbirthday from teacher where tsex=''

33.

select * from score a where degree<(select avg(degree) from score b where b.cno=a.cno)

34.

select tname,depart from teacher where tno in(select tno from course where cno in(select distinct cno from score))

35.

select tname,depart from teacher where tno not in(select tno from course where cno in(select distinct cno from score))

36.

select * from student group by class having count(*)>1 and ssex=''

37.

select * from student where sname not like '王%';

38.

select sname,YEAR(now())-YEAR(sbirthday) from student

39.

select max(sbirthday),min(sbirthday) from student

40.

select * from student order by class desc,sbirthday

41.

select * from teacher,course where teacher.tno = course.tno and tsex=''

42.

select * from score where degree=(select max(degree) from score)

43.

select * from student where ssex=(select ssex from student where sname='李军')

44.

select * from student where ssex=(select ssex from student where sname='李军') and class=(select class from student where sname='李军')

45.

select * from score where sno in(select sno from student where ssex='') and cno in(select cno from course where cname='计算机导论')
原文地址:https://www.cnblogs.com/Whitehat/p/8267565.html