Here’re six top SQL aggregate functions rules. Aggregate functions, you can call column functions since you can use only for Table columns.

Table of contents

  1. Rules for Aggregate Functions
    1. #1 Rule
    2. #2 Rule
    3. #3 Rule
    4. #4 Rule
    5. #5 Rule
    6. #6 Rule
  2. QUIZ
Rules for aggregation function in SQL
Photo by Joshua Miranda on Pexels.com

Rules for Aggregate Functions

Example Function

The syntax.

AVG(SALARY)

Here SALARY is name of the column. Below is the list of rules.

Rule

  • A select query that uses Aggregate function called summary query.

Rule

  • The result of AVG and SUM functions is numeric. These functions only work with numerics.

Rule

  • The result of MIN, MAX and COUNT can be a numeric or DATE, or String value.

Rule

  • By default DUPLICATEs are considered. So use distinct to ignore duplicates.

Rule

  • You cannot mix aggregate and non-aggregate functions in SELECT statement. You need GROUP BY to mix both.

Rule

  • Aggregate functions ignore NULL values.

QUIZ

Try the tricky questions.