Correlated subquery, why "flights as f"?


#1


I know a correct solution

select id from flights as f
where distance < (
select avg(distance) from flights
where f.carrier = carrier);


but why alias "flights"? If I put the following, then it's incorrect.

select id from flights
where distance < (
select avg(distance) from flights
where flights.carrier = carrier);



Replace this line with your code.


#2

To pass the SCT you must select flights as f,


#3

Thanks, but what is "SCT", is it "Subroutine Call Table"?


#4

I guess that I see what you mean by "SCT". Is it "Subqueries Correlated Table"?


#5

No, Submission Correctness Test is what Codecademy uses to evaluate if the code you wrote is correct according to the instructions given. :slight_smile:


#6

Oh, okay, thanks, I get it now. I thought Codecademy evaluates code only according to results.


#7

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