Introduction
Function COUNT
Function AVG
Functions SUM, MAX, MIN
Revision

Instruction

That's it! You may also remember that we can use COUNT with a column name:

SELECT COUNT(name)
FROM client;

What's the difference between COUNT(*) and COUNT(name) in this case? COUNT(*) will count all the rows in the table, but COUNT(name) will skip those rows where name is NULL.

Exercise

Let's see how it works in practice.

Count all the rows in the table project (name the column all_projects), then count those rows where price is not NULL (name the column projects_with_price).

Stuck? Here's a hint!

Use COUNT(*) and COUNT(price), as appropriate.

Console

Code editor

Result

TableConsole