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. eclipse Android 开发基础 Activity 窗体 界面

    eclipse Android 开发基础 新建工程 新建布局layout,new Android Activity就相当于窗体Form. 新建Activity自动生成src下同名的java代码. pu ...

  2. 0 1 1 2 3 5 8 13 21 34 求第N个, 用js实现

    function fibo(n) { var f = []; for (var c = 0; c < n; ++c) { console.log(f.join("")) f. ...

  3. Spark报错:Failed to locate the winutils binary in the hadoop binary path

    之前在mac上调试hadoop程序(mac之前配置过hadoop环境)一直都是正常的.因为工作需要,需要在windows上先调试该程序,然后再转到linux下.程序运行的过程中,报 Failed to ...

  4. 代替Reflection(反射)的一些方法(转)

    作者:JustRun 林肯: http://www.cnblogs.com/JustRun1983/p/3830764.html 代替Reflection(反射)的一些方法(转) 2014-07-08 ...

  5. php 共享内存学习(shmop函数)

    问题:希望可以在进程间共享变量,为共享数据提供快速访问 解决方案:除了可以使用APC模块,还可以用shmop或System V共享内存 //创建键 //将一个可访问的文件路径名转换为一个可供 shmo ...

  6. Window Application has "update" key words

    Error Qt Creater:console error:Failed to start program. Path or permissions wrong? Description 在使用Qt ...

  7. 产品设计师 VS UX设计师:你更想成为哪一个?

    随着互联网的快速发展,越来越多的应届毕业生也成为设计师的一员.他们当中的许多人选择UX设计师作为第一份工作,也有一些人选择做一个产品设计师.你是否也想成为设计师呢?这两种设计师你更倾向于哪一个呢?在你 ...

  8. xcconfig

    [xcconfig] 1.When you can use a .xcconfig file? Use .xcconfig files if you find yourself changing th ...

  9. linux安装mysql后root无法登录

    [root@localhost mysql]# mysql -u root -pEnter password: ERROR 1045 (28000): Access denied for user ' ...

  10. gcc中支持的一种字符串表示方式

    gcc支持的一种的字符串的表示形式 "xxx" "xxx" "xxx" 他会将这3个字符串连成一个并 且只会在最后的一个字符串末尾添加 '\ ...