SkyAICampus
HomePracticeLearnCode LabFocus
SkyAICampus
PrivacyTermssupport@skyaicampus.com© 2026 SkyAI Campus
Log inSign up

Learn

HomePracticeConcept cardsCode LabSky Tutor

Review

Revise todayMistake notebookProgress

Focus

Campus ForestFocus roomsSquads

Questions or feedback?
support@skyaicampus.com

  1. 1SELECT and WHERE
  2. 2Sorting and limits
  3. 3Aggregates and GROUP BY
  4. 4Joins
← SQL basics

Lesson 3 of 4

Aggregates and GROUP BY

Watch, read the card, then practise. COUNT, SUM, AVG · GROUP BY · HAVING

Video coming soon

The video for this lesson is being recorded.

Meanwhile, the notes below and the 60-second cards cover the same ideas.

Practise this topic
  • COUNT, SUM, AVG

    Aggregate functions turn many rows into one number.

    Remember: Aggregates squash all the matching rows into one result.

  • GROUP BY

    GROUP BY splits rows into groups and gives one summary row per group.

    Remember: One output row per group.

  • HAVING

    HAVING filters groups after GROUP BY, the way WHERE filters rows before it.

    Remember: Rows: WHERE. Groups: HAVING.

Try the example in Code Lab

SELECT COUNT(*), MAX(marks), AVG(marks) FROM students;
← Sorting and limitsNext: Joins →

In this lesson

  • COUNT, SUM, AVG
  • GROUP BY
  • HAVING

Practise this topic

5 questions at your level. The best way to make it stick.

Practise 5 questions