Analiasis used in SQL to give atemporaryname to a table or column within a query. It makes queries more readable and helps in cases where a table needs to be referenced multiple times (e.g., in aself-join).
Example Usage:
sql
SELECT e.Name, d.DepartmentName
FROM Employees AS e
JOIN Departments AS d
ON e.DeptID = d.ID;
Here,Employees is aliased as eandDepartments as d, making the query shorter and clearer.
Why Other Options Are Incorrect:
Option A (HAVING) (Incorrect):Used to filter grouped results, not create aliases.
Option B (NEW) (Incorrect):Not a valid SQL keyword for aliasing.
Option D (UNION) (Incorrect):Combines result sets but does not rename tables.
Thus, the correct answer isALIAS, which allows fortemporary naming of tables or columns.
[Reference:SQL Aliases and Temporary Naming., ]
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit