北京优技教育科技有限公司

Oracle认证 OCP认证 OCM认证

当前位置: 优技教育 >> ocp考试 >

ocp题库解析:11g-1Z0-051-第14题

ocp题库解析:11g-1Z0-051-第14题

来源:优技教育    更新时间:2016/7/27 15:13:53    阅读次数:831

ocp题库解析:11g-1Z0-051-第14题,完整题库请点击这里联系老师咨询了解

14. Using the CUSTOMERS table, you need to generate a report that shows 50% of each credit

amount in each income level. The report should NOT show any repeated credit amounts in each income

level. --each income level中没有重复的credit amounts

Which query would give the required result?

A.

SELECT cust_income_level, DISTINCT cust_credit_limit * 0.50

AS "50% Credit Limit"

FROM customers;

[sql] view plain copy print?

sh@TESTDB> SELECT cust_income_level, DISTINCT cust_credit_limit * 0.50

2 AS "50% Credit Limit"

3 FROM customers;

SELECT cust_income_level, DISTINCT cust_credit_limit * 0.50

*

ERROR at line 1:

ORA-00936: missing expression

语法错误,DISTINCT不应该放在第二列,应该放在第一列中

[sql] view plain copy print?

sh@TESTDB> SELECT DISTINCT cust_income_level,cust_credit_limit * 0.50

2 AS "50% Credit Limit"

3 FROM customers where rownum<6;

CUST_INCOME_LEVEL 50% Credit Limit

------------------------------ ----------------

G: 130,000 - 149,999 5500

G: 130,000 - 149,999 4500

G: 130,000 - 149,999 3500

G: 130,000 - 149,999 750

B.

SELECT DISTINCT cust_income_level, DISTINCT cust_credit_limit * 0.50

AS "50% Credit Limit"

FROM customers;

同A,语法错误,DISTINCT不应该放在第二个

[sql] view plain copy print?

SELECT DISTINCT cust_income_level, DISTINCT cust_credit_limit * 0.50

2 AS "50% Credit Limit"

3 FROM customers;

SELECT DISTINCT cust_income_level, DISTINCT cust_credit_limit * 0.50

*

ERROR at line 1:

ORA-00936: missing expression

C.

SELECT DISTINCT cust_income_level ' ' cust_credit_limit * 0.50

AS "50% Credit Limit"

FROM customers;

[sql] view plain copy print?

sh@TESTDB> SELECT DISTINCT cust_income_level ' ' cust_credit_limit * 0.50

2 AS "50% Credit Limit"

3 FROM customers;

SELECT DISTINCT cust_income_level ' ' cust_credit_limit * 0.50

*

ERROR at line 1:

ORA-00923: FROM keyword not found where expected

这道题愿意为用' '连接两个列,可能用错,应为||来连接,不过DISTINCT的位置 对的

[sql] view plain copy print?

sh@TESTDB> SELECT DISTINCT cust_income_level || cust_credit_limit * 0.50

2 AS "50% Credit Limit"

3 FROM customers where rownum<6;

50% Credit Limit

----------------------------------------------------------------------

G: 130,000 - 149,999750

G: 130,000 - 149,9994500

G: 130,000 - 149,9993500

G: 130,000 - 149,9995500

D.

SELECT cust_income_level ' ' cust_credit_limit * 0.50 AS "50% Credit Limit"

FROM customers

D没有满足NOT show any repeated的条件。

此题答案C

OCA认证
OCP费用
OCP教程
OCP考试
OCM费用
OCM教程
OCM考试
ORACLE授权认证机构CUUG
CUUG与ORACLE合作15年,是ORACLE金牌合作伙伴,连续多年处于行业领先;
CUUG与工信部人才交流中心合作,是工信人才指定的PostgreSQL数据库培训合作伙伴;
CUUG与阿里云、腾讯云、人大金仓、奥星贝斯等众多数据库厂商合作,开设数据库认证与培训课程;
CUUG与企业合作提供人才输送、定制化培训、技术支持服务;

报名入口 点击进入

北京优技教育科技有限公司

联系电话:010-59426307

课程咨询:010-59426319

联系地址:海淀区紫竹院路88号