1查询年级为的所有学生的姓名

2022-07-12 13:46:13   第一文档网     [ 字体: ] [ 阅读: ] [ 文档下载 ]
说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。下载word有问题请添加QQ:admin处理,感谢您的支持与谅解。点击这里给我发消息

#第一文档网# 导语】以下是®第一文档网的小编为您整理的《1查询年级为的所有学生的姓名》,欢迎阅读!
姓名,年级,所有,学生,查询

/*1查询年级为的所有学生的姓名,按学号升序排列*/ select sname from students where grade='2010' order by sid asc

/*2查询课时数是或的课程的名称*/ select cname from courses

where hour='36'or hour='72'

--3查询所有学生的学号和平均成绩,按平均成绩降序排列 select sid,avg(score) from choices group by sid

order by avg(score) desc

--4查询至少选修了三门课程的学生的学号 select sid from choices group by sid having count(*)>2

--5查询学号为“”的学生所选的某个课程的学生学号(自身连接) select second.sid

from choices as first,choices as second

where first.cid=second.cid and first.sid='201001'

--6查询学号为“”的学生同年级的所有学生资料 select* from students where grade in (select grade from students where sid='200902')

--7查询所有的有选课的学生的详细信息 select *

from choices,students,courses

where students.sid=choices.sid and choices.cid=courses.cid --8找出选修课程成绩最差的选课记录(<=all或者聚集函数) select * from choices where score<=all

--9利用集合运算,查询选修了数据库或信息系统的学生的学号 select sid


from student

10利用集合运算,查询即选修了课程又选修了课程的学生学号。


本文来源:https://www.dywdw.cn/3a18142dcc1755270622080a.html

相关推荐
推荐阅读