当前位置: Oracle DBA培训网-优技培训 >> 071题库 >

【071题库】最新OCP-071考试题库解析-第46题

【071题库】最新OCP-071考试题库解析-第46题

071考试是OCP考试科目的一种,由于071考题多变,我们专门收集整理了最新的考试题库,并对这些考题进行讲解,希望可以帮助广大考生。

每周五晚8点,我们有免费的OCP解析公开课,地址:https://ke.qq.com/course/326223  OCP题库交流群:1015267481,验证ocp

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

071题库-第46题、choose two:

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

CUST_NAME

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

Lex De Haan

Renske Ladwig

Jose Manuel Urman

Jason Mallin

You want to extract only those customer names that have three names and display the * symbol in

place of the first name as follows:

CUST_NAME

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

*** De Haan

**** Manuel Urman

Which two queries give the required output?

A) SELECT LPAD(SUBSTR(cust_name,INSTR(cust_name,' ')),LENGTH(cust_name),'*') "CUST NAME" FROM customers

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

B) SELECT LPAD(SUBSTR(cust_name,INSTR(cust_name,' ')),LENGTH(cust_name)- INSTR(cust_name,' '),'*') "CUST NAME"

FROM customers

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

C) SELECT LPAD(SUBSTR(cust_name,INSTR(cust_name,' ')),LENGTH(cust_name),'*') "CUST NAME"

FROM customers

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

D) SELECT LPAD(SUBSTR(cust_name,INSTR(cust_name,' ')),LENGTH(cust_name)- INSTR(cust_name,' '),'*') "CUST NAME"

FROM customers

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

Answer:AC

(解析:题意是:您希望只提取具有三个名称的那些客户名称,并显示*符号来代替名称如下注意条件的用法 INSTR(cust_name, ' ',1,2)<>00,意思是从名字中找空格,从第一个开始,查看第二个空格的位置,如果有,说明名字里面就有三个名称,否则只有两个名称。同时INSTR(cust_name, ' ',-1,-2),从倒数第一个空格开始,不能再用-2 了,要用正数)

技术沙龙MORE+

标签错误:<!-- #Label# labelId=20160707140604 moduleId=1 classId=12231768634 orderby=2 fields=url,title,u_info attribute= datatypeId=22192428132 recordCount=3 pageSize= <htmlTemplate><dt><img src="/images/index_26${index}.jpg" width="100" height="62" /><a href="$url" title="${title}">${title}</a><span>${api.left(u_info,60)}</span></dt></htmlTemplate> -->
我要参加技术沙龙