I don't understand this exercise at all and am completely lost. I understand what we are trying to accomplish, but the example given is very vague. Can somebody please give a line-by-line break down in simple terms?
Note, I'm referring to the code from the example given and NOT from what they are asking us to do
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 flight_sequence_number;
Replace this line with your code.