MCQs > IT & Programming > SQL >

For a table with the following columns:

product_id, product_name, supplier_id, price

Which of the following queries will give you the supplier with the maximum average price of products?


SQL MCQs

For a table with the following columns:

product_id, product_name, supplier_id, price

Which of the following queries will give you the supplier with the maximum average price of products?


Answer

Correct Answer:

SELECT supplier_id, avg(price) FROM Products group by supplier_id having avg(price) in (Select max(avg_price) from (Select avg(price) as avg_price from products group by supplier_id))

Explanation:

Note: This Question is unanswered, help us to find answer for this one

SQL Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

SQL Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it