Using the output shown in Figure P7.12 as your guide, generate a list of customer purchases, including the subtotals for each of the invoice line numbers. The subtotal is a derived attribute calculated by multiplying LINE_UNITS by LINE_PRICE. Sort the output by customer code, invoice number, and product description. Be certain to use the column aliases as shown in the figure. In the SQL Query do the following Select clause: CUS_CODE, INV_NUMBER, P_DESCRIPT, LINE_UNITS AS “Units Bought”, LINE_PRICE as “Unit Price”, derived attribute Subtotal using the formula stated above From: Join conditions between these tables INVOICE, LINE, PRODUCT Where clause: You can put join conditions here as well if you do not want to put them in the from clause. There are many ways to write the query. Order by clause: use the columns as stated in the problem description.

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter7: Creating Templates, Importing Data, And Working With Smartart, Images, And Screenshots
Section: Chapter Questions
Problem 1AYK
icon
Related questions
icon
Concept explainers
Question

Using the output shown in Figure P7.12 as your guide, generate a list of customer purchases, including the subtotals for each of the invoice line numbers. The subtotal is a derived attribute calculated by multiplying LINE_UNITS by LINE_PRICE. Sort the output by customer code, invoice number, and product description. Be certain to use the column aliases as shown in the figure. 

In the SQL Query do the following 

Select clause: CUS_CODE, INV_NUMBER, P_DESCRIPT, LINE_UNITS AS “Units  Bought”, LINE_PRICE as “Unit Price”, derived attribute Subtotal using the formula  stated above 

From: Join conditions between these tables INVOICE, LINE, PRODUCT 

Where clause: You can put join conditions here as well if you do not want to put them in the from clause. There are many ways to write the query. 

Order by clause: use the columns as stated in the problem description.

Cus.CODE
INV NUMBER
P DESCRIPT
Units Bought
Unit Price
Subtotal
10011
1002
Rat-tail file, 1/8-in. fine
2.00
4.99
9.98
10011
1004
Claw hammer
2.00
9.95
19.90
10011
1004
Rat-tail file, 1/8-in. fine
3.00
4.99
14.97
10011
1008
Claw hammer
1.00
9.95
9.95
10011
1008
PVC pipe, 3.5-in, 8-ft
5.00
5.87
29.35
Steel matting, 4x8x1/6", 5" mesh
10011
1008
3.00
119.95
359.85
10012
1003
7.25-in. pwr. saw blade
5.00
14.99
74.95
B&D cordless drill, 1/2-in.
10012
1003
1.00
38.95
38.95
10012
1003
Hrd. cloth, 1/4-in, 2:50
1.00
39.95
39.95
10014
1001
7.25-in. pwr. saw blade
1.00
14.99
14.99
Figure P7.12
Transcribed Image Text:Cus.CODE INV NUMBER P DESCRIPT Units Bought Unit Price Subtotal 10011 1002 Rat-tail file, 1/8-in. fine 2.00 4.99 9.98 10011 1004 Claw hammer 2.00 9.95 19.90 10011 1004 Rat-tail file, 1/8-in. fine 3.00 4.99 14.97 10011 1008 Claw hammer 1.00 9.95 9.95 10011 1008 PVC pipe, 3.5-in, 8-ft 5.00 5.87 29.35 Steel matting, 4x8x1/6", 5" mesh 10011 1008 3.00 119.95 359.85 10012 1003 7.25-in. pwr. saw blade 5.00 14.99 74.95 B&D cordless drill, 1/2-in. 10012 1003 1.00 38.95 38.95 10012 1003 Hrd. cloth, 1/4-in, 2:50 1.00 39.95 39.95 10014 1001 7.25-in. pwr. saw blade 1.00 14.99 14.99 Figure P7.12
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Query Syntax
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning