Code Academy really has to do a better job with explaining examples, step by step. This is NOT helpful for beginners.
1 Like
thanks a lot for your explanation, I was stuck with âf.id < flights.idâ, I didnât understand why we have to compare them.
this course should be improved a bit of explanation
Add an ORDER BY clause to the end of your query â it may make it easier to understand whatâs going on when looking at the output table. For the initial query that selects âcarrierâ add:
ORDER BY carrier, flight_sequence_number;
Use âoriginâ instead of âcarrierâ for the next query.
This will show the flight sequence, in order, for each airport â a much better visualization of the result.
Hello guys,
try this queryâŚthis would make more sense for all of youâŚ
SELECT carrier,
id,
(SELECT COUNT(*)
FROM flights f
WHERE f.id < flights.id
AND f.carrier=flights.carrier) + 1 AS flight_sequence_number
FROM flights
order by 1,3 desc;
regards.
BP