–1查询Student表中的所有记录的Sname.Ssex和Class列
select Sname,Ssex,Class from Student
–2查询教师所有的单位即不重复的Depart列。
select distinct Depart from Teacher
–3查询Student表的所有记录。
select * from Student
–4查询Score表中成绩在到之间的所有记录
select * from score where Degree between 60and 80
–5查询Score表中成绩为,86或的记录
select * from Score where Degree in (’85’,’86’,’88’)
–6查询Student表中“”班或性别为“女”的同学记录。
select * from Student where Class=‘95031’and Ssex=‘女’
–7-以Class降序查询Student表的所有记录。
select * from Student order by Class desc
–8 以Cno升序、Degree降序查询Score表的所有记录。
select * from Score order by Cno asc,Degree desc
–9查询“”班的学生人数。
select COUNT(*)from Student where Class=‘95031’
–10查询Score表中的最高分的学生学号和课程号。
select sno,cno from Score where Degree=(select max(Degree) from Score )
–11查询每门课的平均成绩
select avg(degree),cno from Score GROUP BY Cno
–12查询‘-105’号课程的平均分
select AVG(degree),cno from Score where cno=‘3-105’\t group by Cno \t\t\t\t\t\t\t\t\t\t
–13查询Score表中至少有名学生选修的并以开头的课程的平均分数
select AVG(degree)from Score where Cno like ‘3%’group by Cno having COUNT(Sno)>5
–13查询分数大于.小于的Sno列
select degree from Score where degree between 70and