【OCP-12c】2019年CUUG OCP 071考试题库(74题)

74、View the exhibit and examine the structure of ORDERS and CUSTOMERS tables.

ORDERS

Name     Null?       Type

ORDER_ID  NOT NULL  NUMBER(4)

ORDER_DATE  NOT NULL   DATE

ORDER_MODE   VARCHAR2(8)

CUSTOMER_ID NOT NULL  NUMBER(6)

ORDER_TOTAL   NUMBER(8, 2)

CUSTOMERS

Name  Null?  Type

CUSTOMER_ID  NOT NULL  NUMBER(6)

CUST_FIRST_NAME NOT NULL  VARCHAR2(20)

CUST_LAST_NAME  NOT NULL  VARCHAR2(20)

CREDIT_LIMIT  NUMBER(9,2)

CUST_ADDRESS  VARCHAR2(40)

Which INSERT statement should be used to add a row into the ORDERStable for the customer whose CUST_LAST_NAMEis Robertsand CREDIT_LIMITis 600?Assume there exists only one row with CUST_LAST_NAME as Roberts and CREDIT_LIMIT as 600.

A. INSERT INTO (SELECT o.order_id, o.order_date, o.order_mode, c.customer_id, o.order_total

FROM orders o, customers c

WHERE o.customer_id = c.customer_id AND c.cust_last_name=‘Roberts‘ AND c.credit_limit=600)

VALUES (1,‘10-mar-2007‘, ‘direct‘, (SELECT customer_id

FROM customers

WHERE cust_last_name=‘Roberts‘ AND credit_limit=600), 1000);

B. INSERT INTO orders (order_id, order_date, order_mode,

(SELECT customer id FROM customers

WHERE cust_last_name=‘Roberts‘ AND credit_limit=600), order_total);

VALUES (1,‘10-mar-2007‘, ‘direct‘, &customer_id, 1000);

C. INSERT INTO orders

VALUES (1,‘10-mar-2007‘, ‘direct‘,

(SELECT customer_id

FROM customers

WHERE cust_last_name=‘Roberts‘ AND credit_limit=600), 1000);

D. INSERT INTO orders (order_id, order_date, order_mode,

(SELECT customer_id FROM customers

WHERE cust_last_name=‘Roberts‘ AND credit_limit=600), order_total);

VALUES (1,‘10-mar-2007‘, ‘direct‘, &customer_id, 1000);

Correct Answer: C

Section: (none)

Explanation 相关的语句,注意子查询查出来的是某个列的值:

INSERT INTO emp (empno,ename,job,deptno,sal)

VALUES (1,‘cuug‘, ‘direct‘,

(SELECT deptno

FROM dept

WHERE dname=‘RESEARCH‘ ), 1000);

原文地址:https://www.cnblogs.com/cnblogs5359/p/10509748.html

时间: 2024-08-29 00:26:07

【OCP-12c】2019年CUUG OCP 071考试题库(74题)的相关文章

【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)

【OCP-12c】2019年CUUG OCP 071考试题库(73题)

73.Which statement correctly grants a system privilege? A. GRANT CREATE VIEW ON table1 TO user1; B. GRANT ALTER TABLE TO PUBLIC; C. GRANT CREATE TABLE TO user1, user2; D. GRANT CREATE SESSION TO ALL; Correct Answer: C Section: (none) Explanation 解析:无

【OCP-12c】2019年CUUG OCP 071考试题库(75题)

75.Which statements are correct regarding indexes? (Choose all that apply.) A. A non-deferrable PRIMARY KEYor UNIQUE KEYconstraint in a table automatically attempts to creates a unique index. B. Indexes should be created on columns that are frequentl