Oracle OCP认证-Oracle OCM认证

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

ocp 11g考题大全:1Z0-051-082题

来源:优技教育

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

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

CUST_NAME

Renske Ladwig

Jason Mallin

Samuel McCain

Allan MCEwen

Irene Mikkilineni

Julia Nayer

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

Which query gives the required output?

A. SELECT SUBSTR(cust_name, INSTR(cust_name,' ')+1)

FROM customers

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

B. SELECT SUBSTR(cust_name, INSTR(cust_name,' ')+1)

FROM customers

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

C. SELECT SUBSTR(cust_name, INSTR(cust_name,' ')+1)

FROM customers

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

D. SELECT SUBSTR(cust_name, INSTR(cust_name,' ')+1)

FROM customers

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

Answer: B

试题解析:

题意要求:You need to display customers' second names where the second name starts with "Mc" or "MC."

cust_name由first name和second name组成,中间有空格,要求找出second name以"Mc" or "MC."开头

INSTR(cust_name,' ')找出空格的位置,并返回,这个位置之后的second name的开始。

SUBSTR(cust_name, INSTR(cust_name,' ')+1)找出空格+1的之后的字符,即是找出second name的名字。

INITCAP(SUBSTR(cust_name, INSTR(cust_name,' ')+1)) LIKE 'Mc%' 匹配出 LIKE 'Mc%'or "MC“的字符,使用INITCAP,让其匹配。

故答案选B

精华阅读