Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2. For each query shown in the screen clipping below, write a question that the return set of the query answers. See the notes at
2. For each query shown in the screen clipping below, write a question that the return set of the query answers. See the notes at the end of this assignment. Show evidence you successfully ran the queries.
Queries I - b 1 Query SELECT ROUND (SUM (SALES),2) AS "TOTAL SALES" 3 FROM ORDER ITEMS WHERE CATEGORY ='Furniture'; Query 2 SELECT CATEGORY, ROUND (SUM (SALES),2) AS "TOTAL SALES" 7 FROM ORDER ITEMS GROUP BY CATEGORY: 10 -Query 3 12 13 14 15 16 17 18 19 20 21 SELECT CATEGORY, ROUND (SUM (SALES),2) AS "TOTAL SALES" FROM ORDER ITEMS GROUP BY ROLLUP (CATEGORY) Query 4 SELECT CATEGORY, SUB CATEGORY, ROUND (SUM (SALES),2) AS"TOTAL SALES" FROM ORDER ITEMS GROUP BY ROLLUP (CATEGORY, SUB_CATEGORY): Query 5 SELECT CUSTOMER_ID, CATEGORY, SUB_CATEGORY, ROUND (SUM (SALES),2) AS "TOTAL SALES" 23 24 25 26 FROM ORDER ITEMS 01, ORDERS O WHERE 01. ORDER ID = O. ORDER ID GROUP BY ROLLUP (CUSTOMER ID, CATEGORY, SUB CATEGORY) Query 6 SELECT CUSTOMER_ID, COUNT (DISTINCT ?.ORDER-ID) AS "NUMBER OF ORDERS", ROUND (SUM (SALES) ,2) AS "TOTAL SALES", 28 29 30 ROUND (SUM (PROFIT),2) AS "TOTAL PROFIT" FROM ORDER ITEMS OI, ORDERS O WHERE OI.ORDER IDO.ORDER ID GROUP BY ROLLUP (CUSTOMER ID) ORDER BY "NUMBER OF ORDERS" Queries I - b 1 Query SELECT ROUND (SUM (SALES),2) AS "TOTAL SALES" 3 FROM ORDER ITEMS WHERE CATEGORY ='Furniture'; Query 2 SELECT CATEGORY, ROUND (SUM (SALES),2) AS "TOTAL SALES" 7 FROM ORDER ITEMS GROUP BY CATEGORY: 10 -Query 3 12 13 14 15 16 17 18 19 20 21 SELECT CATEGORY, ROUND (SUM (SALES),2) AS "TOTAL SALES" FROM ORDER ITEMS GROUP BY ROLLUP (CATEGORY) Query 4 SELECT CATEGORY, SUB CATEGORY, ROUND (SUM (SALES),2) AS"TOTAL SALES" FROM ORDER ITEMS GROUP BY ROLLUP (CATEGORY, SUB_CATEGORY): Query 5 SELECT CUSTOMER_ID, CATEGORY, SUB_CATEGORY, ROUND (SUM (SALES),2) AS "TOTAL SALES" 23 24 25 26 FROM ORDER ITEMS 01, ORDERS O WHERE 01. ORDER ID = O. ORDER ID GROUP BY ROLLUP (CUSTOMER ID, CATEGORY, SUB CATEGORY) Query 6 SELECT CUSTOMER_ID, COUNT (DISTINCT ?.ORDER-ID) AS "NUMBER OF ORDERS", ROUND (SUM (SALES) ,2) AS "TOTAL SALES", 28 29 30 ROUND (SUM (PROFIT),2) AS "TOTAL PROFIT" FROM ORDER ITEMS OI, ORDERS O WHERE OI.ORDER IDO.ORDER ID GROUP BY ROLLUP (CUSTOMER ID) ORDER BY "NUMBER OF ORDERSStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started