61、(18-6) choose the best answer:

View the Exhibit and examine the structure of the CUSTOMERS table.

You want to generate a report showing the last names and credit limits of all customers whose last names start with A, B, or C, and credit limit is below 10,000.

Evaluate the following two queries:

SQL> SELECT cust_last_name, cust_credit_limit FROM customers

WHERE (UPPER(cust_last_name) LIKE 'A%' OR

UPPER(cust_last_name) LIKE 'B%' OR

UPPER(cust_last_name) LIKE 'C%')

AND cust_credit_limit < 10000;

SQL> SELECT cust_last_name, cust_credit_limit FROM customers

WHERE UPPER(cust_last_name) BETWEEN 'A' AND 'C'

AND cust_credit_limit < 10000;

Which statement is true regarding the execution of the above queries?

A) Only the second query gives the correct result.

B) Only the first query gives the correct result.

C) Both execute successfully but do not give the required result.

D) Both execute successfully and give the same result.

Answer:B

(解析:验证结果发现第二 sql 语句不能返回 C 开头的名字,如果改为 BETWEEN 'A' AND 'D',则查出来的结果与第一个语句一样,而且语句简洁,答案更好。

经过测试发现,如果数据类型是 number 的,则 between 800 and 3000 的结果包含 3000 的值:

SQL> select sal from emp where sal between 800 and 3000;

SAL

---------

800

1600)

1500

950

3000

但是如果是字符型的,则不包含between 'A' AND 'C'后面的 C :

SQL> select ename from emp where ename between 'A' AND 'C';

ENAME

----------

ALLEN

BLAKE

)

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

  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. 【12c OCP】最新CUUG OCP-071考试题库(52题)

    52.(12-11) choose the best answer: Examine the structure and data in the PRICE_LIST table: You plan ...

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

    ------------------------------------------------------- 51.(12-10)choose the best answer: Evaluate t ...

随机推荐

  1. MySQL函数及用法示例

    (一) 1.字符串函数ascii(str)    返回字符串str的第一个字符的ascii值(str是空串时返回0)   mysql> select ascii('2');   -> 50 ...

  2. LUA表的引用理解

    --lua中引用类型都是分配在堆上的 --因此,我们在使用LUA的table时,可尽可能的使用表的引用,而不需要拷贝表里的元素 --比如,通过RPC协议传来一个表A,我们想要缓存这个表,只需要保存该表 ...

  3. 安装labelImg

    上篇文章,我提到了安装这个工具时,遇到pyqt与sip版本不匹配的未解决问题,最后是通过windows版本一键实现的,工具包见下面链接. 参考:http://blog.csdn.net/jesse_m ...

  4. Unity5.x Reflection Probe反射探针

    http://blog.csdn.net/yupu56/article/details/53487216

  5. mybatis使用foreach进行批量插入和删除操作

    一.批量插入 1.mapper层 int insertBatchRoleUser(@Param("lists") List<RoleUser> lists);//@Pa ...

  6. Python MySQLdb连接报2003错误原因

    经测试,本地连接使用:localhost会报2003错误. 解决办法: 使用:127.0.0.1代替:localhost.

  7. Windows c++面向对象与可视化编程的基础知识

    1.Windows的程序设计语言:Visual C++,Visual Basic ,Visual c#都是“面向对象”的程序设计语言; 2.Windows的程序设计的对象:是Windows的规范部件, ...

  8. Java 连接 Hive的样例程序及解析

    以后编程基于这个样例可节省查阅API的时间. private static String driverName = "org.apache.hadoop.hive.jdbc.HiveDriv ...

  9. gitweb配置

    基于ssh的git服务器搭建可浏览:https://www.cnblogs.com/wswind/p/10373881.html 安装gitweb和apache yum -y install gitw ...

  10. 修复PlatformToolsets丢失问题(为VS2013以上版本安装VC90,VC100编译器)

    前段时间测试VS2017的IDE时不小心弄丢了 MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets 下的VC90以及VC100的编译 ...