menu
bartleby
search
close search
Hit Return to see all results
close solutoin list

Using the output shown in Figure P7.29 as your guide, generate a list of customer purchases, including the subtotals for each of the invoice line numbers. ( Hint: Modify the query format used to produce the list of customer purchases in Problem 28, delete the INV_DATE column, and add the derived attribute LINE_UNITS * LINE_PRICE to calculate the subtotals.

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 7, Problem 29P
Textbook Problem
314 views

Using the output shown in Figure P7.29 as your guide, generate a list of customer purchases, including the subtotals for each of the invoice line numbers. (Hint: Modify the query format used to produce the list of customer purchases in Problem 28, delete the INV_DATE column, and add the derived attribute LINE_UNITS * LINE_PRICE to calculate the subtotals.

Chapter 7, Problem 29P, Using the output shown in Figure P7.29 as your guide, generate a list of customer purchases,

Program Plan Intro

DISTINCTROW Keyword:

The “DISTINCTROW” keyword omits data based entire duplicate records, not like just duplicate fields. The syntax for “DISTINCT” keyword is as follows:

Syntax:

SELECT DISTINCTROWcol_Name FROM table_Name1 INNER JOIN table_Name2 ON table_Name1.col_Name = table_Name2.col_Name ORDER BY table_Name1;

GROUP BY Clause:

The GROUPBY clause is used to group the result of a SELECT statement done on a table where the tuple values are similar for more than one column

Syntax:

SELECT expression1, expression2, expression_n, aggregate_function(expression)FROM table_name WHERE conditions GROUP BY expression1, expression2, expression_n;

INNER JOIN keyword:

“INNER JOIN” keyword is used to select all the matching records of both the table.

Syntax:

SELECT col_Name FROM table_Name1 INNER JOIN table_Name2 ON table_Name1.col_Name = table_Name2.col_Name;

Explanation of Solution

SQL code:

The SQL code to generate a list of customer purchases that includes the subtotals for every invoice line number is given below:

SELECT DISTINCTROW INVOICE.CUS_CODE, INVOICE.INV_NUMBER, PRODUCT.P_DESCRIPT, LINE.LINE_UNITS, LINE.LINE_PRICE, [LINE]![LINE_UNITS]*[LINE]![LINE_PRICE] AS Expr1 FROM CUSTOMER INNER JOIN (INVOICE INNER JOIN (PRODUCT INNER JOIN LINE ON PRODUCT.P_CODE = LINE.P_CODE) ON INVOICE.INV_NUMBER = LINE.INV_NUMBER) ON CUSTOMER.CUS_CODE = INVOICE.CUS_CODE GROUP BY INVOICE.CUS_CODE, INVOICE.INV_NUMBER, PRODUCT.P_DESCRIPT, LINE.LINE_UNITS, LINE...

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 7 Solutions

Database Systems: Design, Implementation, & Management
Show all chapter solutions
add
Ch. 7 - Assuming that the data shown in the EMP_1 table...Ch. 7 - Write the SQL code that will save the changes made...Ch. 7 - Write the SQL code to change the job code to 501...Ch. 7 - Write the SQL code to delete the row for William...Ch. 7 - Write the SQL code that will restore the data to...Ch. 7 - Write the SQL code to create a copy of EMP_1,...Ch. 7 - Write the SQL code to change the EMP_PCT value to...Ch. 7 - Using a single command sequence, write the SQL...Ch. 7 - Using a single command sequence, write the SQL...Ch. 7 - Write the SQL code that will change the PROJ_NUM...Ch. 7 - Write the two SQL command sequences required to:...Ch. 7 - Write the SQL command that will delete the newly...Ch. 7 - Write the SQL code required to list all employees...Ch. 7 - Using the EMPLOYEE, JOB, and PROJECT tables in the...Ch. 7 - Write the SQL code that will produce the same...Ch. 7 - Write the SQL code to find the average bonus...Ch. 7 - Write the SQL code that will produce a listing for...Ch. 7 - Write the SQL code that will list only the...Ch. 7 - Write the SQL code to calculate the ASSIGN_CHARGE...Ch. 7 - Using the data in the ASSIGNMENT table, write the...Ch. 7 - Write a query to produce the total number of hours...Ch. 7 - Write the SQL code to generate the total hours...Ch. 7 - Write the SQL code to generate the total hours...Ch. 7 - Write a query to count the number of invoices.Ch. 7 - Write a query to count the number of customers...Ch. 7 - Generate a listing of all purchases made by the...Ch. 7 - Using the output shown in Figure P7.29 as your...Ch. 7 - Write a query to display the first name, last...Ch. 7 - Modify the query used in Problem 29 to produce the...Ch. 7 - Modify the query in Problem 30 to include the...Ch. 7 - Write a query to display the first name, last...Ch. 7 - Use a query to compute the average purchase amount...Ch. 7 - Create a query to produce the total purchase per...Ch. 7 - Use a query to show the invoices and invoice...Ch. 7 - Write a query to produce the number of invoices...Ch. 7 - Using the query results in Problem 35 as your...Ch. 7 - List the balances of customers who have made...Ch. 7 - Using the results of the query created in Problem...Ch. 7 - Create a query to find the balance characteristics...Ch. 7 - Find the listing of customers who did not make...Ch. 7 - Find the customer balance summary for all...Ch. 7 - Create a query that summarizes the value of...Ch. 7 - Using the results of the query created in Problem...Ch. 7 - Write a query to display the eight departments in...Ch. 7 - Write a query to display the SKU (stock keeping...Ch. 7 - Write a query to display the manager name,...Ch. 7 - Write a query to display the first name, last...Ch. 7 - Write a query to display the employee number, last...Ch. 7 - Write a query that displays the book title, cost...Ch. 7 - Write a query that displays the first and last...Ch. 7 - Write a query to display the checkout number,...Ch. 7 - Write a query to display the book number, book...Ch. 7 - Write a query to display the different years in...Ch. 7 - Write a query to display the different subjects on...Ch. 7 - Write a query to display the book number, title,...Ch. 7 - Write a query to display the checkout number, book...Ch. 7 - Write a query to display the employee number, last...Ch. 7 - Write a query to display a brand name and the...Ch. 7 - Write a query to display the number of products in...Ch. 7 - Write a query to display the number of products...Ch. 7 - Write a query to display the total inventorythat...Ch. 7 - Write a query to display the brand ID, brand name,...Ch. 7 - Write a query to display the department number and...Ch. 7 - Write a query to display the employee number,...Ch. 7 - Write a query to display the customer code, first...Ch. 7 - Write a query to display the department number,...Ch. 7 - Write a query to display the vendor ID, vendor...Ch. 7 - Write a query to display the employee number, last...Ch. 7 - Write a query to display the largest average...Ch. 7 - Write a query to display the brand ID, brand name,...Ch. 7 - Write a query to display the book title, year, and...Ch. 7 - Write a query to display the book number, title,...Ch. 7 - Write a query to display the book number, title,...Ch. 7 - Write a query to display the checkout number, book...Ch. 7 - Write a query to display the book number, title,...Ch. 7 - Write a query to display the book number, title,...Ch. 7 - Write a query to display the author ID, first...Ch. 7 - Write a query to display the book number, title,...Ch. 7 - Write a query to display the patron ID, first and...Ch. 7 - Write a query to display the patron ID, first and...Ch. 7 - Write a query to display the author ID, first and...Ch. 7 - Write a query to display the author ID, first and...Ch. 7 - Write a query to display the checkout number, book...Ch. 7 - Write a query to display the author ID, first...Ch. 7 - Write a query to display the number of books in...Ch. 7 - Write a query to display the number of different...Ch. 7 - Write a query to display the number of books that...Ch. 7 - Write a query to display the highest book cost in...Ch. 7 - Write a query to display the lowest book cost in...Ch. 7 - Write a query to display the number of different...Ch. 7 - Write a query to display the subject and the...Ch. 7 - Write a query to display the author ID and the...Ch. 7 - Write a query to display the total value of all...Ch. 7 - Write the SQL code to create the table structures...Ch. 7 - The following tables provide a very small portion...Ch. 7 - Write the SQL command to save the rows inserted in...Ch. 7 - Write the SQL command to change the movie year for...Ch. 7 - Write the SQL command to change the price code for...Ch. 7 - Write a single SQL command to increase all price...Ch. 7 - Write the SQL command to save the changes made to...Ch. 7 - Write a query to display the movie title, movie...Ch. 7 - Write a query to display the movie year, movie...Ch. 7 - Write a query to display the movie title, movie...Ch. 7 - Write a query to display the movie number, movie...Ch. 7 - Write a query to display the movie title, movie...Ch. 7 - Write a query to display the movie title, movie...Ch. 7 - Write a query to display the movie number, movie...Ch. 7 - Write a query to display the movie number, movie...Ch. 7 - Write a query to display the membership number,...Ch. 7 - Write a query to display the movie genre and the...Ch. 7 - Write a query to display the average cost of all...Ch. 7 - Write a query to display the movie genre and...Ch. 7 - Write a query to display the movie title, movie...Ch. 7 - Write a query to display the movie genre and...Ch. 7 - Write a query to display the movie title, movie...Ch. 7 - Write a query to display the movie title and movie...Ch. 7 - Write a query to display the movie title, movie...Ch. 7 - Write a query to display the movie title, movie...Ch. 7 - Write a query to display the membership number,...Ch. 7 - Write a query to display the minimum balance,...Ch. 7 - Write a query to display the rental number, rental...Ch. 7 - Write a query to display the rental number, rental...Ch. 7 - Write a query to display the movie number, movie...Ch. 7 - What type of integrity is enforced when a primary...Ch. 7 - Explain why it might be more appropriate to...Ch. 7 - What is the difference between a column constraint...Ch. 7 - What are referential constraint actions?

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Show solutions add
What are the basic characteristics of a NoSQL database?

Database Systems: Design, Implementation, & Management

What type of toolholder might he selected for mounting a slitting saw?

Precision Machining Technology (MindTap Course List)

For Problem 19.27, determine the probability (assuming normal distribution) that a car would need engine mainte...

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

Describe the seven basic steps for logical diagnosis.

Automotive Technology: A Systems Approach (MindTap Course List)

Identify and briefly describe five common fact-finding methods.

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

How might you know if you are addicted to computers or suffer from technology overload?

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)

How can discontinuities in the root face be removed?

Welding: Principles and Applications (MindTap Course List)