SQL课堂大作业(答案).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文档。上传文档
查看更多
SQL课堂大作业(答案)

SQL查询语言练习题目: 请你首先建立下面的四张表: Student表 NO NAME SEX BIRTHDAY CLASS 108 曾华 男 09/01/77 95033 105 匡明 男 10/02/75 95031 107 王丽 女 01/23/76 95033 101 李军 男 02/20/76 95033 109 王芳 女 02/10/75 95031 103 陆军 男 06/03/74 95031 Teacher表 NO NAME SEX BIRTHDAY PROF DEPART 804 李城 男 12/02/58 副教授 计算机系 856 张旭 男 03/12/69 讲师 电子工程系 825 王萍 女 05/05/72 助教 计算机系 831 刘冰 女 08/14/77 助教 电子工程系 Course表 CNO CNAME TNO 3-105 计算机导论 825 3-245 操作系统 804 6-166 数字电路 856 9-888 高等数学 100 Score表 NO CNO DEGREE 103 3-245 84 105 3-245 67 109 3-245 98 103 3-105 78 105 3-105 91 109 3-105 68 101 3-105 93 107 3-105 72 108 3-105 66 101 6-166 80 107 6-166 77 108 6-166 62 查询student表所记录的name,sex,class列 select sname,ssex,class from student 显示教师工作的单位(不许重复) select distinct depart from teacher 以汉字属性显示student表所有记录 select sno 学号,sname 姓名,ssex 性别,sbirthday 出生日期,class 班级 from student 查询成绩在60到80之间的同学姓名 select sname from student,score where student.sno=score.sno and degree between 60 and 80 查询成绩为80,85,或88的记录 select * from score where degree in (80,85,88) 查询‘95031’班或者性别为‘女’的同学记录 select * from student where class=95031 or ssex=女 以“班级”降序显示student中的记录 select * from student order by class desc 以cno升序、degree降序显示score中的记录 select * from score order by cno ,degree desc 显示‘95031’班中的学生人数 select count(*) from student where class=95031 显示score表中分数最高的学生的学号和课程号 select top 1 sno,cno from score order by degree desc select sno,cno from score where degree= (select max(degree) from score) 显示‘3-105’号课程的平均分数 select avg(degree) from score where cno=3-105 显示至少有5名学生选修的并以‘3’开头的课程号的平均分数 select cno,avg(degree) from score where cno like 3% group by cno having count(sno)=5 显示最低分数大于70,最高分数低于90的no列 select distinct sno from score as s1 where 70 (select min(degree) from score as s2 where s1.sno=s2.sno) and 90 (select max(degree) from score as s3 where s1.sno=s3.sno) 查询学生的姓名、所学的课程号以及该课程的成绩 select sname,cno,degree from student,score where student.sno=score.sno 查询95033班所选课程的平均分数 select avg(degree) from student,score where student.sno=score

文档评论(0)

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

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

1亿VIP精品文档

相关文档