Table Name Alias

Why do we use alias for the table name? What is its importance?

Questions by AnithaBabu1

Showing Answers 1 - 18 of 18 Answers

It is a shorthand notation.  Easier to use if you have to reference the table over and over.

SELECT * FROM tbl_Long_Table_Name, tbl_Other_Long_Table_Name
WHERE tbl_Long_Table_Name.FieldID=tbl_Other_Long_Table_Name.FieldID
 AND tbl_Long_Table_Name.FieldID=1

Can be done like this:

SELECT * FROM tbl_Long_Table_Name a, tbl_Other_Long_Table_Name b
WHERE a.FieldID = b.FieldID
 AND a.FieldID=1


  Was this answer useful?  Yes

soujanyaj

  • Aug 5th, 2008
 

The Alias name is used as a shorthand notation for the tble name, for example: if there are 2 tables with long name then it will be difficuilt to call that table hence the alias name is used.

table alias name is also used to remove the ambiguity of the column names used in different tables

  Was this answer useful?  Yes

goksn

  • Sep 23rd, 2009
 

-is a shorthand notation
-Will be used along with column name if same colum name present in more than one table (while joining those tables)
-Must in self join

  Was this answer useful?  Yes

  1. Alias is a alternate name given to a table for multiple purposes.
  2. The scope of the Alias is within the query
  3. Alias is used to give short name to the table.
  4. Used when same table is used n number of times in a query. Alias is used in such queries to give unique name to each table reference.



 

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions