wenwen123

10.查询Score表中的最高分的学生学号和课程号。(子查询或者排序)

select t.sno,t.cno from SCORE t where degree = (select max(degree) from SCORE t)

11、 查询每门课的平均成绩。

12、查询Score表中至少有5名学生选修的并以3开头的课程的平均分数。

select avg(degree) from SCORE t where( cno in (select cno from SCORE t group by cno having count(1)>= 5 )) and cno like \'3%\';

13、查询分数大于70,小于90的Sno列。

14、查询所有学生的Sname、Cno和Degree列。

15、查询所有学生的Sno、Cname和Degree列。

select t.Sno,c.Cname,t.degree from score t join course c on c.Cno = t.Cno; 

16、查询所有学生的Sname、Cname和Degree列。

select t.sname,c.cname,s.degree from STUDENT t,course c,score s where t.sno = s.sno and s.cno = c.cno

17、?查询“95033”班学生的平均分。

select avg(degree) from SCORE t  where sno in (select t.sno from STUDENT t where class = \'95033\')

18、 假设使用如下命令建立了一个grade表:
create table grade(low number(3),upp number (3),rank char(1))
insert into grade values(90,100,’A’)
insert into grade values(80,89,’B’)
insert into grade values(70,79,’C’)
insert into grade values(60,69,’D’)
insert into grade values(0,59,’E’)
现查询所有同学的Sno、Cno和rank列。

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-06-01
  • 2022-12-23
  • 2021-11-06
  • 2022-12-23
猜你喜欢
  • 2021-12-14
  • 2022-12-23
  • 2021-12-13
  • 2022-01-07
  • 2021-11-21
相关资源
相似解决方案