Which SQL statement gives the required output?

Examine the structure of the PRODUCTS table:


You want to display the names of the products that have the highest total value for UNIT_PRICE *QTY_IN_HAND.
Which SQL statement gives the required output?
A. SELECT prod_nameFROM productsWHERE (unit_price * qty_in_hand) = (SELECT MAX(unit_price * qty_in_hand) FROM products);
B. SELECT prod_nameFROM productsWHERE (unit_price * qty_in_hand) = (SELECT MAX(unit_price * qty_in_hand) FROM productsGROUP BY prod_name);
C. SELECT prod_nameFROM productsGROUP BY prod_nameHAVING MAX(unit_price * qty_in_hand) = (SELECT MAX(unit_price * qty_in_hand) FROM productsGROUP BY prod_name);
D. SELECT prod_nameFROM productsWHERE (unit_price * qty_in_hand) = (SELECT MAX(SUM(unit_price * qty_in_hand)) FROM products)GROUP BY prod_name;

Download Printable PDF. VALID exam to help you PASS.

One thought on “Which SQL statement gives the required output?

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.