19.choose the best answer

View the Exhibit and examine the structure of the PROMOTIONS table.

Evaluate the following SQL statement:

SQL>SELECT promo_name,CASE

WHEN promo_cost>=(SELECT AVG(promo_cost)

FROM promotions

WHERE promo_category= 'TV')

THEN 'HIGH'

ELSE 'LOW'

END COST_REMARK

FROM promotions;

Which statement is true regarding the outcome of the above query?

A) It shows COST_REMARK for all the promos in the promo category 'TV' .

B) It produces an error because subqueries cannot be used with the CASE expression.

C) It shows COST_REMARK for all the promos in the table.

D) It produces an error because the subquery gives an error.

Answer:C

(解析:category 'TV'只是判定 promo_cost 的一个条件,显示的是所有 category 的内容。

使用如下语句验证:

SELECT promo_name,promo_category,CASE

WHEN promo_cost>=(SELECT AVG(promo_cost)

FROM promotions

WHERE promo_category= 'TV')

THEN 'HIGH'

ELSE 'LOW'

END COST_REMARK

FROM promotions

where rownum < 30;

)

【ocp-12c】最新Oracle OCP-071考试题库(37题)的更多相关文章

  1. 【OCP题库-12c】最新CUUG OCP 071考试题库(72题)

    72.View the exhibit for the structure of the STUDENTand FACULTYtables. STUDENT Name Null? Type ----- ...

  2. 【OCP题库-12c】最新CUUG OCP 071考试题库(71题)

    71.(32-18) choose three Which three statements indicate the end of a transaction? (Choose three.) A) ...

  3. 【OCP题库-12c】最新CUUG OCP 071考试题库(70题)

    70.(31-2)choose the best answer: View the Exhibit and examine the structure of the Book table. The B ...

  4. 【OCP题库-12c】最新CUUG OCP 071考试题库(69题)

    69.(31-1)choose the best answer: Evaluate the following query: SELECT INTERVAL '300' MONTH, INTERVAL ...

  5. 【OCP题库】最新CUUG OCP 12c 071考试题库(68题)

    68.(29-13)choose two: Which two statements are true? (Choose two.) A) DICTIONARY is a view that cont ...

  6. 【OCP题库】最新CUUG OCP 12c 071考试题库(67题)

    67.(25-8)choose the best answer: View the Exhibit and examine the structure of CUSTOMERS table. Eval ...

  7. 【OCP题库】最新CUUG OCP 12c 071考试题库(66题)

    66.(22-19)choose two Examine the structure proposed for the TRANSACTIONS table: Which two statements ...

  8. 【OCP题库】最新CUUG OCP 12c 071考试题库(65题)

    65.(22-16) choose the best answer: The CUSTOMERS table has the following structure: You need to writ ...

  9. OCP 12c最新考试题库及答案(071-2)

    2019-02-12 16:23:54   2.(4-7) choose the best answer:You need to display the first names of all cust ...

  10. 【OCP-12c】2019年CUUG OCP 071考试题库(80题)

    80.View the exhibit and examine the structure in ORDERS and ORDER_ITEMS tables. You need to create a ...

随机推荐

  1. eclipse liquibase 插件

    http://marketplace.eclipse.org/category/free-tagging/liquibase http://marketplace.eclipse.org/market ...

  2. 迷你MVVM框架 avalonjs 0.96发布

    本版本主要是性能优化与 fix BUG,改进如下: 处理notifySubscribers中的BUG,它在标准浏览器不会移除那些无用的视图刷新函数.详见这里 重构modelBindling.SELEC ...

  3. 前端开发之jQuery效果篇

    主要内容: 1.显示与隐藏效果 2.滑动效果 3.淡入与淡出效果 4.动画效果 5.弹出广告效果 一.显示与隐藏 显示与隐藏即 show() 和 hide() ,能够控制元素显示或隐藏. 实例: &l ...

  4. redis客户端执行命令没反应

    问题:redis-cli连接客户端后,执行命令没有反应   解决方法:通过指定一个开启守护进程的配置文件来启动服务,redis-server ../redis.conf 说明:redis.conf是我 ...

  5. Python_01-入门基础

    以后我会发表一系列python脚本的学习资料,python版本为2.x. 目录: 1 Python入门基础 1.1 学习资源 1.2 所有语言的入门程序---Hello World!  1.3 帮助函 ...

  6. 大楼轮廓 · building-outline

    [抄题]: 水平面上有 N 座大楼,每座大楼都是矩阵的形状,可以用一个三元组表示 (start, end, height),分别代表其在x轴上的起点,终点和高度.大楼之间从远处看可能会重叠,求出 N  ...

  7. cmake get_filename_component

    get_filename_component Get a specific component of a full filename. get_filename_component(<VAR&g ...

  8. How to setup Laravel Homestead in Windows

    How to setup Laravel Homestead in Windows by JBorbón  17. March 2017   PHP   8 Developing with PHP u ...

  9. 有些标签的class有多个值,用空格隔开的,是什么意思阿?

    这个div同时应用了三个class.三个class的设置都会对它起作用,相互冲突时,越后面的class优先权越高.

  10. Spring boot——logback.xml 配置详解(四)<filter>

    阅读目录 1 filter的使用 2 常用的过滤器 文章转载自:http://aub.iteye.com/blog/1101260,在此对作者的辛苦表示感谢! 回到顶部 1 filter的使用 < ...