Correlated Subquery Lesson: Is there a name for what "f.carrier" is doing?


#1

In lesson 1.5 here I managed to understand this code from this discussion but I'm confused about the idea of "f.carrier".

SELECT id
FROM flights AS f
WHERE distance > (
 SELECT AVG(distance)
 FROM flights
 WHERE carrier = f.carrier);

I've seen periods used in a Ruby class but what exactly is "f.carrier"? Does that action of putting a period in between an alias'ed table and the column name have a name?

From what I understand the action of doing that is allowing us to compare the carrier from "table f" (the one we've created an alias for) to the "flights" table (the non alias version of the table), but what is the action of calling an alias table and the column next to each other with a period called? That is not something I knew you could do in SQL so I want to make sure I understand what it is and learn more about it.

Thanks!
Alexa


#2

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