48、(10-12)choose the best answer

View the Exhibit and examine the description for the PRODUCTS and SALES table.

PROD_ID is a primary key in the PRODUCTS table and foreign key in the SALES table with ON DELETE CASCADE option. The SALES table contains data for the last three years. You want to remove all the rows from the PRODUCTS table for which no sale was done for the last three years.

Which is the valid DELETE statement?

A) DELETE

FROM products

WHERE prod id IN (SELECT prod_id

FROM sales

where time_id >= SYSDATE - 3*365 );

B) DELETE

FROM products

WHERE prod_id = (SELECT prod_id

FROM sales

WHERE time_id - 3*365 = SYSDATE );

C) DELETE

FROM products

WHERE prod_id = (SELECT prod_id

FROM sales

WHERE SYSDATE >= time_id - 3*365 );

D) DELETE

FROM products

WHERE prod_id IN (SELECT prod_id

FROM sales

where SYSDATE - 3*365 >= time_id);

Answer:A

(解析:time_id >= SYSDATE - 3*365 最近三年的时间

SYSDATE - 3*365 >= time_id 三年以前的时间

原来 051 的题

)

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

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

    72.View the exhibit for the structure of the STUDENTand FACULTYtables. STUDENT Name Null? Type ----- ...

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

    71.(32-18) choose three Which three statements indicate the end of a transaction? (Choose three.) A) ...

  3. 【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 B ...

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

    69.(31-1)choose the best answer: Evaluate the following query: SELECT INTERVAL '300' MONTH, INTERVAL ...

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

    68.(29-13)choose two: Which two statements are true? (Choose two.) A) DICTIONARY is a view that cont ...

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

    67.(25-8)choose the best answer: View the Exhibit and examine the structure of CUSTOMERS table. Eval ...

  7. 【OCP题库】最新CUUG OCP 12c 071考试题库(66题)

    66.(22-19)choose two Examine the structure proposed for the TRANSACTIONS table: Which two statements ...

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

    65.(22-16) choose the best answer: The CUSTOMERS table has the following structure: You need to writ ...

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

    52.(12-11) choose the best answer: Examine the structure and data in the PRICE_LIST table: You plan ...

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

    ------------------------------------------------------- 51.(12-10)choose the best answer: Evaluate t ...

随机推荐

  1. Java API token定时刷新

    主要用到了调度线程池: ScheduleExecutorService, 一个循环方法scheduleWithFixedDelay(方法执行完之后计算下一次开始执行时间) 使用 TokenManage ...

  2. Maven(一) Maven3 的安装与配置

    Maven的安装以及环境变量的配置: a).在安装maven之前,先确保已经安装JDK1.7及以上版本,并且配置好JDK的环境变量. b).下载maven3,下载地址:http://maven.apa ...

  3. hive中修改序列化格式分隔符

    标签: hadoophivealtertable 2014-11-19 10:45 4219人阅读 评论(0) 收藏 举报  分类: hadoop(6)  版权声明:本文为博主原创文章,未经博主允许不 ...

  4. BloomFilter

    [BloomFilter] 错误率估计.最优哗哈希函数个数.位数组的大小 尚未细看.以看补上. 参考:http://blog.csdn.net/jiaomeng/article/details/149 ...

  5. MYSQL 存储过程通用

    返回随机时间 函数 )) ) CHARSET utf8 BEGIN )); -- 随机天数 60天以内随机天数 )); -- 随机小时 ));-- 随机分 ));-- 随机秒 ); IF type = ...

  6. etl业务说明图

  7. android安装前期遇到的问题

    1.安装的eclipse与对应的java版本位数要一致,要么32位,要么64位. 2.关于新版ADT创建项目时出现appcompat_v7的问题 更新ADT至22.6.0版本之后,创建新的安装项目,会 ...

  8. 点击panel滚动条滚动到底部

    $('#accordion').on('shown.bs.collapse', function () { var container = $(".admin-user .mx-scroll ...

  9. python进行数据清理之pandas中的drop用法

    好久好久没有更新博客了,之前自学的估计也都忘记差不多了.由于毕业选择从事的行业与自己的兴趣爱好完全两条路,心情也难过了很久,既然入职了就要好好干,仍要保持自己的兴趣,利用业余时间重拾之前的乐趣. 从基 ...

  10. access建立sql查询语句运行查询语句

    1.打开一个Access数据库文件 2.点击“创建”标签中的“查询设计”,会弹出一个“显示表”的对话框,点击“关闭”将其关闭 3.这时会有一个名为“查询*”的窗口,还不能输入SQL语句 4.点击左上角 ...