BuyFindarrow_forward

Database Systems: Design, Implemen...

12th Edition
Carlos Coronel + 1 other
Publisher: Cengage Learning
ISBN: 9781305627482

Solutions

Chapter
Section
BuyFindarrow_forward

Database Systems: Design, Implemen...

12th Edition
Carlos Coronel + 1 other
Publisher: Cengage Learning
ISBN: 9781305627482
Chapter 13, Problem 11P
Textbook Problem
369 views

What is the SQL command to list the number of product sales (number of rows) and total sales by month, product category, and product, with subtotals by month and product category and a grand total for all sales? Figure P13.11 shows the result of the query.

FIGURE P13.11 PROBLEM 11 RESULT

Chapter 13, Problem 11P, What is the SQL command to list the number of product sales (number of rows) and total sales by

Explanation of Solution

SQL Query:

The SQL query to list the number of product sales and total sales by month, product category and product with subtotals by month and product category and a grand total for all sales is as follows.

SELECT TM_MONTH, P_CATEGORY, P_CODE, COUNT (*) AS NUMPROD, SUM(SALE_UNITS * SALE_PRICE) AS TOTSALES

FROM DWDAYSALESFACT JOIN DWTIME USING (TM_ID) JOIN DWPRODUCT USING (P_CODE)

GROUP BY ROLLUP (TM_MONTH, P_CATEGORY, P_CODE);

  • The SELECT statement is used to select the month (TM_MONTH), product category (P_CATEGORY), product (P_CODE), count and the total sales from the table named DWDAYSALESFACT...

Still sussing out bartleby?

Check out a sample textbook solution.

See a sample solution

The Solution to Your Study Problems

Bartleby provides explanations to thousands of textbook problems written by our experts, many with advanced degrees!

Get Started

Chapter 13 Solutions

Database Systems: Design, Implementation, & Management
Show all chapter solutions
add

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Show solutions add
How could Lewins force field analysis be applied to this project?

Principles of Information Systems (MindTap Course List)

What two functions can the lathe tailstock perform?

Precision Machining Technology (MindTap Course List)

VocabularyState the meaning of the following terms: Exponential Function _____ Logarithmic Function _____ Natur...

Engineering Fundamentals: An Introduction to Engineering (MindTap Course List)

Convert 5 megawatts of power into BTU/hr, ft-lbs/s, and kJ/hr.

Fundamentals of Chemical Engineering Thermodynamics (MindTap Course List)

Describe security risks associated with wireless access. Identify ways to secure your wireless network.

Enhanced Discovering Computers 2017 (Shelly Cashman Series) (MindTap Course List)

If your motherboard supports ECC DDR3 memory, can you substitute non-ECC DDR3 memory?

A+ Guide to Hardware (Standalone Book) (MindTap Course List)

What is the key to preventing accidents in a welding shop?

Welding: Principles and Applications (MindTap Course List)