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’
GROUP BY a.prod_name
ORDER BY a.prod_name;
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.
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;
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 ROUND(AVG(b.unit_cost),2);