Given these two separate tables, please use one and only one SQL statement to ge
ID: 3858325 • Letter: G
Question
Given these two separate tables, please use one and only one SQL statement to get the results that List the ID, name and average unit cost of the products that have multiple suppliers, sorted by the number of suppliers in descending order.
30 40 20 20 40 20 80 40 10 60 90 40 30 30 70 40 30 40 30 30 30 30 40 10 60 40 40 40 50 20 0123456789 17 67 74 88 32 2 700 283 200 600 30 8 1 300 44 400 150 esp 23 50 5 1 50 5 2 1 60 80 82 .00 12 14 15 15 80 4671 442 3 3 3 0 1 30570040 0123456789 Cat 351131135555555555225225554441 0123456789 00 00 75 00 00 00 00 .00 .00 00 3. 2. N 0062 30 8 2 30 4 85 50 5 1 50 5 2 1 60 283 Rec Sat Sec 0123456789Explanation / Answer
select COUNT(*) SupplierCount, Product.ProductId,Product.ProductName,avg(unitcost) as AverageUnitCost from Product join Supplier on Product.ProductId=Supplier.Productid group by Supplier.Supplierid order by SupplierCount desc
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.