




下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、闽 南 师 范 大 学实 验 报 告班 级 学号 姓名 成绩 同组人 实验日期 课程名称:MS SQL程序设计实验题目:T-SQL语句的高级应用实验目的与要求1. 掌握多表连接查询、子查询、游标、大对象类型数据的基本概念。2. 掌握多表连接的各种方法,包括内连接、外连接、交叉连接等。3. 掌握子查询的方法,包括相关子查询和不相关子查询。4. 掌握游标处理结果集的基本过程。实验环境的配置PC 兼容机。第 1 页Window xp 以上操作系统,SQL Server 2005数据库管理系统实验内容与具体步骤闽 南 师 大 实 验 报 告1. 查询所有班级的期末成绩平均分,并按照平均分降序排序。se
2、lect classno,AVG(final) as 平均分 from student join score on student.studentno=score.studentnogroup by classnoorder by AVG(final) desc2. 查询教师的基本信息和教授课程信息,其中包括未分配课程的教师信息。select teacher.*,cname from teacher left join teach_class on teacher.teacherno=teach_class.teachernoleft join course on teach_class.co
3、urseno=course.courseno3. 查询090501班级中选修了韩晋升老师讲授的课程的学生的学号、姓名、课程名和期末成绩。select student.studentno,sname,cname,final from student join score on student.studentno=score.studentnojoin course on course.courseno=score.coursenowhere score.courseno in(select courseno from teach_class join teacher onteach_class.
4、teacherno=teacher.teachernowhere tname=韩晋升) and classno=0905014. 查询每门课程的课程号、课程名和选修该课程的学生人数,并按所选人数升序排序。select course.courseno,cname,COUNT(studentno) from score join course on score.courseno=course.coursenogroup by course.courseno,cnameorder by COUNT(studentno) desc 5. 查询两门及以上课程的期末成绩超过80分的学生的姓名及其平均成绩。
5、select sname,AVG(final) from score join student on score.studentno=student.studentnowhere final=80group by student.studentno,snamehaving COUNT(courseno)=26. 查询入学考试成绩最高的学生的学号、姓名和入学成绩。(子查询)select studentno, sname, point from student where studentno=(select top 1 studentno from student order by point)7
6、. 查询所有教授c05127号课程的教师信息。select teacher.teacherno,tname,major,prof,department from teacher join teach_class on teacher.teacherno=teach_class.teachernowhere courseno=c051278. 查询同时教授c05127和c05109课程的教师信息。select teacher.teacherno,tname,major,prof,department from teacher join teach_classon teacher.teachern
7、o=teach_class.teachernowhere courseno=c05127 and teacher.teacherno in(select teacherno from teach_class where courseno=c05109)9. 查询至少选修了姓名为韩吟秋的学生所选修课程中一门课程的学生的学号和姓名。select distinct student.studentno,snamefrom score join student on score.studentno=student.studentno where courseno in(select courseno from score join student on score.studentno=student.stu
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 作文宁波的巨变教学课件
- 2020-2025年二级建造师之二建建设工程施工管理题库综合试卷A卷附答案
- 2025年铜陵市郊区事业单位公开招聘笔试(含加分)笔试历年典型考题及考点剖析附带答案详解
- 电位分析法饮用水中pH值测定57课件
- 彩云追月教学课件
- 第六章反应器第一节概述94课件
- 2025年全年检验科三基三严考试试题及答案
- 小学生科普知识课件
- 口罩与呼吸健康课件图片
- 企业等级评定管理办法
- 干燥综合征的护理
- 劳动仲裁申请书电子版模板
- 电力工程企业的绩效考核与激励体系设计
- 姜黄素项目投资可行性研究报告
- 2025年云南省康旅控股集团有限公司招聘笔试参考题库含答案解析
- 八年级数学下册 第二学期 期末综合测试卷(湘教版 2025年春)(二)
- 集团内训师管理办法
- 2025年客房服务员(高级)客房服务员职业技能培训题库
- 医院防暴伤医培训
- 办公楼电气系统改造方案
- 征地拆迁工作整改措施
评论
0/150
提交评论