Section 1 - Instruction

Welcome to aggregate functions! These are SQL's powerful tools for summarizing data across multiple rows. Instead of seeing every individual row, you get totals, counts, and summaries.

Think of them like a calculator that works on entire columns of data at once.

Engagement Message

When might you need to count or sum data in your work?

Section 2 - Instruction

Let's start with COUNT, the most basic aggregate function. COUNT tells you how many rows match your criteria. It's like asking "How many customers do I have?"

COUNT(*) counts all rows, while COUNT(column_name) counts only non-null values in that column.

For example, imagine a customers table like this:

customer_idnameemail
1Alicealice@email.com
2BobNULL
3Carolcarol@email.com

If you run:

You get:

total_rowsemails_provided
32

This counts all customers and also counts only those with an email address.

Engagement Message

Can you name one column you might pass to COUNT(column_name) to ignore NULLs?

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal