071-新增2

  1. View the Exhibit and examine the description for the PRODOCTS 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=(SELECT prod id FROM sales WHERE time_ id - 3365=SYSDATE);
    B) DELETE FROM products WHERE prod_ id=(SELECT prod id FROM sales WHERE SYSDATE>= time_ id - 3
    365);
    C) DELETE FROM products WHERE prod_ id IN (SELECT prod id FROM sales WHERE SYSDATE - 3*365 >= time_ id);
    D) DELETE FROM products WHERE prod_id IN (SELECT prod_ id FROM sales WHERE time. id >=SYSDATE - 3*365);

  2. View the Exhibit and examine the data n the PRODUCT_INFORMATION TABLE. Which two tasks would require subqueries? (Chose two.)
    A) displaying the minimum list price for each product status.
    B) displaying all supplier IDs whose average list price is more than 500
    C) displaying the number of products whose list prices are more than the average list price
    D) displaying all the products whose minimum list prices are more than the average list price of products having the product status orderable

    E) displaying the total number of products supplied by supplier 102071 and having product status OBSOLETE
    询问使用子查询的语句

  3. View the Exhibit and examine the structure of the ORDERS table. Which UPDATE statement is valid?
    A) UPDATE orders SET order_ date = ‘12 -mar-2007’, order_ total IS NULL WHERE order_id = 2455;
    B) UPDATE orders SET order_ date = ‘12 -mar-2007’, order_ total = NULL WHERE order_id = 2455;
    C) UPDATE orders SET order_ date = ‘12 -mar-2007’, AND order_ total =TO_NUMBER(NULL) WHERE order_id = 2455;
    D) UPDATE orders SET order_ date = To DATE(‘12-mar-2007’,‘dd-mon-yyyy’), SET order_total = To_ NUMBER(NULL) WHERE order_id = 2455;
    要注意更新的语法,在更新里 NULL 也得遵守使用=

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值