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

Oracle认证 OCP认证 OCM认证

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

ocp 11g考试题库大全:1Z0-051-102题

ocp 11g考试题库大全:1Z0-051-102题

来源:优技教育    更新时间:2016/8/5 14:38:01    阅读次数:908

ocp 11g考试题库大全:1Z0-051-102题,完整题库请点击这里联系老师咨询了解

102. Examine the structure of the TRANSACTIONS table:

name Null Type

TRANS_ID NOT NULL NUMBER(3)

CUST_NAME VARCHAR2(30)

TRANS_DATE TIMESTAMP

TRANS_AMT NUMBER(10,2)

You want to display the date, time, and transaction amount of transactions that where done before 12

noon. The value zero should be displayed for transactions where the transaction amount has not been

entered.

Which query gives the required result?

A. SELECT TO_CHAR(trans_date,'dd-mon-yyyy hh24:mi:ss'),

TO_CHAR(trans_amt,'$99999999D99')

FROM transactions

WHERE TO_NUMBER(TO_DATE(trans_date,'hh24')) < 12 AND COALESCE(trans_amt,NULL)<>NULL;

B. SELECT TO_CHAR(trans_date,'dd-mon-yyyy hh24:mi:ss'),

NVL(TO_CHAR(trans_amt,'$99999999D99'),0)

FROM transactions

WHERE TO_CHAR(trans_date,'hh24') < 12;

C. SELECT TO_CHAR(trans_date,'dd-mon-yyyy hh24:mi:ss'),

COALESCE(TO_NUMBER(trans_amt,'$99999999.99'),0)

FROM transactions

WHERE TO_DATE(trans_date,'hh24') < 12;

D. SELECT TO_DATE (trans_date,'dd-mon-yyyy hh24:mi:ss'),

NVL2(trans_amt,TO_NUMBER(trans_amt,'$99999999.99'), 0)

FROM transactions

WHERE TO_DATE(trans_date,'hh24') < 12;

Answer: B

试题解析:

A,TO_DATE(trans_date,'hh24'),trans_date已经为日期类型,不用再to_date

scott@TESTDB> select to_date(HIREDATE,'yy24') from emp;

select to_date(HIREDATE,'yy24') from emp

*

ERROR at line 1:

ORA-01821: date format not recognized

B,正确,这里0隐式转换为字符型

C,(TO_NUMBER(trans_amt,'$99999999.99'),trans_amt已经是数值型,不用再to_number

D,错误同C一样。

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

报名入口 点击进入

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

联系电话:010-59426307

课程咨询:010-59426319

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