ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 047-123

047-123

原创 Linux操作系统 作者:jbymy2000 时间:2012-03-19 09:42:54 0 删除 编辑
123. View the Exhibit and examine the structure of the ORDERS and ORDER_ITEMS
tables.In the ORDERS table, ORDER_ID is the PRIMARY KEY and ORDER_DATE has
the DEFAULT value as SYSDATE.Evaluate the following statement:
UPDATE orders SET order_date=DEFAULT
WHERE order_id IN (SELECT order_id FROM order_items WHERE qty IS NULL);
What would be the outcome of the above statement?
A. The UPDATE statement would not work because the main query and the subquery
use different tables.
B. The UPDATE statement would not work because the DEFAULT value can be used
only in INSERT statements.
C. The UPDATE statement would change all ORDER_DATE values to SYSDATE
provided the current ORDER_DATE is NOT NULL and QTY is NULL.
D. The UPDATE statement would change all the ORDER_DATE values to SYSDATE
irrespective of what the current ORDER_DATE value is for all orders where
QTY is NULL.
Answer: D
Irrespective:不考虑
SQL> create table tt(a date default sysdate);
SQL> insert into tt values(sysdate);
SQL> insert into tt values(to_date('2004-05-07 13:23:44','yyyy-mm-dd
hh24:mi:ss'));
SQL> update tt set a=default;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11312660/viewspace-718936/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 047-122
下一篇: 047-124
请登录后发表评论 登录
全部评论

注册时间:2012-01-10

  • 博文量
    416
  • 访问量
    205813