Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • SQL Avg ( ) Function

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 257
    Comment on it

    Avg ( ) function is used to return the average of numeric column . If in a table there is null value then it ignored that value .
    Syntax :

    select avg ( column_name ) from table_name where clause ; // where clause is optional
    

    Example :
    Table name : Employee_Info

      Id        Employee_name          Employee_Age               Employee _Salary
      1            Mukesh                  23                           100000
      2            Ayush                   24                           200000
      3            Ishan                   20                           400000
      4            Pranav                  35                           700000
      5            Abhishek                26                           800000
      6            Ravi                    25                           300000
      7            David                   40                           800000
    

    Query to find the avg of employee salary :

    select avg ( Employee_Salary ) from Employee_Info ;
    

    Output :

    Average of Employee_Salary is  :
    471428.571429
    

 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: