Sunday, June 3, 2007

Question 74

Which of the following SQL statements on the two tables "PRODUCT" and "STOCK" in the answer group will obtain the same results as this one?

SELECT PRODUCT_NO FROM PRODUCT
WHERE PRODUCT_NO NOT IN (SELECT PRODUCT_NO FROM STOCK)
















PRODUCT
PRODUCT_NO PRODUCT_NAME UNIT_PRICE









STOCK
STOCK_NO PRODUCT_NO STOCK_QTY


a) SELECT PRODUCT_NO FROM STOCK
WHERE EXISTS (SELECT PRODUCT_NO FROM PRODUCT)
b) SELECT PRODUCT_NO FROM STOCK
WHERE NOT EXISTS (SELECT PRODUCT_NO FROM PRODUCT)
c) SELECT PRODUCT_NO FROM PRODUCT
WHERE EXISTS (SELECT PRODUCT_NO FROM STOCK
WHERE PRODUCT.PRODUCT_NO = STOCK.PRODUCT_NO)
d) SELECT PRODUCT_NO FROM PRODUCT
WHERE NOT EXISTS (SELECT PRODUCT_NO FROM STOCK
WHERE PRODUCT.PRODUCT_NO = STOCK.PRODUCT_NO

answer

No comments: