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. Spring Boot实践——Spring Boot 2.0 新特性和发展方向

    出自:https://mp.weixin.qq.com/s/EWmuzsgHueHcSB0WH-3AQw 以Java 8 为基准 Spring Boot 2.0 要求Java 版本必须8以上, Jav ...

  2. Git---时光穿梭机之版本回退02

    现在你的本地仓库底下添加一个readme.txt文件 第一次readme.txt的内容如下:: Git is a version control systemGit is free sofwore 然 ...

  3. 【324】Python 库说明(安装&卸载)

    参考:Python_安装官方whl包和tar.gz包 参考:Unofficial Windows Binaries for Python Extension Packages 参考:PyPI 参考:直 ...

  4. 迷你MVVM框架 avalonjs 学习教程7、数据缓存

    jQuery的许多功能都可以通过avalon的绑定属性来处理,如click方法对应ms-click,css方法对应ms-css,toggle方法对应ms-visible,它的数据缓存功能avalon也 ...

  5. Redis AOF文件

    [Redis AOF文件] 1.关于AOF AOF 持久化记录服务器执行的所有写操作命令,并在服务器启动时,通过重新执行这些命令来还原数据集. AOF 文件中的命令全部以 Redis 协议的格式来保存 ...

  6. 使用ES(elasticsearch) 搜索引擎

    介绍  https://blog.csdn.net/andyzhaojianhui/article/details/75195296 创建语句 { "company":{ &quo ...

  7. NoClassDefFoundError: net/sf/ezmorph/Morpher

    使用import net.sf.json.JSONObject; json-lib-2.4-jdk15.jar时报这个错,各种查找,受到https://blog.csdn.net/chenleixin ...

  8. DALSA网口线扫相机SDK开发详解例程(C#版)

    首先吐槽一句,官方的demos写的真的不好,坑爹啊.对于小白来说,开发官方demos为我所用太难了.为什么呢?因为它Dalsa的DALSA.SaperaLT.SapClassBasic.dll中,不仅 ...

  9. CodeForces 518A Vitaly and Strings (水题,字符串)

    题意:给定两个相同长度的字符串,让你找出一个字符串,字典序在两都之间. 析:这个题当时WA了好多次,后来才发现是这么水,我们只要把 s 串加上,然后和算数一样,该进位进位,然后再和 t 比较就行. 代 ...

  10. tp5主从数据库设置读写分离

    // 数据库类型 'type' => 'mysql', // 服务器地址 'hostname' => '192.168.0.5,192.168.0.6', // 数据库名 'databas ...