SQL Subquery Exercises: Display the average price of the products which is more than or equal to 350 along with theri names
SQL SUBQUERY: Exercise-32 with Solution
32. Write a SQL query to display the average price of the products which is more than or equal to 350 along with theri names.
Sample table: company_mast
Sample table: item_mast
SELECT AVG(pro_price) AS "Average Price", company_mast.com_name AS "Company" FROM item_mast, company_mast WHERE item_mast.pro_com= company_mast.com_id GROUP BY company_mast.com_name HAVING AVG(pro_price) >= 350;
Contribute your code and comments through Disqus.
Previous: Write a SQL query to find the average price of each manufacturer's products along with their name.
Next: Write a SQL query to display the name of each company, price for their most expensive product along with their ID.
What is the difficulty level of this exercise?