7个回答

join 学生选课表 b on a.no=b.student_no
join 课程表 c on b.course_no=c.no
Group by c.name,c.no

Select a.name,a.no,count(*) from 学生表 a
join 学生选课表 b on a.no=b.student_no
Group by a.name,a.no
Order by 3 desc

select avg(grade) avgs,count(*) num from 选课表 group by student_no
having count(*)>2

select * from (select avg(grade) avgs,count(*) num from 选课表 group by student_no) stu where stu.num>2

qq_41984635 select * from (select avg(grade) avgs,count(*) num from 选课表 group by student_no) stu where stu.num>2

join 学生选课表 b on a.no=b.student_no
join 课程表 c on b.course_no=c.no
Group by c.name,c.no

Select a.name,a.no,count(*) from 学生表 a
join 学生选课表 b on a.no=b.student_no
Group by a.name,a.no
Order by 3 desc

select avg(grade) avgs,count(*) num from 选课表 group by student_no
having count(*)>2

4 insert into tb_rel_n**

select a.name,b.name,c.grade from 学生选课表 a,课程表 b, 学生选课表c where a.no=c.student_no and b.no=c.course_no

1, select c.name,c.no,c.counts,Max(sc.grade) from 学生选课表 sc inner join 学生信息表 s
on sc.student_no = s.no inner join 课程表 c on c.no=sc.course_no;
group by sc.student_no,sc.course_no;

2,__ select count(*) as ccount from 学生选课表 sc group by sc.student_no order by ccount desc;_
3,select count(course_no) as sccount,Avg(grade) from 学生选课表 sc group by sc.student_no;
4, insert into tb_rel_new select * from (select s.name as sname ,c.name as cname ,sc.grade as grade from 学生选课表 sc inner join 学生信息表 s
on sc.student_no = s.no inner join 课程表 c on c.no=sc.course_no)

shenyunzhou_lb 1 select t.course_no,c.name,count(1) cnt,max(grade) grade from Ñ§ÉúÑ¡¿Î±í t,¿Î³ÌÐÅÏ¢±í c where t.course_no=c.no group by t.course_no,c.name

1 select t.course_no,c.name,count(1) cnt,max(grade) grade from 学生选课表 t,课程信息表 c where t.course_no=c.no group by t.course_no,c.name

2 select t.student_no,s.name,cnt from (select t.student_no,s.name,count(1) cnt from 学生选课表 t,学生信息表 s where t.student_no=s.no group by t.student_no,s.name ) order by cnt desc

3 select t.student_no,s.name,avga,cnt from (select t.student_no,s.name,avg(t.grade) avga ,count(1) cnt from 学生选课表 t,学生信息表 s where t.student_no=s.no group by t.student_no,s.name having count(1)>2) order by cnt desc

4 insert into tb_rel_new select t.student_no,s.name,c.name as course_name,t.grade from 学生选课表 t,学生信息表 s,课程信息表 c where t.student_no=s.no and t.course_no=c.no order by s.no;
commit;