w3resource
SQL exercises

SQL Exercises: Calculate the average price of all the products

SQL Aggregate Functions: Exercise-21 with Solution

Write a SQL query to calculate the average price of all the products.

Sample table: item_mast


Sample Solution:

SELECT AVG(pro_price) AS "Average Price" 
   FROM item_mast;

Sample table: item_mast


Output:

SQL Join Exercise

Query Visualization:

Duration:

Query visualization of Calculate the average price of all the products - Duration

Rows:

Query visualization of Calculate the average price of all the products - Rows

Cost:

Query visualization of Calculate the average price of all the products - Cost

Practice Online


Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a query that counts the number of salesmen with their order date and ID registering orders for each day.
Next: Write a SQL query to find the number of products with a price more than or equal to Rs.350.

What is the difficulty level of this exercise?



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