Syntax

SQL Sum, Average, Min, Max Syntax

In SQL, sum, average, min, max: aggregates a numeric column — SELECT SUM(total), AVG(total), MIN(total), MAX(total) FROM orders;

Quick Answer

Syntax
SELECT SUM(total), AVG(total), MIN(total), MAX(total) FROM orders;
SQLSyntax

Sum, Average, Min, Max

Code example
SELECT SUM(total), AVG(total), MIN(total), MAX(total) FROM orders;

Aggregates a numeric column.

Learn More

How to sum, average, min, max in SQL

  1. Open your SQL file or editor.
  2. Copy the example, then replace its sample names and values for your code.

SQL Sum, Average, Min, Max Syntax

Use SELECT SUM(total), AVG(total), MIN(total), MAX(total) FROM orders;.

Related Syntax References

Frequently asked questions

What is the SQL syntax for sum, average, min, max?

Use this pattern: SELECT SUM(total), AVG(total), MIN(total), MAX(total) FROM orders;

Can I copy this SQL code example?

Yes. Use Copy code and adapt the example to your program.

Is this SQL syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify