Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

image text in transcribed

image text in transcribed

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 ORDERS

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

Apply your own composing style to personalize your messages.

Answered: 1 week ago

Question

Format memos and e-mail properly.

Answered: 1 week ago