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. Dubbo Overview

    Overview Architecture Provider: 暴露服务的服务提供方. Consumer: 调用远程服务的服务消费方. Registry: 服务注册与发现的注册中心. Monitor: ...

  2. org.json库下的json的基本使用

    public class Users { private String username; private String password; public String getUsername() { ...

  3. AUC,KS,ROC

    要弄明白ks值和auc值的关系首先要弄懂roc曲线和ks曲线是怎么画出来的.其实从某个角度上来讲ROC曲线和KS曲线是一回事,只是横纵坐标的取法不同而已.拿逻辑回归举例,模型训练完成之后每个样本都会得 ...

  4. rook 删不掉的问题

    # kubectl get crd -o yamlapiVersion: v1items:- apiVersion: apiextensions.k8s.io/v1beta1  kind: Custo ...

  5. python's output redirect

    [python's output redirect] fin = open("xx.txt", 'r'); print >>fin, "hello world ...

  6. C和C++中的不定参数

    在初学C的时候,我们都会用到printf函数来写Hello World的程序.在我们看printf函数的声明时,会看到类似于下面代码 int printf(const char * __restric ...

  7. 查找yum 安装目录

    [root@DB-Server ~]# rpm -qa | grep -i mysql MySQL-server-advanced-5.6.20-1.rhel5 MySQL-client-advanc ...

  8. [原创]分享本人自己PY写的BOOST编译程序(源码)

    本程序WINDOWS专用,只做抛砖引玉,希望诸位按照各自需求自行修改,主要目的是为了让诸位编译时可以省一些组合指令的时间,只需要修改几个参数即可自动编译. 支持64位编译模式. 改进版本:http:/ ...

  9. nslookup域名查询命令查询ip

    一.nslookup(name server lookup ) nslookup可以指定查询的类型,可以查到DNS记录的生存时间还可以指定使用哪个DNS服务器进行解释.在已安装TCP/IP协议的电脑上 ...

  10. 超详细JSON解析步骤

    JSON简介 JAVAScript Object Notation是一种轻量级的数据交换格式 具有良好的可读和便于快速编写的特性. 业内主流技术为其提供了完整的解决方案(有点类似于正则表达式 ,获得了 ...