Using View in Query - For this problem, need a query to address the same use case
Question:
Using View in Query - For this problem, need a query to address the same use case as in step 4, except you will use a view in the FROM clause in place of the subquery. The results should be the same as in step 4, except of course possibly row ordering which can vary.
step4 code
SELECT Store_location,store_name, Product.product_name ,
Alternate_name.name as "Alternate name",
to_char(Product.price_in_us_dollars,'$999.00') AS US_in_Price
from Store_location
JOIN Sells on sells.store_location_id = Store_location.store_location_id
JOIN Product on Product.product_id = sells.product_id
JOIN Alternate_name on Product.product_id = Alternate_name.product_id
WHERE Store_location.store_location_id IN
(SELECT Store_location.store_location_id
FROM Store_location
JOIN Offers ON Offers.store_location_id = Store_location.store_location_id
GROUP BY Store_location.store_location_id
HAVING COUNT(offers.shipping_offering_id) >1
ORDER BY store_name, product_name, name);
step4 result
Applied Regression Analysis and Other Multivariable Methods
ISBN: 978-1285051086
5th edition
Authors: David G. Kleinbaum, Lawrence L. Kupper, Azhar Nizam, Eli S. Rosenberg