设为首页 加入收藏

TOP

ocp1Z0-051141-175题解析(六)
2014-11-24 08:04:39 来源: 作者: 【 】 浏览:3
Tags:ocp1Z0-051141-175 解析
SELECTstatement, not in subqueries.

当然提交或者回滚将释放该锁

158. Which statementsare true regarding the FOR UPDATE clause in a SELECT statement (Choose all

that apply.)

A. It locks only thecolumns specified in the SELECT list.

B. It locks the rowsthat satisfy the condition in the SELECT statement.

C. It can be used only inSELECT statements that are based on a single table.

D. It can be used inSELECT statements that are based on a single or multiple tables.

E. After it is enforcedby a SELECT statement, no other query can access the same rows until a

COMMIT or ROLLBACK isissued.

Answer: BD

解析:

同上题

159. View the Exhibitand examine the structure of the CUSTOMERS table.

NEW_CUSTOMERS is a newtable with the columns CUST_ID, CUST_NAME and CUST_CITY that

have the same data typesand size as the corresponding columns in the CUSTOMERS table.

eva luate the followingINSERT statement:

INSERT INTOnew_customers (cust_id, cust_name, cust_city)

VALUES(SELECTcust_id,cust_first_name' 'cust_last_name,cust_city

FROM customers

WHERE cust_id >23004);

The INSERT statementfails when executed. What could be the reason

\

A. The VALUES clausecannot be used in an INSERT with a subquery.

B. Column names in theNEW_CUSTOMERS and CUSTOMERS tables do not match.

C. The WHERE clausecannot be used in a subquery embedded in an INSERT statement.

D. The total number ofcolumns in the NEW_CUSTOMERS table does not match the total number of

columns in the CUSTOMERStable.

Answer: A

解析:

这里不能用子查询的结果插入的到表中

160. View the Exhibitand examine the structure of ORDERS and CUSTOMERS tables.

There is only one customerwith the cust_last_name column having value Roberts. Which INSERT

statement should be usedto add a row into the ORDERS table for the customer whose

CUST_LAST_NAME isRoberts and CREDIT_LIMIT is 600

\

A. INSERT INTO orders

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

(SELECT customer_id

FROM customers

WHEREcust_last_name='Roberts' AND

credit_limit=600),1000);

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

(SELECT customer_id

FROM customers

WHEREcust_last_name='Roberts' AND

credit_limit=600),order_total)

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

C. INSERT INTO(SELECTo.order_id, o.order_date,o.order_mode,c.customer_id, o.order_total

FROM orders o, customersc

WHERE o.customer_id =c.customer_id

ANDc.cust_last_name='Roberts' ANDc.credit_limit=600 )

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

FROM customers

WHEREcust_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);

Answer: A

解析:

A选项中

INSERT INTO orders

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

(SELECTcustomer_id

FROM customers

WHEREcust_last_name='Roberts' AND

credit_limit=600), 1000);

这里将(SELECTcustomer_id

FROM customers

WHEREcust_last_name='Roberts' AND

credit_limit=600)得到的结果作为相应列插入到orders表中

161. View the exhibitand examine the description for the SALES and CHANNELS tables.

You issued the followingSQL statement to insert a row in the SALES table:

INSERT INTO sales VALUES

(23, 2300, SYSDATE,(SELECT channel_id

FROM channels

WHEREchannel_desc='Direct Sales'), 12, 1, 500);

Which statement is trueregarding the execution of the above statement

\

A. The statement wil

首页 上一页 3 4 5 6 7 8 9 下一页 尾页 6/10/10
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇oracle报错 下一篇ORA-01078与LRM-00109报错解决

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·C 内存管理 | 菜鸟教 (2025-12-26 20:20:37)
·如何在 C 语言函数中 (2025-12-26 20:20:34)
·国际音标 [ç] (2025-12-26 20:20:31)
·微服务 Spring Boot (2025-12-26 18:20:10)
·如何调整 Redis 内存 (2025-12-26 18:20:07)