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. Microsoft Office Professional Plus 2013全套

    Microsoft Office Professional Plus 2013全套产品,全激活版本 包括Access  Word  Excel  Powerpoint  Publisher  Skyd ...

  2. 路由的分发include实现

    在主程序里面的URL.py 中 from django.conf.urls import url, include urlpatterns = [ url(r'^cmdb/', include('ap ...

  3. JSP中内置对象pageContent的使用

    public class TestPageContext { public void getSomething(PageContext page){ ServletRequest request = ...

  4. 前端开发之jQuery位置属性和筛选方法

    主要内容: 1.jQuery的位置属性及实例 (1)位置属性 (2)实例 --- 仿淘宝导航栏 2.jQuery的筛选方法及实例 (1)筛选方法 (2)实例一:嵌套选项卡 (3)实例二:小米官网滑动 ...

  5. 新手C#重载、重写的学习2018.08.04

    重载:在同一类(class)中,使用相同的方法名称,不同的参数和(不一定)不同的返回值类型构造成的方法. 举例: class OverLoadTest { public void Hello() { ...

  6. python's nonlocal

    [python's nonlocal] nonlocal是python3.x中新加的关键字,用于引用本作用域外层作用域的名字 参考:http://blog.csdn.net/chain2012/art ...

  7. 105. Construct Binary Tree from Preorder and Inorder Traversal (Tree; DFS)

    Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that ...

  8. a=a++问题引发的思考

    使用javap命令解析出来的a=a++过程的字节码(int a=1; a=a++): 0: iconst_1  将数值1压入栈顶 1: istore_1  栈顶值1存入局部变量表的第一个slot中 2 ...

  9. Centos 7.2编译安装MariaDB-10.0.xx

    系统: centos7.2 x64数据库:MariaDB-10.0.30 使用jemalloc对MySQL内存进行优化. 软件包下载地址:http://pan.baidu.com/s/1eS44OKU ...

  10. C语言命令行处理

    一.简介 getopt()函数是一个标准库调用,可允许您使用直接的 while/switch 语句方便地逐个处理命令行参数和检测选项(带或不带附加的参数).与其类似的getopt_long()允许在几 ...