0% found this document useful (0 votes)
7 views1 page

Coding

The document provides definitions and examples for four SQL aggregate functions: COUNT(), SUM(), AVG(), and MIN(). COUNT() counts the number of rows or non-null values, SUM() adds up values in a numeric column, AVG() calculates the average of numeric values, and MIN() finds the smallest value in a column. Each function is illustrated with an SQL query example related to employee data.

Uploaded by

sanasayyad2112
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Coding

The document provides definitions and examples for four SQL aggregate functions: COUNT(), SUM(), AVG(), and MIN(). COUNT() counts the number of rows or non-null values, SUM() adds up values in a numeric column, AVG() calculates the average of numeric values, and MIN() finds the smallest value in a column. Each function is illustrated with an SQL query example related to employee data.

Uploaded by

sanasayyad2112
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1.

COUNT()

 Definition: Counts the number of rows in a table or how many non-null values are in a
column.

 Example: To count how many employees are in a table:

sql

Copy code

SELECT COUNT(*) FROM Employees;

This will give the total number of employees.

2. SUM()

 Definition: Adds up all the values in a numeric column.

 Example: To calculate the total salary of all employees:

sql

Copy code

SELECT SUM(Salary) FROM Employees;

This will give the total salary for all employees combined.

3. AVG()

 Definition: Calculates the average (mean) of values in a numeric column.

 Example: To find the average salary of all employees:

sql

Copy code

SELECT AVG(Salary) FROM Employees;

This will give the average salary.

4. MIN()

 Definition: Finds the smallest (minimum) value in a column.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy