• Home
  • Notation of Aggregation

    In Relational Database Management Systems (RDBMS), aggregation functions are used to perform calculations on groups of data and return a single result. Aggregation functions summarize and provide insights into the data stored in the database. Here are some common aggregation functions and their notation in SQL:


    1. COUNT:

    The COUNT function is used to count the number of rows or non-null values in a column. It can be used with the * wildcard to count all rows or with a specific column name to count non-null values. The notation is:

    COUNT(*)

    or

    COUNT(column_name)


    2. SUM:

    The SUM function calculates the sum of values in a numeric column. It adds up all the values and returns the total. The notation is:

    SELECT * FROM customers WHERE age > 30;

    SUM(column_name)


    3. AVG:

    The AVG function calculates the average (mean) of values in a numeric column. It adds up all the values and divides the total by the number of rows. The notation is:

    AVG(column_name)


    4. MIN:

    The MIN function returns the minimum (lowest) value in a column. It retrieves the smallest value in the specified column. The notation is:

    MIN(column_name)


    5. MAX:

    The MAX function returns the maximum (highest) value in a column. It retrieves the largest value in the specified column. The notation is:

    MAX(column_name)


    6. GROUP BY:

    The GROUP BY clause is used in conjunction with aggregation functions to group rows based on one or more columns. It allows the aggregation functions to calculate results for each group separately. The notation is:

    SELECT column1, aggregate_function(column2)
    FROM table_name
    GROUP BY column1


    These are some of the commonly used aggregation functions and the notation used in RDBMS. Aggregation functions provide a way to summarize and analyze data in various ways, allowing for data-driven insights and reporting.



    About the Author



    Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.

    We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc





     PreviousNext