1012-----SQL作业-----上

1 select t.sname,t.ssex,t.class from STUDENT t

2 select distinct(depart) from teacher t

3 select * from student

4 select * from score r where r.degree between 60 and 80

5 select * from score t where t.degree=85 or t.degree=86 or t.degree=88

6 select * from student t where class='95031' or t.ssex='女'

7 select * from student t order by class desc

8 select * from score t order by t.cno asc,t.degree desc

9 select count(*) from student where class='95031'

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

11 select avg(degree) from score group by cno

12 select avg(degree),cno from score where cno like '3%'group by cno having count(cno)>=5

13 select sno from score where degree between 70 and 90

14 select c.sname,t.cno,t.degree from student c,score t where c.sno=t.sno

15 select a.sno,b.cname,c.degree from student a,course b,score c where b.cno=c.cno and c.sno=a.sno

16 select a.sname,b.cname,c.degree from student a,course b, score c where a.sno=c.sno and b.cno=c.cno

17 select avg(degree) from student a,score b where a.class='95033' and b.sno=a.sno

18 select a.sno,a.cno,b.rank from score a,grade b where a.degree between b.low and b.upp

19 select a.* from score a,score b where a.cno='3-105'and a.degree>b.degree and b.sno='109' and b.cno='3-105'

20 select sno from SCORE t where t.degree<(select max(degree) from score) group by sno having count(cno)>1

21 select * from score where cno='3-105' and degree>(select max(degree) from score where sno = '109' )

22 select sno,sname,sbirthday from student a where a.sbirthday= (select sbirthday from student where sno='109')

23 select sno,cno,degree from score where cno = (select a.cno from course a,teacher b where b.tname='张旭' and a.tno=b.tno)

24 select b.cno from teacher a,score b, course c where a.tno=c.tno and c.cno=b.cno group by b.cno having count(b.cno)>5

转载于:https://www.cnblogs.com/kaililikai/p/5956427.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值