Learn
Conditional Aggregates
NULL

While working with databases, it’s common to have empty or unknown “cells” in data tables. For example, in our first flights table, we keep track of when flights arrive in a column called arr_time:

alt text

In this table, the third flight was canceled and therefore did not have an arrive time. We’ll leave this cell empty, which is denoted as NULL.

What do we do when we need to test whether a value is or is not null? We use the special keywords IS NULL or IS NOT NULL in the WHERE clause (= NULL does not work).

Instructions

1.

Count the number of rows from the flights table, where arr_time is not null and the destination is ATL.

Folder Icon

Sign up to start coding

Already have an account?