I am stuck on excersise 2/8, I have no idea how to proceed, how do I select the destination ATL?


#1


https://www.codecademy.com/courses/sql-table-transformation/lessons/conditional-aggregates/exercises/null?action=lesson_resume&link_content_target=interstitial_lesson



Replace this line with your code.


#2

Didn't like it when I used

SELECT count(*)
FROM flights
WHERE arr_time IS NOT NULL
and destination = "ATL";

then liked it when I used just

SELECT count(*)
FROM flights
WHERE destination = "ATL";

Answer happened to be 26 in both cases.

I think this is a bug. Even if arr_time is only ever null if a flight is cancelled, it could still be associated with a destination - we don't know that we needn't check for "arr_time IS NOT NULL" - and not needing to check for something but checking it anyway doesn't technically make the query incorrect, either.


#3

RESULT:

SELECT COUNT(arr_time)
FROM flights
WHERE arr_time IS NOT NULL
AND destination = 'ATL';


#4

Mine works like this:

SELECT count(*)
FROM flights
WHERE arr_time IS NOT NULL
AND destination='ATL';


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.