Which of the following queries will properly display the average unit_cost (rounded to two decimal places)…?

Review the following ER diagram:

Which of the following queries will properly display the average unit_cost (rounded to two decimal
places) for a given product on a Saturday and Order the results by the PROD_NAME column?

Review the following ER diagram:

Which of the following queries will properly display the average unit_cost (rounded to two decimal
places) for a given product on a Saturday and Order the results by the PROD_NAME column?

A.
SELECT a.prod_name, AVG(b.unit_cost)
FROM products a, costs b, times c
WHERE a.prod_id=b.prod_id
AND c.time_id=b.time_id
AND c.day_name=’Saturday’
GROUP BY a.prod_name
ORDER BY a.prod_name;

B.
SELECT a.prod_name, ROUND(AVG(b.unit_cost),2)
FROM products a, costs b, times c
WHERE a.prod_id=b.prod_id
AND c.time_id=b.time_id
AND c.day_name=’Saturday’;

C.
SELECT a.prod_name, ROUND(AVG(b.unit_cost),2)
FROM products a, costs b, times c
WHERE a.prod_id=b.prod_id
AND c.time_id=b.time_id
AND c.day_name=’Saturday

D.
GROUP BY a.prod_name
ORDER BY ROUND(AVG(b.unit_cost),2);

E.
SELECT a.prod_name, ROUND(AVG(b.unit_cost),2)
FROM products a, costs b, times c
WHERE a.prod_id=b.prod_id
AND c.time_id=b.time_id
AND c.day_name=’Saturday’
GROUP BY a.prod_name
ORDER BY a.prod_name;

F.
SELECT a.prod_name, ROUND(AVG(b.unit_cost),2)
FROM products a, costs b, times c
WHERE a.prod_id=b.prod_id
AND c.time_id=b.time_id
AND c.day_name=’Saturday’
ORDER BY a.prod_name;



Leave a Reply 0

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