Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume that for each product, unit gross profit is defined as (unit price - cost of raw materials). Compose a query to display the unit

Assume that for each product, unit gross profit is defined as (unit price - cost of raw materials). Compose a query to display the unit gross profit of each product. Show Product ID, Product Name, and its corresponding unit gross profit in the result table. [Hint: you may need two queries to answer this question. The first query is used in the FROM clause of the second query].

Table1: Order_line_t

Order_line_t
Order_ID Product_ID Quantity
1001 1 2
1001 2 2
1001 4 1
1002 3 5
1003 3 1
1004 6 2
1004 8 2
1005 4 4
1006 4 1
1006 5 2
1006 7 2
1007 1 3
1007 2 2
1008 3 2
1008 8 3
1009 4 2
1009 7 3
1010 8 10

Table2 : Product_t

Product_t
Product_ID Product_Name Product_Finish Unit_Price On_hand Product_Description Product_Line_ID Work_Center_ID
1 End Table Cherry $175.00 1 1 1
2 Coffee Table Natural Ash $200.00 4 1 1
3 Computer Desk Natural Ash $375.00 5 Computer Desk 48" 4 2
4 Entertainment Center Natural Maple $650.00 3 2 2
5 Writer's Desk Cherry $325.00 0 4 2
6 8-Drawer Desk White Ash $750.00 5 4 2
7 Dining Table Natural Ash $800.00 2 5 1
8 Computer Desk Walnut $250.00 4 Computer Desk 64" 4 2

Table3: Raw_Materials_t

Raw_Materials_t
Material_ID Thickness Size Grade Material_description Footage_on_hand Cost_Raw_materials
1 1/4 8x4 B-4 Red Oak 166 $7.89
2 1/2 4x8 A-2 Red Oak 257 $12.05
3 3/4 4x8 A-1 Red Oak 33 $13.67
4 3/4 4x8 C-4 Red Oak 4 $7.66
5 1/4 4x8 A-4 White Oak 72 $7.23
6 3/4 4x8 A-1 White Oak 54 $15.19
7 1/2 4x8 B-4 Walnut 9 $13.02
8 3/4 4x8 A-1 Walnut 58 $15.45
9 3/4 4x8 Shop Walnut 2 $10.88
10 3/4 4x8 C-2 Natural Ash 11 $15.55
11 1/4 4x8 A-4 White Ash 33 $8.79
12 3/4 4x8 A-1 White Ash 66 $14.26
13 1/2 4x8 A-2 Cherry 2 $15.82
14 1/2 4x8 B-2 Cherry 1 $13.75
15 3/4 4x8 A-1 Cherry 68 $16.72
16 1/4 4x8 A-4 Natural Maple 84 $5.70
17 1/2 4x8 D-3 Natural Maple 165 $7.95
18 3/4 4x8 A-1 Natural Maple 212 $11.13
19 3/4 4x8 B-2 Natural Maple 306 $10.47
20 3/4 4x8 D-3 Natural Maple 302 $9.18

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Fundamentals Concepts, Drivers & Techniques

Authors: Thomas Erl, Wajid Khattak, Paul Buhler

1st Edition

0134291204, 9780134291208

More Books

Students also viewed these Databases questions