If I have query
SELECT FNAME, CNAME
FROM FACULTY F, COURSES C
WHERE F.FID=C.FID
AND COURSES.FID='F04';
so can i use COURSES.FID
or once alias is there I should use only that.
though I am getting error if I am using table name instead of alias. Is it expected output?
2
Answers
yes, it doesn’t conflict with any other aliases, you can use any aliases.
but in your query, you should refer to columns from the COURSES table using the alias C. For this reason, in your query, you should use C.FID rather than COURSES.FID.
Any of the both AliasName.ColName or TableName.ColName can be used. No change in the result or performance.