1. Aggregate Functions Revisited


#1

In this snippet I dont understand what the "f" does after flights. Is it similar to using "AS" ?

SELECT origin, id,
(SELECT COUNT(*)
FROM flights f
WHERE f.id < flights.id
AND f.origin=flights.origin) + 1
AS flight_sequence_number
FROM flights;


#2

@mdz5032gmail.com,
With
flight f
you are creating a so-called table-alias
http://stackoverflow.com/questions/7367548/sqlite-table-aliases-effecting-the-performance-of-queries

With
select name as "firstname" from myDatabase;
the
name as "firstname"
is the usage of a column-Alias
http://stackoverflow.com/questions/5225925/sqlite-alias-column-name-cant-contains-a-dot


#3