suppose we have course records in database. what is the point using this:
select k.ID from course k
and not this, (straight):
select course.ID
CodePudding user response:
The case is when you do not have a degenerate simplistic edge case (which, agreed, is not really an edge case here).
Imagine you have joined course TWICE (or more). Been there, seen that. How do you think SQL will distinguish between both "course" instances? course.ID may suddenly not be unique - after all, there are now 2 (or more) course tables joined in in the from clause, with different join conditions.
Exactly. You NAME them in the FROM, then you can use the now unique identifier.
And yes, I have been in situations where I had to join the same table multiple times.
So, as you can see, there is a use case.