215. View the Exhibit and examine the structure of the PRODUCT_INFORMATION
and INVENTORIES tables.You have a requirement from the supplies department
to give a list containing PRODUCT_ID,SUPPLIER_ID, and QUANTITY_ON_HAND for
all the products where in QUANTITY_ON_HAND is less than five.
FROM product_information
FROM product_information pi JOIN inventories i
FROM product_information pi JOIN inventories i
FROM product_information pi JOIN inventories i
ON (pi.product_id=i.product_id) AND quantity_on_hand < 5;
and INVENTORIES tables.You have a requirement from the supplies department
to give a list containing PRODUCT_ID,SUPPLIER_ID, and QUANTITY_ON_HAND for
all the products where in QUANTITY_ON_HAND is less than five.
Which two SQL statements can accomplish the task? (Choose two.)
FROM product_information
NATURAL JOIN inventories AND quantity_on_hand < 5;
FROM product_information pi JOIN inventories i
USING (product_id) AND quantity_on_hand < 5;
FROM product_information pi JOIN inventories i
ON (pi.product_id=i.product_id) WHERE quantity_on_hand < 5;
FROM product_information pi JOIN inventories i
ON (pi.product_id=i.product_id) AND quantity_on_hand < 5;
Answer: CD
题目解释:
1) natural join
这里需要将 and 修改为where
2)using
使用using的时候需要注意:
正确的用法: