ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

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

2019-03-06 10:55:37  阅读:284  来源: 互联网

标签:CUUG 12c last cust credit limit 3000 OCP name


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

)

标签:CUUG,12c,last,cust,credit,limit,3000,OCP,name
来源: https://blog.51cto.com/13854012/2358804

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有