Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases Reporting with SQL Aggregate and Numeric Functions Review: Aggregate and Numeric Functions

SELECT COUNT(platform) FROM games

There is a question asking what the following line evaluates to:

SELECT COUNT(platform) FROM games;

Since the table has 4 rows, it should be 4. However when I enter this, it says FALSE. How can this be?

1 Answer

andren
andren
28,558 Points

4 is wrong because 2 of the rows contain NULL, which is the absence of data. NULL is not counted by the COUNT function as a value. So the result of that query would actually be 2.

This behavior was mentioned in the Counting Results lecture at the start of this section of the course.

I forgot that completely, thanks a lot!