In the SH schema, write the source query and execute it for the following: A ) R
ID: 3840158 • Letter: I
Question
In the SH schema, write the source query and execute it for the following: A ) Retrieve the total sales.amount_sold of Deluxe Mouse devices to female customers. A separate aggregate result row is required for sales day Thursday and Friday respectively. That is, the sales aggregation has 2 result rows. The format for result rows must be: < |PROD_NAME |GENDER |DAY_NAME |TOTALSOLD > where products.PROD_NAME is the product/device name, DAY_NAME is the day of the week, and TOTALSOLD is an alias for the aggregate total/sum of sales.AMOUNT_SOLD per result row
Explanation / Answer
QUERY:
select prod_name,gender,day_name sum(amount_sold) as totalsold from SH groupby prod_name,gender,day_name having gender='female' and (day_name='friday' or day_name='thursday')