Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Use of AVG() Function in MySql

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 385
    Comment on it

    The MySql provides us with various for wide use for handling the database. The AVG() function is also one of the important function used in MySql. The AVG() is used to calculate the average value of the columns.

     Syntax:
     SELECT AVG(column-name) FROM table-name;
    

    EXAMPLE:
    alt text

    Now with the following statement we will be able to calculate the average price:

    SELECT AVG(Price) AS PriceAverage FROM Products;
    

    It will produce the following output:

    PriceAverage 
    28.866363636363637
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: