HexLibraryHexLibrary
</> HexCodeSign inSign up
PythonJavaScriptTypeScriptCC++JavaPHPGoRustRubyBashSQLLuaPerlCOBOLPascalDelphiFortranDartSwiftC#JuliaGroovyRElixirHaskellKotlinScalaClassic ASPClipperMS-DOS
LESSONS
Introduction to SQL (SELECT)Tables (CREATE & INSERT)Filtering (WHERE)Sorting & LimitingAggregate FunctionsUpdate & DeleteJoins (JOIN)
REFERENCE
📖 Overview
🔎 Querying (SELECT)
🗃️ Creating a Table
✏️ Inserting & Modifying Data
🧲 Filtering (WHERE)
🔢 Sorting & Limiting
📊 Aggregate Functions
COUNT / SUM / AVGGROUP BY
🔗 Joins (JOIN)
SQL›REFERENCE›Aggregate Functions›COUNT / SUM / AVG

COUNT / SUM / AVG

Counts/sums/averages rows.

Syntax

SELECT COUNT(*), SUM(column) FROM table;

Description

COUNT(*) is row count, SUM is total, AVG is average, MIN/MAX is minimum/maximum.

Example

Loading editor…

Expected output

60

When to use?

Summary/statistics.

Related commands

GROUP BY
GROUP BY →
HexLibraryHexLibrary

Learn programming more clearly. Every command is explained line by line with colors, reinforced with runnable exercises, test your code instantly — all in one place, free.

Learn

  • Home
  • Languages & Lessons
  • HexCode

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Use

Other Projects

  • HexToolz
  • Free Service Manuals
© 2026 HexLibrary · The clearest way to learn code