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

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

)

原文地址:https://blog.51cto.com/13854012/2358804

时间: 2024-10-20 12:02:48

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

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

65.(22-16) choose the best answer: The CUSTOMERS table has the following structure: You need to write a query that does the following tasks: Display the first name and tax amount of the customers. Tax is 5% of their credit limit. Only those customers

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

67.(25-8)choose the best answer: View the Exhibit and examine the structure of CUSTOMERS table. Evaluate the following query: SQL>SELECT cust_id, cust_city FROM customers WHERE cust_firstname NOT LIKE 'A%g_%' AND cust_credit_limit BETWEEN 5000 AND 15

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

68.(29-13)choose two: Which two statements are true? (Choose two.) A) DICTIONARY is a view that contains the names of all the data dictionary views that the user can access. B) The user SYSTEM owns all the base tables and user-accessible views of the

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

69.(31-1)choose the best answer: Evaluate the following query: SELECT INTERVAL '300' MONTH, INTERVAL '54-2' YEAR TO MONTH, INTERVAL '11:12:10.1234567' HOUR TO SECOND FROM dual; What is the correct output of the above query? A) +25-00 , +00-650, +00 1

【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 BOOKS table contains details of 100 books. Examine the commands executed and their outcome: SQL>INSERT INTO books VALUES ('ADV112', 'Adventures of Tom

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

71.(32-18) choose three Which three statements indicate the end of a transaction? (Choose three.) A) after a CREATE statement is issued B) after a SELECT statement is issued C) after a ROLLBACK is issued D) after a SAVEPOINT is issued E) after a COMM

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

72.View the exhibit for the structure of the STUDENTand FACULTYtables. STUDENT Name Null? Type STUDENT_ID NOT NULL NUMBER(2) STUDENT_NAME VARCHAR2(20) FACULTY_ID VARCHAR2(2) LOCATION_ID NUMBER(2) FACULTY Name Null? Type FACULTY_ID NOT NULL NUMBER(2)

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

49.(11-1) choose the best answer Examine the structure of the SHIPMENTS table: You want to generate a report that displays the PO_ID and the penalty amount to be paid(罚款数额) if the SHIPMENT_DATE is later than one month from the PO_DATE. The penalty is

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

50.(11-15)choose two Examine the structure of the MARKS table: Which two statements would execute successfully? A) SELECT SUM(subjectl+subject2+subject3) FROM marks WHERE student_name IS NULL; B) SELECT SUM(DISTINCT NVL(subject1,0)), MAX(subjectl) FR

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

------------------------------------------------------- 51.(12-10)choose the best answer: Evaluate the following SQL statement: SQL> SELECT cust_id, cust_last_name FROM customers WHERE cust_credit_limit IN (select cust_credit_limit FROM customers WHE