In this code I am not understanding why the text that is surrounded by "**" is needed. Why are we calling the table f? Then why are we saying "Where carrier = f.carrier"? All this code occurs in the same table so I don't understand the need for it. It is basically saying this column is equal to the same column, right?
SELECT id FROM flights **AS f** WHERE distance > ( SELECT AVG(distance) FROM flights **WHERE carrier = f.carrier)**;