Home › coding › sql › sql aggregates

Sql Aggregates — Free Sql Tutorial

Learn Sql Aggregates in Sql with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.

✓ 100% Free ✓ No Login Needed ✓ NCERT / CBSE Aligned ✓ Download as PDF

TL;DR: Learn Sql Aggregates in Sql with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.

Written & reviewed by the Syllab.in Academic Team (CBSE/NCERT subject experts) · Updated Jul 14, 2026

🤖 Stuck on any question? Ask Syllab's free AI Tutor for a step-by-step explanation — instant, unlimited, no login.

Sql Aggregates in Sql

Aggregate functions perform calculations on a set of rows and return a single value. Key functions: COUNT() (count rows), SUM() (total), AVG() (average), MAX() (highest), MIN() (lowest).

GROUP BY divides rows into groups based on column values, then applies the aggregate function to each group. For example: average marks per class, count of students per city.

HAVING filters groups (like WHERE filters rows). Use HAVING to filter on aggregate results: HAVING AVG(marks) > 85.

Sql Aggregates — Syntax

SELECT COUNT(*) FROM students;
SELECT AVG(marks) FROM students;
SELECT MAX(marks), MIN(marks) FROM students;

SELECT class, AVG(marks)
FROM students
GROUP BY class
HAVING AVG(marks) > 80;

Learn Sql Aggregates step by step with Syllab's free interactive Sql tutorial — runnable code examples, practice exercises and instant AI feedback, all free with no signup. Explore the full Sql course →

Explore:

  • Syllabus
  • Practice
  • Mock Tests
  • NCERT Solutions
  • Coding
  • GK Quiz
  • Career Predictor
  • AI Tutor
  • Live Quiz
  • Doubt Solver
  • Microlearning
  • Free Alternatives
  • Kids Zone
  • Study Room
  • Calculators
  • Worksheets

Syllab.in — Free learning for Indian students, Class 1–12