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的时候需要注意:


正确的用法:

本文探讨了如何使用SQL查询从PRODUCT_INFORMATION和INVENTORIES表中筛选出库存量少于五件的产品,包括产品ID、供应商ID和当前库存量。详细介绍了三种有效的SQL语句,并解释了每种方法的原理。

369

被折叠的 条评论
为什么被折叠?



