Sep 9, 2019 in Spark Sql
Q:

SQL COUNT(), AVG() and SUM() Functions

1 Answer

0 votes
Sep 9, 2019

The SQL COUNT(), AVG() and SUM() Functions

The COUNT() function returns the number of rows that matches a specified criteria.

The AVG() function returns the average value of a numeric column.

The SUM() function returns the total sum of a numeric column.

COUNT() Syntax

SELECT COUNT(column_name)
FROM table_name
WHERE condition;

AVG() Syntax

SELECT AVG(column_name)
FROM table_name
WHERE condition;

SUM() Syntax

SELECT SUM(column_name)
FROM table_name
WHERE condition;
Click here to read more about Loan/Mortgage
Click here to read more about Insurance
...