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 6P
Textbook Problem
1242 views

What is the SQL command 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? Figure P13.6 shows the abbreviated results of the query.

FIGURE P13.6 PROBLEM 6 ABBREVIATED RESULT

Chapter 13, Problem 6P, What is the SQL command to list the total sales by customer, month, and product, with subtotals by

Explanation of Solution

SQL QUERY:

The SQL query to list the total sales by customer, month and by product is as follows.

SELECT CUS_CODE, TM_MONTH, P_CODE, SUM(SALE_UNITS * SALE_PRICE) AS TOTSALES

FROM DWDAYSALESFACT JOIN DWTIME USING (TM_ID)

GROUP BY ROLLUP (CUS_CODE, TM_MONTH, P_CODE);

  • The SELECT statement is used to select the customer (CUS_CODE), month (TM_MONTH), product (P_CODE), and the total sales.
  • The total sale is obtained by calculating the sum of SALE_UNITS and SALE_PRICE...

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 would you model Question 6 with an OODM? (Use Figure 2.4 as your guide.)

Database Systems: Design, Implementation, & Management

Describe four uses of the combination set.

Precision Machining Technology (MindTap Course List)

What is a typical amperage rating for a residential building?

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

What is a system requirement, and how are system requirements classified?

Systems Analysis and Design (Shelly Cashman Series) (MindTap Course List)

What elements are contained in an information system? (554)

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)

Who must be provided with safety data sheets (SDSs)?

Welding: Principles and Applications (MindTap Course List)

Why do APC ferrules create less back reflection than UPC ferrules?

Network+ Guide to Networks (MindTap Course List)