Sql Query To Use a ' SELECT ' statement with Alias or 'AS"


To create a short name for a long column or table name temporarily. Then we can use an ' AS ' statement or Alias.

This is mainly used in joins,i.e when using two tables. Suppose the two tables have the same column name ( for e.g id), then it can easy to identify if Alias is used with the column name.

Enter - Select * from table_name;
SQL Query
SELECT e.employee_id,e.first_name,e.email,jh.start_date,jh.end_date FROM employees AS e inner join job_history AS jh WHERE e.employee_id = jh.employee_id;
Output