It's Autumn! Prices fall like leaves! - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Function COUNT
Function AVG
Functions SUM, MAX, MIN
Review

Instruction

Good job! It is less commonly known that you can use COUNT functions with any expression as an argument.

You can write:

SELECT COUNT(price * 2)
FROM project

This query counts the doubled prices. (Yes, the result will be the same as counting single prices.) We will see a real-world usage of this construction later in this section and in the next part of the course.

Exercise

The feedback of 0 doesn't mean anything to agency managers. They want to find out how many projects got meaningful (non-zero) feedback.

Count the number of project with non-zero feedback. Name the column projects_no.

Stuck? Here's a hint!

The function NULLIF(x,y) checks if x equals y and if it does, returns a NULL. Otherwise it returns x.