SQL As

SQL AS is used to assign temporarily a new name to a column of a table.

It just temporarily changes the table’s columns name and it makes the user make the easy presentation without changing the names of columns.

The syntax of SQL AS is

SELECTcolumn_name AS “new_name”
FROMtable_name;

 

Example:

Let us take a Customer table Example

Day-of-order Customer_Name Product Quantity
11-02-16 Bhargav Mobile Phone 3
12-03-16 Varun Helmet 5
26-06-16 Nithin Keyboard 10

 

SELECT Day-of-order AS “Date”,
Customer_NameAS “Name”,
Product , Quantity
FROM Customers;

 

The output will be displayed as

Date Name Product Quantity
11-02-16 Bhargav Mobile Phone 3
12-03-16 Varun Helmet 5
26-06-16 Nithin Keyboard 10


SQL ALIAS can be used instead of SQL AS.