Using Group By with Rollup, write & run the SQL command using MySQL workbench to list the total sales by customer, month and product, with subtotals by customer and by month and a grand total for all product sales. Scroll the results to the bottom to show the GRAND TOTAL and the PREVIOUS SUB-TOTAL. Use the image below as a reference for a correct solution.
Using Group By with Rollup, write & run the SQL command using MySQL workbench to list the total sales by customer, month and product, with subtotals by customer and by month and a grand total for all product sales. Scroll the results to the bottom to show the GRAND TOTAL and the PREVIOUS SUB-TOTAL. Use the image below as a reference for a correct solution.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question

Transcribed Image Text:dwcustomer
CUS_CODE INT(11)
CUS_LNAME VARCHAR(15)
CUS_FNAME VARCHAR(15)
CUS INITIAL CHAR (1)
CUS_STATE CHAR(2)
OREG_ID INT(11)
Indexes
dwdaysalesfact
TM_ID INT (11)
CUS_CODE INT(11)
P_CODE VARCHAR(10)
SALE UNITS INT (11)
SALE PRICE DECIMAL (10,2)
Indexes
1
1
dwregion
REG_ID INT(11)
OREG_NAME VARCHAR(10)
Indexes
dwtime
TM_ID INT (11)
TM_YEAR INT(11)
TM_MONTH INT (11)
TM_DAY INT (11)
TM_QTR INT(11)
Indexes
dwproduct
PP_CODE VARCHAR (10)
OP_DESCRIPT VARCHAR(35)
OP_CATEGORY VARCHAR(5)
OV_CODE INT (11)
Indexes
dwvendor
PV_CODE INT (11)
OV NAME VARCHAR(35)
OV_AREACODE CHAR(3)
OV_STATE CHAR(2)
Indexes

Transcribed Image Text:Using Group By with Rollup, write & run the SQL command using MySQL workbench to list the total sales by customer, month and product, with subtotals by customer and by month and a grand
total for all product sales. Scroll the results to the bottom to show the GRAND TOTAL and the PREVIOUS SUB-TOTAL. Use the image below as a reference for a correct solution.
CUS_CODE TM_MONTH
10018
10018
10018
10018
10018
10018
10019
10019
10019
9
9
9
9
9
HALL
J
9
9
Ć
HALL
P_CODE
2238/QPD 38.95
23109-HB 9.95
54778-2T 9.98
PVC23DRT 70.44
129.32
129.32
1546-QQ2 39.95
39.95
39.95
2252.06
NULL
HULL
Total
Sales
HALL
MILL
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education