付费下载
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、针对书上的学生选课数据库S_T,用关系代数和SQL语言完成以下查询:1、 查询“C6系所有学生的学号和姓名。2、 Slelect sno,sname from student where sdept =' CS3、 查询所有姓“刘”的学生的信息。4、 Select * from student where sname like'刘 5、 查询年龄在18至20岁之间的学生信息。6、 Select * from student where sage between 18 and 207、 查询不在“ C6系也不在“ MA系的学生的所有信息。8、 Select * from stud
2、ent where sdept not in ('CS ,' MA )9、 查询“C6系所有学生的平均年龄。10、 Select avg(sage) from student where sdept like' CS11、 查询课程名是以“系统”结尾的课程信息。12、 Select * from course where cname like '粽统'13、 查询先行课为“ 6”号课程的课程信息。14、 Select * from course where cpno=615、 查询问接先行课为“ 5”号课程的课程号及课程名。16、 Select , fr
3、om c c1,c c2 where = and =517、 Select cno ,cname from course where cpno in (select cno from course where cpno=5)18、 查询没有先行课的课程名。19、 Select cname from course where cpno is null20、 查询选修了 “1”号课程的学生选课信息。21、 Select * from sc where cno=122、 查询成绩为90分以上的学生姓名和课程名。23、 Select sname ,cname from s,c,sc where = a
4、nd = and grade>=9024、 查询被选修了的课程号及课程名。25、 Select cno ,cname from course where cno in (Select distinct(cno ) from sc)26、 Select cno ,cname from course where exists (select * from sc where27、 查询没有选修课程的学生学号及姓名。28、 Select sno,sname from s where sno not in (select distinct(sno) from sc)29、 Select sno ,
5、sname from s where not exists(select * from sc where30、 查询没有选修“1”号课程的学生姓名。31、 Select sname from s where sno not in (select distinct(sno) from sc where cno=1)32、 Select sname from s where not exists (select * from sc where = and =1)33、 查询既选修了 “数据结构”又选修了 “操作系统”的学生姓名。34、 Select sname from ,sc where = a
6、nd = and cname=' 数据结构35、 Select sname from s where sno in (selectsno from sc wherecno=(slect cno from c where cname= 数据结构')and sno in (select sno from sc where cno=(select cno from c where cname= ' 操作系 统)36、 Select snamefrom s where sno in (select sno from sc sc1,sc sc2 where =and =(slec
7、t cno from c where cname= ' 数据结构')and =(select cno from c where cname=' 操作系统')37、 查询既选修了 “ 2”号又选修了 “ 4”号课程的学生学号。38、 Select sno from sc where cno=2 and sno in(select sno from sc where cno=4)39、 Select sno from sc sc1,sc sc2 where = and =2 and =440、 查询选修了 “ 2”号或“ 4”号课程的学生学号。41、 Select
8、sno from sc where cno=2 or cno=442、 查询至少选修了 “ 95002”学生所选课程的学生学号。43、 Select from sc scx where not exists (select * from sc scy where ='95002' and not exists (select * from sc scz where = and =)44、 查询至少选修了一门其间接先行课为“ 7”号课程的学生姓名。45、 Select sname from s where sno in(Select sno from sc where cno i
9、n (Select from c c1,c c1 where = and =7)46、 查询选修了所有课程的学生姓名。47、 Select sname from s where not exists (select * from c where notexists (select * from sc where = and =)48、 查询“李勇”同学所选课程的平均成绩。49、 Select avg(grade) from sc where sno =(Select sno from s where sname二'李勇)50、 查询“操作系统”这门课的最高分及最低分。51、 Selec
10、t max(grade),min(grade) from sc where cno=(select cno from course where cname =' 操作系统')52、 查询“数据结构”这门课的选课人数。53、 Select count(sno) from sc where cno =(select cno from course wherecname=数据 2构)54、 查询“C6系的所有学生的学号、姓名、课程名及成绩。55、 Select sno,sname,cname,grade from s,sc,c where = and = andsdept= '
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 小学主题班会课件:民族团结共筑和谐
- 2026年宁夏固原中小学教师招聘考试题库及答案(教育综合知识完整版)
- 就市场调研数据共享的商洽函(6篇)范文
- 云计算数据中心运营管理与维护指南
- 远离网络沉迷迈向美好未来四年级主题班会课件
- 化学工程与制药工程作业指导书
- 优化项目立项评审流程通知函(3篇范文)
- 感恩父母孝敬长辈家庭美德小学主题班会课件
- 商洽签订长期供货协议函6篇范文
- 项目管理优化提升协作效率方案
- 2026新疆中鑫国贸集团有限公司招聘16人考试参考题库及答案详解
- 2026江苏苏州工业园区部分单位招聘工作人员49人备考题库及参考答案详解一套
- 中南大学2026年强基计划《体育测试+综合面试》试题及答案解析(二)
- 八年级生地会考全真模拟试卷(含参考答案)
- 2026江西日报社(报业传媒集团)社会招聘14人笔试参考试题及答案解析
- 2026年妇产科护理副高模拟真题及答案
- 人教版数学四年级下册期末测试试卷(历年真题)
- 重庆市2026年普通高等学校招生全国统一考试 政治+答案
- 新能源汽车电池回收拆解项目在2025年的技术突破可行性研究报告
- 2025年湖北省从“五方面人员”中选拔乡镇领导班子成员考试历年参考题库含答案详解
- 2023汇川MV21系列低压三相永磁伺服电机技术参数
评论
0/150
提交评论