OCP-1Z0-052-V8.02-179题

179. The TRANS_SUMMARY table contains product-wise transaction details that get updated with every

transaction in the system. Each row has cumulative transaction details of a single product and every

product is identified by a product code, which is the primary key. 

As part of the archival process, the company wants to transfer the rows in the TRANS_SUMMARY table

to the TRANS_SUMMARY_DUP table at the end of every quarter of the year. Along with existing products,

the company deals with many new products during every quarter. 

Which method is best suited for this quarterly data transfer?

A.using the MERGE command

B.using the SQL*Loader utility

C.using the correlated UPDATE command

D.using the INSERT command to perform bulk operation

Answer: A  

答案解析:

参考:http://blog.csdn.net/rlhua/article/details/12652569

TRANS_SUMMARY表包含 product-wise事务的细节,以至于每次事务操作时都会在系统中更新。每个单品的每一行都有累积的事务细节,每一个产品代码标志着每一个产品,产品代码为主键。

作为归档进程的一部分,公司希望在今年每个季度结束时把在TRANS_SUMMARY的这些行转移到TRANS_SUMMARY_DUP表中,公司在每季度都会处理很多新产品,连同已经存在产品一起处理。


使用MERGE命令可在一个命令中执行UPDATE 和INSERT 。可将一个源中的数据合并到另一个源,因而可选择插入新行和更新特定列(如果行已经存在)。
这道题的意思是将TRANS_SUMMARY里的数据合并到TRANS_SUMMARY_DUP表里,如果TRANS_SUMMARY_DUP有存在的产品,则保留,如果是新产品,则插入。

原文地址:https://www.cnblogs.com/hzcya1995/p/13316662.html