OCP-047 NATURAL JOIN and USING

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.

Which two SQL statements can accomplish the task? (Choose two.)


A. SELECT product_id, quantity_on_hand , supplier_id
FROM product_information

NATURAL JOIN inventories AND quantity_on_hand < 5;


B. SELECT i.product_id, i.quantity_on_hand , pi.supplier_id
FROM product_information pi JOIN inventories i

USING (product_id) AND quantity_on_hand < 5;


C. SELECT i.product_id, i.quantity_on_hand , pi.supplier_id
FROM product_information pi JOIN inventories i

ON (pi.product_id=i.product_id) WHERE quantity_on_hand < 5;


D. SELECT i.product_id, i.quantity_on_hand , pi.supplier_id
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的时候需要注意:



正确的用法:




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值