In Chapter 3, excercise 16, the book asks for "part number, part descriptions, and on_hand_value (units on hand * unit price) for each part where the units on hand is more than the average number of units on hand for all parts. Professor Gibson's script is as follows:
select part_num, description, units_on_hand
from part
where units_on_hand >
(select avg(units_on_hand) from part);
I feel the script should be:
select part_num, description, on_hand*price "On-Hand Value" from part
where on_hand > (select avg(on_hand) from part);
The first script does not calculate on_hand_value, but shows the number of units on hand in its place. Just an fyi...
Comments