From the course: Oracle Database 12c: Basic SQL

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Using column aliases

Using column aliases

- [Narrator] We can add column aliases which is a fancy name of saying labels to the output of our SQL query. For example, in the query we have executed in our previous video, we have generated two new calculated columns. Salary after bonus and a bonus column. Note that the actual header value, the column name for both of these columns is not very readable or legible. We can change that by assigning a column alias to be used in the query output. We do that using the AS keyword followed by the new column alias value. So I can type AS and in double quotation marks, type salary plus bonus. And for the second calculated column, I can type AS bonus. Running this query again will generate more legible column names. I can also do that for columns that exist in the Employees table itself. And not just for columns whose values are generated based on calculations. So for example, instead of first_name, I can type AS…

Contents