设为首页 加入收藏

TOP

ocp1Z0-051141-175题解析(八)
2014-11-24 08:04:39 来源: 作者: 【 】 浏览:10
Tags:ocp1Z0-051141-175 解析
f the customerwith the CUST_ID 2560 and the CUST_CREDIT_LIMIT to have the same value as

that of the customerwith CUST_ID 2566.

Which UPDATE statementwill accomplish the task

\

A. UPDATE customers

SET cust_income_level =(SELECT cust_income_level

FROM customers

WHERE cust_id = 2560),

cust_credit_limit =(SELECT cust_credit_limit

FROM customers

WHERE cust_id = 2566)

WHERE cust_id=2360;

B. UPDATE customers

SET(cust_income_level,cust_credit_limit) = (SELECT

cust_income_level,cust_credit_limit

FROM customers

WHERE cust_id=2560 ORcust_id=2566)

WHERE cust_id=2360;

C. UPDATE customers

SET(cust_income_level,cust_credit_limit) = (SELECT

cust_income_level,cust_credit_limit

FROM customers

WHERE cust_id IN(2560,2566)

WHERE cust_id=2360;

D. UPDATE customers

SET(cust_income_level,cust_credit_limit) = (SELECT

cust_income_level,cust_credit_limit

FROM customers

WHERE cust_id=2560 ANDcust_id=2566)

WHERE cust_id=2360;

Answer: A

解析:

题意:You want theva lue for the CUST_INCOME_LEVEL to have the same value as

that of the customerwith the CUST_ID 2560 and the CUST_CREDIT_LIMIT to have the same value as

that of the customerwith CUST_ID 2566.

意思是要更新的CUST_INCOME_LEVEL要和CUST_ID 2560的CUST_INCOME_LEVEL一样

更新的CUST_CREDIT_LIMIT要和CUST_ID 2566的CUST_CREDIT_LIMIT一样

所以需要两个子查询将CUST_ID 2560的CUST_INCOME_LEVEL和CUST_ID 2566的CUST_CREDIT_LIMIT查询出来再设置为对应值

166. View the Exhibitand examine the structures of the EMPLOYEES and DEPARTMENTS tables.

You want to update theEMPLOYEES table as follows:4 4;

-Update only thoseemployees who work in Boston or Seattle (locations 2900 and 2700).

-Set department_id forthese employees to the department_id corresponding to London (location_id

2100).

-Set the employees'salary in location_id 2100 to 1.1 times the average salary of their department.

-Set the employees'commission in location_id 2100 to 1.5 times the average commission of their

department.

You issue the followingcommand:

SQL>UPDATE employees

SET department_id =

(SELECT department_id

FROM departments

WHERE location_id =2100),

(salary, commission) =

(SELECT 1.1*AVG(salary),1.5*AVG(commission)

FROM employees,departments

WHEREdepartments.location_id IN(2900,2700,2100))

WHERE department_id IN

(SELECT department_id

FROM departments

WHERE location_id = 2900

OR location_id = 2700)

What is the outcome

\

A. It executessuccessfully and gives the correct result.

B. It executessuccessfully but does not give the correct result.

C. It generates an errorbecause a subquery cannot have a join condition in an UPDATE statement.

D. It generates an errorbecause multiple columns (SALARY, COMMISION) cannot be specified together

in an UPDATE statement.

Answer: B

解析:

无语法错误

WHEREdepartments.location_id IN(2900,2700,2100)

条件给错,WHEREdepartments.location_id=2100

167. eva luate thefollowing DELETE statement:

DELETE FROM sales;

There are no otheruncommitted transactions on the SALES table.

Which statement is trueabout the DELETE statement

A. It would not removethe rows if the table has a primary key.

B. It removes all therows as well as the structure of the table.

C. It removes all therows in the table and deleted rows can be rolled back.

D. It removes all therows in the table and deleted rows cannot be rolled back.

Answer: C

解析:

含有主键的列一样可以删除

Delete 操作不会删除表结构

Delete操作可以回滚

168. View the Exhibitand examine the description of SALES and PROMOTIONS tables.

Y

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

评论

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

·Python 数据分析与可 (2025-12-26 21:51:20)
·从零开始学Python之 (2025-12-26 21:51:17)
·超长干货:Python实 (2025-12-26 21:51:14)
·为什么 Java 社区至 (2025-12-26 21:19:10)
·Java多线程阻塞队列 (2025-12-26 21:19:07)