46、(10-4) 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 了,要用正数)

【ocp-12c】最新Oracle OCP-071考试题库(46题)的更多相关文章

  1. 【OCP题库-12c】最新CUUG OCP 071考试题库(72题)

    72.View the exhibit for the structure of the STUDENTand FACULTYtables. STUDENT Name Null? Type ----- ...

  2. 【OCP题库-12c】最新CUUG OCP 071考试题库(71题)

    71.(32-18) choose three Which three statements indicate the end of a transaction? (Choose three.) A) ...

  3. 【OCP题库-12c】最新CUUG OCP 071考试题库(70题)

    70.(31-2)choose the best answer: View the Exhibit and examine the structure of the Book table. The B ...

  4. 【OCP题库-12c】最新CUUG OCP 071考试题库(69题)

    69.(31-1)choose the best answer: Evaluate the following query: SELECT INTERVAL '300' MONTH, INTERVAL ...

  5. 【OCP题库】最新CUUG OCP 12c 071考试题库(68题)

    68.(29-13)choose two: Which two statements are true? (Choose two.) A) DICTIONARY is a view that cont ...

  6. 【OCP题库】最新CUUG OCP 12c 071考试题库(67题)

    67.(25-8)choose the best answer: View the Exhibit and examine the structure of CUSTOMERS table. Eval ...

  7. 【OCP题库】最新CUUG OCP 12c 071考试题库(66题)

    66.(22-19)choose two Examine the structure proposed for the TRANSACTIONS table: Which two statements ...

  8. 【OCP题库】最新CUUG OCP 12c 071考试题库(65题)

    65.(22-16) choose the best answer: The CUSTOMERS table has the following structure: You need to writ ...

  9. OCP 12c最新考试题库及答案(071-2)

    2019-02-12 16:23:54   2.(4-7) choose the best answer:You need to display the first names of all cust ...

  10. 【OCP-12c】2019年CUUG OCP 071考试题库(80题)

    80.View the exhibit and examine the structure in ORDERS and ORDER_ITEMS tables. You need to create a ...

随机推荐

  1. 可视化库-Matplotlib-盒图(第四天)

    盒图由五个数值点组成,最小观测值,下四分位数,中位数,上四分位数,最大观测值 IQR = Q3 - Q1  Q3表示上四分位数, Q1表示下四分位数,IQR表示盒图的长度 最小观测值 min =Q1 ...

  2. MathExamLv2——周世元211606348,许燕婷211606338

    结对编程 211606348 周世元 211606338 许燕婷 一.预估与实际 PSP2.1 Personal Software Process Stages 预估耗时(分钟) 实际耗时(分钟) P ...

  3. php导出数组到csv格式demo

    php的二维数组导出到csv需要处理文字编码,代码如下 <?php $data=array( array("username"=>"test1",& ...

  4. go 算法

    题目: 请实现一个算法,确定一个字符串的所有字符[是否全都不同].这里我们要求[不允许使用额外的存储结构].给定一个string,请返回一个bool值,true代表所有字符全都不同,false代表存在 ...

  5. 无法启动Tomcat, 端口被占用的问题

    这个错误是说这几个端口已经有某个应用程序占用了,所以Tomcat就没法启动了.   出现这个问题的原因可能有以下几种: 情况一:点击运行的时候没有选中页面或Servlet窗口的标签 标签被选中时: 标 ...

  6. fbx模型动画提取教程附带一个用代码提取的方法

    角色已经人形化(Humanoid)了,那它的动画可以用在其它的模型上了也就是可以共用一套模型动画了但是你有没有发现那动画是和fbx模型绑在一起的,没关系你可以选中这几个动画文件按Contrl+D就可以 ...

  7. SQLServer性能优化之---水平分库扩展

      汇总篇:http://www.cnblogs.com/dunitian/p/4822808.html#tsql 第一次引入文件组的概念:http://www.cnblogs.com/dunitia ...

  8. 10 Examples of HotSpot JVM Options in Java[z]

    There are hundreds of JVM parameters or JVM Options exists inside sun JDK and its virtually impossib ...

  9. PhpStorm (强大的PHP开发环境)2017.3.2 附注册方法

    最新版PhpStorm 2017正式版改进了PHP 7支持,改进代码完成功能. PhpStorm 是最好的PHP开发工具,使用它进行PHP开发将会让你感觉到编程的乐趣. 快乐无极终于从oschina看 ...

  10. 一篇很好的关于mysqld_safe脚本源码解读的文章,收藏了!!

    #!/bin/sh # 一些状态变量的定义 KILL_MYSQLD=; # 试图kill多余的mysqld_safe程序,1表示需要kill MYSQLD= # mysqld二进制可执行文件的名称 n ...