Why doesn't my lesson:1 code work?

This is my code:
~SELECT DISTINCT id FROM flights;
SELECT DISTINCT carrier FROM flights;
SELECT DISTINCT origin FROM flights;
SELECT DISTINCT destination FROM flights;
SELECT DISTINCT flight_num FROM flights;
SELECT DISTINCT flight_time FROM flights;
SELECT DISTINCT tail_num FROM flights;
SELECT DISTINCT dep_time FROM flights;
SELECT DISTINCT arr_time FROM flights;
SELECT DISTINCT dep_delay FROM flights;~
Why doesn’t this work?

1 Like

Could you confirm which exercise it is that you are working on?

1 Like

I am working on exercise #1.

You’ve got 10 separate queries there. Try running one of them to see what the output is.

You should find that it doesn’t get close to doing this:

Select ten rows from the flights table.

Have you done this course yet? https://www.codecademy.com/learn/learn-sql

I have this code:
SELECT id,carrier,origin,destination,flight_num,flight_time,tail_num,dep_time,arr_time,dep_delay FROM flights;
but it is still wrong.

Remember back in this exercise when we learned about how to limit the number of rows we retrieved?

1 Like

Well that was a rough start. I also assumed that to limit it to 10 rows you needed to specify what 10 rows but you don’t.

2 Likes

you are confusing ROWS with COLUMNS

Ahhh, that explains a lot, I just couldn’t understand why all the column names were being specified – :eyeglasses:

:slight_smile:

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