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 5P
Textbook Problem
2477 views

What is the SQL command to list the total sales by customer and by product, with subtotals by customer and a grand total for all product sales? Figure P13.5 shows the abbreviated results of the query.

FIGURE P13.5 PROBLEM 5ABBREVIATED RESULT

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

Explanation of Solution

SQL QUERY:

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

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

FROM DWDAYSALESFACT

GROUP BY ROLLUP CUS_CODE, P_CODE);

  • The SELECT statement is used to select the customer (CUS_CODE), product (P_CODE), and the total sales from the table named DWDAYSALESFACT.
  • 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
What is the difference between ferrous and nonferrous metals?

Precision Machining Technology (MindTap Course List)

What is meant by the phrase consumerization of IT?

Principles of Information Systems (MindTap Course List)

Using Excel or a spreadsheet of your choice, create interesttime factor tables, similar to Table 20.9, for i = ...

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

For what other reasons might you share your calendar?

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)