欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    数据库原理与应用(何玉洁-梁琦编著)第五章课后习题答案(共8页).doc

    • 资源ID:8855743       资源大小:29.50KB        全文页数:8页
    • 资源格式: DOC        下载积分:20金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要20金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    数据库原理与应用(何玉洁-梁琦编著)第五章课后习题答案(共8页).doc

    精选优质文档-倾情为你奉上1. SELECT *FROM SC2. SELECT Sname, SageFROM StudentWHERE (Sdept = '计算机系')3. SELECT Sno, Cno, GradeFROM SCWHERE (Grade BETWEEN 70 AND 80)4. SELECT Sname, SageFROM StudentWHERE (Sdept = '计算机系') AND (Ssex = '男')5. SELECT MAX(Grade) AS c01最高成绩FROM SCWHERE (Cno = 'c01')6. SELECT MAX(Sage) AS 最大年龄, MIN(Sage) AS 最小年龄FROM StudentWHERE (Sdept = '计算机系')7. SELECT Sdept, COUNT(*) AS 学生人数FROM StudentGROUP BY Sdept8. SELECT Cno, COUNT(*) AS 选课人数, MAX(Grade) AS 最高分FROM SCGROUP BY Cno9. SELECT Sno, COUNT(*) AS 选课门数, SUM(Grade) AS 总成绩FROM SCGROUP BY SnoORDER BY COUNT(*)10. SELECT Sno, SUM(Grade) AS 总成绩FROM SCGROUP BY SnoHAVING (SUM(Grade) > 200)11. SELECT Sname, SdeptFROM StudentWHERE (Sno IN (SELECT sno FROM sc WHERE cno = 'c02')12. SELECT s.Sname, SC.Cno, SC.GradeFROM Student s INNER JOIN SC ON s.Sno = SC.SnoWHERE (SC.Grade > 80)ORDER BY SC.Grade DESC13. SELECT Sno, Sname, SdeptFROM StudentWHERE (NOT EXISTS (SELECT * FROM sc WHERE sc.sno = student.sno)或者 SELECT Sno, Sname, SdeptFROM StudentWHERE (Sno NOT IN (SELECT sno FROM sc)14. SELECT Cname, SemesterFROM CourseWHERE (Semester = (SELECT semester FROM course WHERE cname = 'VB')或者 SELECT c2.Cname, c2.SemesterFROM Course c1 INNER JOIN Course c2 ON c1.Semester = c2.SemesterWHERE (c1.Cname = 'VB')15. SELECT s2.Sname, s2.Sdept, s2.SageFROM Student s1 INNER JOIN Student s2 ON s1.Sage = s2.SageWHERE (s1.Sname = '李勇') AND (s2.Sname <> '李勇')或者 SELECT Sname, Sdept, SageFROM StudentWHERE (Sage = (SELECT sage FROM student WHERE sname = '李勇') AND (Sname <> '李勇')16. SELECT TOP 2 WITH TIES Sname, SageFROM StudentWHERE (Sdept = '计算机系')ORDER BY Sage17. SELECT Student.Sname, Student.Sdept, SC.GradeFROM Student INNER JOIN SC ON Student.Sno = SC.SnoWHERE (SC.Grade IN (SELECT TOP 2 WITH ties grade FROM sc WHERE cno = (SELECT cno FROM course WHERE cname = 'VB') ORDER BY grade DESC)或者 SELECT TOP 2 WITH TIES Student.Sname, Student.Sdept, SC.GradeFROM Student INNER JOIN SC ON Student.Sno = SC.Sno INNER JOIN Course ON SC.Cno = Course.CnoWHERE (Course.Cname = 'VB')ORDER BY SC.Grade DESC18. SELECT TOP 2 WITH TIES Sno, COUNT(*) AS 选课门数FROM SCGROUP BY SnoORDER BY COUNT(*) DESC19. SELECT TOP 1 WITH TIES Sdept, COUNT(*) AS 学生人数FROM StudentGROUP BY SdeptORDER BY COUNT(*) DESC20. (1)SELECT Sname, SdeptFROM StudentWHERE (Sno IN (SELECT sno FROM sc WHERE cno = 'c01')(2) SELECT Student.Sno, Student.Sname, SC.Cno, SC.GradeFROM Student INNER JOIN SC ON Student.Sno = SC.SnoWHERE (Student.Sno IN (SELECT sno FROM sc WHERE grade > 80 AND sno IN (SELECT sno FROM student WHERE sdept = '数学系')(3)SELECT Student.SnameFROM Student INNER JOIN SC ON Student.Sno = SC.SnoWHERE (SC.Grade = (SELECT MAX(grade) FROM sc WHERE sno IN (SELECT sno FROM student WHERE sdept = '计算机系')(4)SELECT Student.Sname, Student.Sdept, SC.Cno, SC.GradeFROM Student INNER JOIN SC ON Student.Sno = SC.SnoWHERE (SC.Grade = (SELECT MAX(grade) FROM sc WHERE cno = (SELECT cno FROM course WHERE cname = '数据结构')21. SELECT Sname, SdeptFROM StudentWHERE (Sno NOT IN (SELECT sno FROM sc WHERE cno = (SELECT cno FROM course WHERE cname = 'VB')22. SELECT Sname, SsexFROM StudentWHERE (Sno NOT IN (SELECT sno FROM sc) AND (Sdept = '计算机系')或者SELECT Sname, SsexFROM StudentWHERE (NOT EXISTS (SELECT * FROM sc WHERE sno = student.sno) AND (Sdept = '计算机系')23. SELECT Student.Sname, Course.CnameFROM Student INNER JOIN SC ON Student.Sno = SC.Sno INNER JOIN Course ON SC.Cno = Course.CnoWHERE (Student.Sno = (SELECT TOP 1 WITH ties sno FROM sc GROUP BY sno HAVING sc.sno IN (SELECT student.sno FROM student WHERE sdept = '计算机系') ORDER BY AVG(grade) ASC)24. SELECT Cname, Semester, CreditFROM CourseWHERE (Cno IN (SELECT TOP 1 WITH ties cno FROM sc GROUP BY cno ORDER BY COUNT(*) ASC) AND (Semester BETWEEN 1 AND 5)25. (1)INSERT INTO test_t (COL2)VALUES ('B1') (2)INSERT INTO test_t (COL1, COL2, COL3)VALUES (1, 'B2', 'C2') (3)INSERT INTO test_t (COL1, COL2)VALUES (2, 'B3')26. DELETE FROM SCWHERE (Grade < 50)27. DELETE FROM CourseWHERE (Cno NOT IN (SELECT cno FROM sc) 或者 DELETE FROM CourseWHERE (NOT EXISTS (SELECT * FROM sc WHERE cno = o)28. DELETE FROM SCWHERE (Grade < 60) AND (Sno IN (SELECT sno FROM student WHERE sdept = '计算机系') AND (Cno IN (SELECT cno FROM course WHERE cname = 'VB')29. DELETE FROM SCWHERE (Grade = (SELECT MIN(grade) FROM sc WHERE cno = (SELECT cno FROM course WHERE cname = 'VB')30. UPDATE CourseSET Credit = Credit + 2WHERE (Semester = 2)31. UPDATE CourseSET Credit = 3WHERE (Cname = 'VB')32. UPDATE StudentSET Sage = Sage + 1WHERE (Sdept = '计算机系')33. UPDATE SCSET Grade = Grade + 5WHERE (Sno IN (SELECT sno FROM student WHERE sdept = '信息系') AND (Cno IN (SELECT cno FROM course WHERE cname = '计算机文化学')34. UPDATE CourseSET Credit = Credit - 1WHERE (Cno = (SELECT TOP 1 o FROM sc GROUP BY cno ORDER BY COUNT(*)专心-专注-专业

    注意事项

    本文(数据库原理与应用(何玉洁-梁琦编著)第五章课后习题答案(共8页).doc)为本站会员(飞****2)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开