Why doesn't my lesson:1 code work?


#1

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?


#2

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


#3

I am working on exercise #1.


#4

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


#5

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.


#6

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


#7

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.


#8

you are confusing ROWS with COLUMNS


#9

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

:slight_smile:


#11

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


#12