sql实验报告9完整版.docVIP

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  4. 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  5. 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  6. 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  7. 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
闽 南 师 范 大 学 实 验 报 告 班 级 学号 姓名 成绩 同组人 实验日期 课程名称:MS SQL程序设计 实验题目:T-SQL语句的高级应用 实验目的与要求 掌握多表连接查询、子查询、游标、大对象类型数据的基本概念。 掌握多表连接的各种方法,包括内连接、外连接、交叉连接等。 掌握子查询的方法,包括相关子查询和不相关子查询。 掌握游标处理结果集的基本过程。 实验环境的配置 PC 兼容机。第 1 页Window xp 以上操作系统,SQL Server 2005数据库管理系统 第 1 页 实验内容与具体步骤 闽 南 师 大 实 验 报 告 闽 南 师 大 实 验 报 告 查询所有班级的期末成绩平均分,并按照平均分降序排序。 select classno,AVG(final) as 平均分 from student join score on student.studentno=score.studentno group by classno order by AVG(final) desc 查询教师的基本信息和教授课程信息,其中包括未分配课程的教师信息。 select teacher.*,cname from teacher left join teach_class on teacher.teacherno=teach_class.teacherno left join course on teach_class.courseno=course.courseno 查询‘090501’班级中选修了‘韩晋升’老师讲授的课程的学生的学号、姓名、课程名和期末成绩。 select student.studentno,sname,cname,final from student join score on student.studentno=score.studentno join course on course.courseno=score.courseno where score.courseno in ( select courseno from teach_class join teacher on teach_class.teacherno=teacher.teacherno where tname=韩晋升 ) and classno=090501 查询每门课程的课程号、课程名和选修该课程的学生人数,并按所选人数升序排序。 select course.courseno,cname,COUNT(studentno) from score join course on score.courseno=course.courseno group by course.courseno,cname order by COUNT(studentno) desc 查询两门及以上课程的期末成绩超过80分的学生的姓名及其平均成绩。 select sname,AVG(final) from score join student on score.studentno=student.studentno where final=80 group by student.studentno,sname having COUNT(courseno)=2 查询入学考试成绩最高的学生的学号、姓名和入学成绩。(子查询) select studentno, sname, point from student where studentno=(select top 1 studentno from student order by point) 查询所有教授’c05127’号课程的教师信息。 select teacher.teacherno,tname,major,prof,department from teacher join teach_class on teacher.teacherno=teach_class.teacherno where courseno=c05127 查询同时教授’c05127’和’c05109’课程的教师信息。 select teacher.teacherno,tname,major,prof,department from teacher join teach_class on teacher.teacherno=teach_class.teacherno where courseno=c05127 and teacher.teacherno in (select teacherno

文档评论(0)

方圆 + 关注
实名认证
文档贡献者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档