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 two DELETE statements are valid? (Choose two.)
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 (SELECT * FROM order_items i,orders o
WHERE i.order_id = o.order id AND order_status IN (0,1));
D) 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));
B选项首先排除,没有见过这个语法
经过敲lab。。。 C选项提示错误。
参考错误提示如下
答案是AD选项。测试也是可以正常删掉数据