Skip to content

Prajwal7662/SQL-Aggregate-function

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Š SQL Aggregate Functions πŸ“Œ Introduction

Aggregate functions in SQL are used to perform calculations on multiple rows of a table and return a single summarized value. They are mainly used to analyze and summarize data in databases.

πŸ”Ή Types of Aggregate Functions

COUNT() β†’ Counts the number of rows in a column or table.

SUM() β†’ Returns the total sum of numeric values in a column.

AVG() β†’ Calculates the average of numeric values in a column.

MIN() β†’ Returns the smallest value from a column.

MAX() β†’ Returns the largest value from a column.

πŸ”Ή GROUP BY with Aggregate Functions

The GROUP BY clause is used to group rows that have the same values in specified columns. Aggregate functions are then applied to each group separately.

πŸ”Ή HAVING with Aggregate Functions

The HAVING clause is used to filter groups based on aggregate conditions. It works like the WHERE clause, but is applied after grouping.

βœ… Summary

Aggregate functions operate on multiple rows and return a single value.

Common functions include COUNT, SUM, AVG, MIN, and MAX.

They are often used with GROUP BY to summarize data by categories.

The HAVING clause is used to filter groups based on aggregated results.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published