How many ways,we can create Aliases in Sql Server?

 Posted by vishalneeraj-24503 on 12/5/2014 | Category: Sql Server Interview questions | Views: 1866 | Points: 40
Answer:

We can create Aliases in 2 ways:-
COLUMN ALIASES:- As the name implies, Column Aliases are created at column level,used so show column headings.
TABLE ALIASES:- As the name suggests, Table Aliases are created at Table level,used to shorten the long table names.Basically Table aliases are used for Self Join where we can differentiate same table name with different aliases.

For Example:-
Select First_Name as Name,Designation as Role From Employee_Master Emp;

Here,Name and Role are treated as Column Aliases and Emp will be treated as Table Alias.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response