071考試不僅是OCP11g的考試科目,同時也是OCP 12c的考試科目,所以關心071考題的同學有很多,對此我們專門收集整理了近期071考試的原題,并對這些考題進行講解,希望幫助廣大考生順利通過071考試。
--------------------------------------------
071考題解析-第61題、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解析公開課時間:【每周五晚8點】
OCP解析公開課地址:https://ke.qq.com/course/326223
OCP解析群資料分享:1015267481 驗證:ocp
另外,除了OCP公開課,OCM題庫直播也同步進行中,OCM最新題庫大爆料-【每周四晚8點】,【微信群直播】,可以聯系咨詢老師進群參與