- 查询成绩在90分及其以上的选课信息
- 查询职称为教授的教师的教师号、姓名和专业
- 查询专业是计算机和数学的学生信息
- 查询年龄在30-40(包括30和40)岁的教师的教师号、姓名和职称
- 查询课时不在30-40(包括30和40)课时的课程的课程号、课程名和课时
- 查询课程号为c4和c6的选课信息,包括学号、课程号和成绩。
- 查询年龄大于20的学生的学号、姓名和年龄, 结果列名为汉字
- 查询选修了课程的学生学号
- 查询不是计算机系或信息系学生
- 查询姓名长度至少是三个汉字且第三个汉字必须是“马”的学生
- 查询姓名中含有“然”的学生信息
- 查询选修't3'老师,成绩在80至90之间学生的信息
- 查询没有成绩的学生的学号和课程号
- 查询学号为s1的学生的课程的平均分
- 查询选课表sc中选课学生人数
- 查询选课表sc中每个学生的选课信息及每个学生的选课门数
- 查询选课表sc中选了1门以上课程的学生的选课信息及学生的选课门数(不包括1门)
- 查询学号为s1的学生的选课信息,按照成绩降序排序
- 查询从第三位学生开始的4位学生的信息
- 查询选课表sc中每门课程的课程号及选课人数,按照选课人数降序排列,并且显示前5行
select * from course;
select sno from student;
select * from sc
where score>=90;
select tno,tname,maj
where prof='教授';
select * from student
where maj='计算机' or maj='数学';
select tno,tname,prof from teacher
where age>=30 and age<=40;
select tno,tname,prof from teacher
where age<30 or age>40;
select sno,cno,score from sc
where (cno='c4' or cno='c6');
select sno 学号,sname 姓名,age 年龄 from student
where age>20;
select sno from sc
where score is null;
select * from student
where maj not in ('计算机','信息');
select sname from student
where sname like '__马%'
select * from student
where sname like '%然%';
select * from sc
where tno='t3' and (score>=80 and score<=90);
select sno,cno from sc
where score is null;
select avg(score) from sc
where sno='s1';
select count(distinct sno) from sc;
select sno,count(score) from sc
group by sno;
select sno,count(score) from sc
group by sno
having count(score)>1;
select * from sc
where sno='s1'
order by score desc;
select * from student
limit 2,4;
select cno,count(*) from sc
group by cno
order by count(*) DESC
limit 5;