select sname,ssex,class from student;
select distinct depart from teacher;
select * from student;
select * from score where degree between 60 and 80;
select * from score where degree in(85,86,88);
select * from student where class="95031";
select * from student order by class desc;
select * from score order by cno and degree desc;
select * from student where class= 95031;
select sno,cno from score having max(degree);
select sno,cno from score where degree != (select max(degree) from score);
select avg(degree) from score group by degree;
select avg(degree) from score group by sno=3 and degree;
select sno from score where degree between 70 and 90;
select student.sname,score.cno,score.degree from student student left join score score on student.sname = score.sno;
select score.cno,course.cname,score.degree from score score left join course course on score.cno=course.cno;
select student.sname,course.cname,score.degree from student student left join score score on student.sname = score.sno left join course course on score.cno = course.cno;、
select avg(degree) from score where sno in (select sno from student where class = 95033);
原文:https://www.cnblogs.com/yuguog/p/14856202.html