Answered step by step
Verified Expert Solution
Question
1 Approved Answer
9. Write a query to display the product sku, description, category, price, average price of products within that category, and the difference between each products
9. Write a query to display the product sku, description, category, price, average price of products within that category, and the difference between each products price and the average price of products in that category. Sort the results by product sku. The column labels and first few rows of your output must match the figure below.
LGCUSTOMER LGBRAND PK Cust Code PK Brand ID Cust Fname Cust Lname Cust Street Brand Name Brand Type Cust City Cust State Cust ZIP Cust Balance inclldes places LGPRODUCT LGLINE PK Prod SKU LGINVOICE PK,FK1 Iny Num PK Prod Descript Prod Type Prod Base Prod Category Prod Price Prod QOH Line Num PK Inv Num appears on contains FK1 Cust Code Inv Date Inv_Total FK2 Employee ID FK2 Prod SKU Line_Qty Line Price Prod Min FK1 Brand ID completes provided by LGEMPLOYEE PK Emp Num LGSALARY HISTORY LGSUPPLIES Emp_Fname Emp Lname Emp Email Emp Phone Emp Hiredate Emp Title Emp Comm FK1 Dept Num PK,FK1 Emp Num PK PK,FK1 Vend ID PK,FK2 Prod SKU has Sal From Sal End Sal Amount provides manhges employs LGVENDOR PK Vend ID LGDEPARTMENT Vend Name Vend Street Vend City Vend State Vend_ZIP PK Dept Num Dept Name Dept Mail Box Dept Phone FK1 Emp Num PROD DESCRIPT PROD PRICE DIFFERENCE PROD SKU PROD_CATEGORY AVGPRICE Dry Fall, Latex, Semi-Gloss (MPI Gloss Level 5) Top Coat 0.61 1010-MIW Course Content 21.99 21.38 Elastomeric, Exterior, Industrial Grade,Water Based Top Coat 62.99 1021-MTI 21.38 41.61 Traffic Marking Paint, Alkyd 1045-DUY Top Coat 6.59 21.38 -14.79 Primer,Galvanized Metal, Primer 14.89 15.41 -0.52 1067-KBB Cementitious Light Industrial Coating, Exterior, Water Based (eggshell-like- MPI Gloss Level 3) Top Coat 23.29 1074-VV 21.38 1.91 Varnish, Interior, Semi-Gloss 1078-QXL Top Coat 14.59 21.38 -6.79 Primer, Epoxy, Anti-Corrosive, for Primer 14.99 15.41 -0.42 1099-WFZ Metal 1143-RGX Shellac Primer 11.99 15.41 -3.42 LGCUSTOMER LGBRAND PK Cust Code PK Brand ID Cust Fname Cust Lname Cust Street Brand Name Brand Type Cust City Cust State Cust ZIP Cust Balance inclldes places LGPRODUCT LGLINE PK Prod SKU LGINVOICE PK,FK1 Iny Num PK Prod Descript Prod Type Prod Base Prod Category Prod Price Prod QOH Line Num PK Inv Num appears on contains FK1 Cust Code Inv Date Inv_Total FK2 Employee ID FK2 Prod SKU Line_Qty Line Price Prod Min FK1 Brand ID completes provided by LGEMPLOYEE PK Emp Num LGSALARY HISTORY LGSUPPLIES Emp_Fname Emp Lname Emp Email Emp Phone Emp Hiredate Emp Title Emp Comm FK1 Dept Num PK,FK1 Emp Num PK PK,FK1 Vend ID PK,FK2 Prod SKU has Sal From Sal End Sal Amount provides manhges employs LGVENDOR PK Vend ID LGDEPARTMENT Vend Name Vend Street Vend City Vend State Vend_ZIP PK Dept Num Dept Name Dept Mail Box Dept Phone FK1 Emp Num PROD DESCRIPT PROD PRICE DIFFERENCE PROD SKU PROD_CATEGORY AVGPRICE Dry Fall, Latex, Semi-Gloss (MPI Gloss Level 5) Top Coat 0.61 1010-MIW Course Content 21.99 21.38 Elastomeric, Exterior, Industrial Grade,Water Based Top Coat 62.99 1021-MTI 21.38 41.61 Traffic Marking Paint, Alkyd 1045-DUY Top Coat 6.59 21.38 -14.79 Primer,Galvanized Metal, Primer 14.89 15.41 -0.52 1067-KBB Cementitious Light Industrial Coating, Exterior, Water Based (eggshell-like- MPI Gloss Level 3) Top Coat 23.29 1074-VV 21.38 1.91 Varnish, Interior, Semi-Gloss 1078-QXL Top Coat 14.59 21.38 -6.79 Primer, Epoxy, Anti-Corrosive, for Primer 14.99 15.41 -0.42 1099-WFZ Metal 1143-RGX Shellac Primer 11.99 15.41 -3.42
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started