Aggregate Functions in MySQL

0 votes
Hi!!

Can someone tell me the various aggregate functions and their syntax in MySQL?
Nov 26, 2018 in Database by darklord
• 6,140 points
34 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

The aggregate functions are as follows:

MIN() Function

This function returns the smallest value of the selected column in a table.

Syntax:

SELECT MIN(column_name)
FROMtable_name
WHEREcondition;

MAX() Function

This function returns the largest value of the selected column in a table.

Syntax:

SELECT MAX(column_name)
FROM table_name
WHERE condition;

COUNT() Function

This function returns the number of rows that match the specified criteria.

Syntax:

SELECT COUNT(column_name)
FROM table_name
WHERE condition;

AVG() Function

This function returns the average value of a numeric column that you choose.

Syntax:

SELECT AVG(column_name)
FROM table_name
WHERE condition;

SUM() Function

This function returns the total sum of a numeric column that you choose.

Syntax:

SELECT SUM(column_name)
FROM table_name
WHERE condition;
answered Nov 26, 2018 by DataKing99
• 8,100 points

Related Questions In Database

0 votes
1 answer

Types of tables in MySQL

MyISAM is the default table that is ...READ MORE

answered Aug 21, 2018 in Database by CodingByHeart77
• 3,680 points
29 views
0 votes
1 answer

TRIGGERS used in MySQL tables

The following TRIGGERS are allowed in MySQL:  BEFORE ...READ MORE

answered Aug 21, 2018 in Database by CodingByHeart77
• 3,680 points
15 views
0 votes
1 answer

Accessing connection from different class in Java / MySQL?

You should just instantiate DoComms with every ...READ MORE

answered Nov 14, 2018 in Database by nirvana
• 3,040 points
26 views
0 votes
1 answer

What is HAVING Clause in MySQL?

Since the WHERE keyword cannot be used with aggregate ...READ MORE

answered Nov 21, 2018 in Database by darklord
• 6,140 points
25 views
0 votes
1 answer

Find values in a comma separated string in a MySQL query

You can add commas to the left and ...READ MORE

answered Sep 10, 2018 in Database by darklord
• 6,140 points
589 views
0 votes
1 answer

How to do a batch insert in MySQL

You can try out the following query: INSERT ...READ MORE

answered Sep 10, 2018 in Database by darklord
• 6,140 points
75 views
0 votes
1 answer
0 votes
1 answer

How to connect to MySQL Database?

using MySql.Data; using MySql.Data.MySqlClient; namespace Data { ...READ MORE

answered Oct 12, 2018 in Database by Frankie
• 9,570 points
53 views
0 votes
1 answer

Why is not preferable to use mysql_* functions in PHP?

The reasons are as follows: The MySQL extension: Does ...READ MORE

answered Sep 7, 2018 in Database by DataKing99
• 8,100 points
25 views
0 votes
1 answer

What are the manipulation functions in SQL?

There are three case manipulation functions in ...READ MORE

answered Oct 11, 2018 in Database by DataKing99
• 8,100 points
237 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.