w3resource
SQL exercises

SQL Subquery Exercises: Find the average price of each manufacturer's products along with their name

SQL SUBQUERY: Exercise-31 with Solution

31. Write a SQL query to find the average price of each manufacturer's products along with their name.

Sample table: company_mast


Sample table: item_mast


Sample Solution:

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;

Output :

SQL Subqueries Exercise

Practice Online


Sample Database:

Model Database

Query Visualization:

Duration:

Query visualization of Find the average price of each manufacturer's products along with their name - Duration

Rows:

Query visualization of Find the average price of each manufacturer's products along with their name - Rows

Cost:

Query visualization of Find the average price of each manufacturer's products along with their name - Cost

Contribute your code and comments through Disqus.

Previous: Write a query to find all those customers who hold a different grade than any customer of the city Dallas.
Next: Write a SQL query to display the average price of the products which is more than or equal to 350 along with theri names.

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming