SQL Exercises: Display the names of the company whose products have an average price larger than or equal to Rs.350
SQL JOINS: Exercise-24 with Solution
Write a SQL query to display the names of the company whose products have an average price larger than or equal to Rs.350.
Sample table: company_mast
Sample table: item_mast
SELECT AVG(pro_price), company_mast.com_name FROM item_mast INNER JOIN company_mast ON item_mast.pro_com= company_mast.com_id GROUP BY company_mast.com_name HAVING AVG(pro_price) >= 350;
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a SQL query to display the average price of items of each company, showing the name of the company.
Next: Write a SQL query to display the name of each company along with the ID and price for their most expensive product.
What is the difficulty level of this exercise?