Does SQL use tuple variables, mainly used to preserve typing?

In the following statement:

SELECT CUSTOMER_NAME, T.LOAN_NUMBER, S.AMOUNT FROM BORROWER AS T, LOAN AS S WHERE T.LOAN_NUMBER = S.LOAN_NUMBER 

So, are the tuple variables here T and S?

+4
source share
1 answer

They are useful for saving input, but there are other reasons for using them:

  • If you join a table, you must specify two different names, otherwise the link to the table will be ambiguous.
  • It is useful to give names to views, and on some database systems it is required ... even if you never refer to the name.

As for the name, the "tuple" comes from the idea that the string is a tuple of values, for example. (1, 'Fred', 1400) . However, I do not know why it is called a variable, because after that it cannot be changed. I do not think this is a particularly common term to describe this function. SQL standards refer to them as correlation names. When looking at core databases, they all use a different term instead:

+7
source

All Articles