ITPub博客

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

047-252

原创 Linux操作系统 作者:jbymy2000 时间:2012-03-19 14:20:13 0 删除 编辑
252. View the Exhibit and examine the structure of ORDER_ITEMS and ORDERS
tables.You need to remove from the ORDER_ITEMS table those rows that have
an order status of 0 or 1 in the ORDERS table.
Which DELETE statements are valid? (Choose all that apply.)
A. DELETE FROM order_items
WHERE order_id IN (SELECT order_id
FROM orders WHERE order_status in (0,1));
B. DELETE * FROM order_items
WHERE order_id IN (SELECT order_id
FROM orders WHERE order_status IN (0,1));
C. DELETE FROM order_items i
WHERE order_id = (SELECT order_id FROM orders o
WHERE i.order_id = o.order_id AND order_status IN (0,1));
D. DELETE FROM (SELECT * FROM order_items i,orders o
WHERE i.order_id = o.order_id AND order_status IN (0,1));
Answer: ACD
实验证明D是错误的
SQL> DELETE FROM (SELECT * FROM order_items i,orders o
WHERE i.order_id = o.order_id AND order_status IN (0,1));
WHERE i.order_id = o.order_id AND order_status IN (0,1))
ORA-00918: 未明确定义列
SQL> DELETE FROM (SELECT * FROM order_items i,orders o
WHERE i.order_id = o.order_id AND o.order_status IN (0,1));
DELETE FROM (SELECT * FROM order_items i,orders o
ORA-01752: 不能从没有一个键值保存表的视图中删除

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

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

注册时间:2012-01-10

  • 博文量
    416
  • 访问量
    204329