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. sql 存储过程返回值 变量名

    return 语句返回值,前台调用的参数名称为 @RETURN_VALUE

  2. linux下实时查看log

    1.先切换到:cd usr/local/tomcat5/logs2.tail -f catalina.out3.这样运行时就可以实时查看运行日志了 Ctrl+c 是退出tail命令. 顺便讲一下lin ...

  3. U3D 场景切换时 脚本对象,GO对象,资源对象的问题

    脚本对象:在LUA中写了一个actor类,它封装了角色逻辑,引用了一个GO. GO对象:通过 GameObject.Instantiate(资源对象)生成的. 资源对象:制作好的模型prefab. 在 ...

  4. HDFS NameNode HA 部署文档

    简介: HDFS High Availability Using the Quorum Journal Manager Hadoop 2.x 中,HDFS 组件有三个角色:NameNode.DataN ...

  5. node.js和npm离线安装

    离线安装node.js和npm 1.下载官方安装包并拷贝到离线机器上. 官方下载地址:https://nodejs.org/en/download/ 2.解压文件: tar-xJf node-v8.9 ...

  6. Go Flow Control

    [Go Flow Control] 1.for没有(),必须有{}. 2.for的前后表达式可以为空. 3.没有while,for即是while. 4.无穷循环. 5.if没有(),必须有{}. 6. ...

  7. unity5-GI是什么?

    GI是什么? GI =直接光照+间接光照+环境光+反射光.直接光照先不用说了,间接光照是光线在物体上反射所带来的光照. 核心参数: 每个光源上的Bounce Intensity.环境光可以直接理解为你 ...

  8. leetcode 13 Roman to Integer 罗马数组转整型

    描述: 将一个字符串表示的罗马数字转为整数,范围0~3999 解决: 如果后一个比前一个大,则表示减,没什么技巧. map<}, {}, {}, {}, {}, {}, {}}; int rom ...

  9. Qt's Undo Framework

    Overview of Qt's Undo Framework Introduction Qt's Undo Framework is an implementation of the Command ...

  10. 怎样在Windows与Centos下的Linux间共享文件,如果mnt文件夹不显示,可能是mnt缺少共享支持

    mnt中的hgfs文件夹就是Linux系统中挂载共享文件的默认文件夹.有的人按步骤共享之后mnt中没有出现共享的文件,可能是因为你的mnt缺少共享支持. 此时可以在Terminal中输入:sudo m ...