设为首页 加入收藏

TOP

ocp 1Z0-051 71-105题解析(三)
2014-11-24 00:37:21 来源: 作者: 【 】 浏览:63
Tags:ocp 1Z0-051 71-105 解析
he century from the SYSDATE function and does not

allow the user to enterthe century.

D. The RR date formatautomatically calculates the century from the SYSDATE function but allows the

user to enter thecentury if required.

Answer: AD

解析:

Oracle内部存储的时间为数值格式

The RR datetime formatelement is similar to the YY datetime format element, but it

provides additionalflexibility for storing date values in other centuries. The RR

datetime format elementlets you store 20th century dates in the 21st century by

specifying only the lasttwo digits of the year.

81. You are currentlylocated in Singapore and have connected to a remote database in Chicago.

You issue the followingcommand:

SQL> SELECTROUND(SYSDATE-promo_begin_date,0)

FROM promotions

WHERE(SYSDATE-promo_begin_date)/365 > 2;

PROMOTIONS is the publicsynonym for the public database link for the PROMOTIONS table.

What is the outcome

A. a n error because theROUND function specified is invalid

B. a n error because theWHERE condition specified is invalid

C. n umber of days sincethe promo started based on the current Chicago date and time

D. number of days sincethe promo started based on the current Singapore date and time

Answer: C

解析:

当然是基于chicago的时间,因为sysdate也是获取chicago当前的时间

82. Examine the data inthe CUST_NAME column of the CUSTOMERS table.

CUST_NAME

Renske Ladwig

Jason Mallin

Samuel McCain

Allan MCEwen

Irene Mikkilineni

Julia Nayer

You need to displaycustomers' second names where the second name starts with "Mc" or"MC."

Which query gives therequired output

A. SELECTSUBSTR(cust_name, INSTR(cust_name,' ')+1)

FROM customers

WHEREINITCAP(SUBSTR(cust_name, INSTR(cust_name,' ')+1))='Mc';

B. SELECTSUBSTR(cust_name, INSTR(cust_name,' ')+1)

FROM customers

WHEREINITCAP(SUBSTR(cust_name, INSTR(cust_name,' ')+1)) LIKE 'Mc%';

C. SELECTSUBSTR(cust_name, INSTR(cust_name,' ')+1)

FROM customers

WHERE SUBSTR(cust_name,INSTR(cust_name,' ')+1) LIKE INITCAP('MC%');

D. SELECTSUBSTR(cust_name, INSTR(cust_name,' ')+1)

FROM customers

WHEREINITCAP(SUBSTR(cust_name, INSTR(cust_name,' ')+1)) = INITCAP('MC%');

Answer: B

解析:

INITCAP(SUBSTR(cust_name, INSTR(cust_name,' ')+1))

INSTR(cust_name,' ') 返回空字符串的位置

SUBSTR(cust_name,INSTR(cust_name,' ')+1)

截取空字符串后面的字符

INITCAP将每个单词的第一个字母大写,其他字母小写

83. Examine the data inthe CUST_NAME column of the CUSTOMERS table.

CUST_NAME

Lex De Haan

Renske Ladwig

Jose Manuel Urman

Jason Mallin

You want to extract onlythose customer names that have three names and display the * symbol in place

of the first name asfollows:

CUST NAME

*** De Haan

**** Manuel Urman

Which two queries givethe required output (Choose two.)

A. SELECTLPAD(SUBSTR(cust_name,INSTR(cust_name,' ')),LENGTH(cust_name),'*') "CUSTNAME"

FROM customers

WHERE INSTR(cust_name, '',1,2)<>0;

B. SELECTLPAD(SUBSTR(cust_name,INSTR(cust_name,' ')),LENGTH(cust_name),'*') "CUSTNAME"

FROM customers

WHERE INSTR(cust_name, '',-1,2)<>0;

C. SELECTLPAD(SUBSTR(cust_name,INSTR(cust_name,' ')),LENGTH(cust_name)-

INSTR(cust_name,''),'*') "CUST NAME"

FROM customers

WHERE INSTR(cust_name, '',-1,-2)<>0;

D. SELECTLPAD(SUBSTR(cust_name,INSTR(cust_name,' ')),LENGTH(cust_name)-

INSTR(cust_name,''),'*') "CUST NAME"

FROM customers

WHERE INSTR(cust_name, '',1,2)<>0 ;

Answer: AB

解析:

以Lex De Haan为例:

LPAD(SUBSTR(cust_name,INSTR(cust_name,'')),LENGTH(cust_name),'*')

,INSTR(cust_nam

首页 上一页 1 2 3 4 5 6 7 下一页 尾页 3/10/10
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇UNION和UNION ALL两者之间在性能.. 下一篇在Contos下安装tomcat6.0.29

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: