文档详情

Oracle课件04 子查询.ppt

发布:2018-07-18约1.69万字共30页下载文档
文本预览下载声明
Oracle 数据库培训 (四) 高级查询 子查询 课程目标 完成本课后,您将具有如下技能: 描述子查询可以解决的问题的类型 定义子查询 列出子查询类型 写出单行,多行,多列子查询 子查询 “哪个职员的工资大于Jones?” ” 子查询 子查询在主查询执行之前执行一次.得到结果 子查询的结果被主查询所使用 子查询 子查询 子查询的编写规则 将子查询放在括号中. 将子查询放在比较运算符右边 子查询中不要使用 ORDER BY 子句. 单行子查询使用单行操作符. 多行子查询使用多行操作符. 子查询 单行子查询 子查询 单行子查询只返回一个值 使用比较运算符 子查询 子查询 子查询 例:单行子查询 子查询 子查询 子查询 多行子查询返回多个值 使用多行比较运算符 子查询 子查询 多列子查询 多列子查询 显示与在部门号为30的职员的佣金和工资都相等的所有职员的名字,部门号,工资,和佣金. 多列子查询 多列子查询 显示与在部门号为30的职员的佣金和工资相等的所有职员的名字,部门号,工资,和佣金. 多列子查询 子查询 子查询 子查询 总结 总结 多列子查询返回多个列. 多列子查询可以在FROM子句中使用. 课后练习 子查询 Thanks Thanks Practice Overview This is the first of many practices. The solutions (if you require them) can be found in Appendix A. Practices are intended to introduce all topics covered in the lesson. Questions 2-4 are paper-based. In any practice, there may be “if you have time”or “if you want extra challenge” questions. Do these only if you have completed all other questions within the allocated time and would like a further challenge to your skills. Take the practice slowly and precisely. You can experiment with saving and running command files. If you have any questions at any time, attract the instructor’s attention. Paper-Based Questions For questions 2-4 circle either True or False. Practice Overview This is the first of many practices. The solutions (if you require them) can be found in Appendix A. Practices are intended to introduce all topics covered in the lesson. Questions 2-4 are paper-based. In any practice, there may be “if you have time”or “if you want extra challenge” questions. Do these only if you have completed all other questions within the allocated time and would like a further challenge to your skills. Take the practice slowly and precisely. You can experiment with saving and running command files. If you have any questions at any time, attract the instructor’s attention. Paper-Based Questions For questions 2-4 circle either True or False. Summary In this lesson, you have learned about restricting and sorting rows returned by the
显示全部
相似文档