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

What is the SQL command to list the total sales by region and customer, with subtotals by region and a grand total for all sales? Figure P13.7 shows the result of the query.

FIGURE P13.7 PROBLEM 7 RESULT

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

Explanation of Solution

SQL QUERY:

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

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

FROM DWDAYSALESFACT JOIN DWCUSTOMER USING (CUS_CODE)

GROUP BY ROLLUP (REG_ID, CUS_CODE);

  • The SELECT statement is used to select the customer (CUS_CODE), region (REG_ID), 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
When are most liabilities recognized?

Cornerstones of Financial Accounting

Describe the purpose of a viscous clutch.

Automotive Technology: A Systems Approach (MindTap Course List)

Give examples of the important role of volume in engineering analysis and design.

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

What is an operational security control?

Management Of Information Security

The homogeneous 340-lb sign is suspended from three wires. Find the tension in each wire.

International Edition---engineering Mechanics: Statics, 4th Edition

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

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

Object a. procedures that keep data current b. item that contains data, as well as the actions that read or pro...

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

State the advantages of having two oxygen regulators on a machine cutting torch.

Welding: Principles and Applications (MindTap Course List)