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

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/sql-table-transformation/lessons/conditional-aggregates/exercises/null?action=lesson_resume&link_content_target=interstitial_lesson

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>

<In this course, it often helps to include a screenshot of your whole web browser – that lets everyone see what you see. If you wish to include a screenshot, add it below this line.>

<If you wish to copy/paste in your code, you can use this next section. This will allow others to copy/paste your code for testing – something that they won’t be able to do with just a screenshot.>

```

Replace this line with your code.

<do not remove the three backticks above>

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.

RESULT:

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

Mine works like this:

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

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