From the course: Oracle Database 19c: Basic SQL

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Column aliases

Column aliases

From the course: Oracle Database 19c: Basic SQL

Start my 1-month free trial

Column aliases

- [Instructor] When your SQL statements and in particular your SELECT statements get complex and less readable due to numerous expressions in your SELECT statements you can assign column aliases. I'll go through a few scenarios where a column aliases are desirable, if not required. The syntax for using an alias is straight forward. The slide shows the SELECT syntax and where you put the alias if any. I'm going to demonstrate how aliases work with a couple of examples. This query shows an employee's formatted last name, their salary and their salary with a 20% raise. I go ahead and run it. And the output's right but the column names are not very descriptive. I'll take the same query but I'll add aliases to each of the expressions. I'll use full_name for the first expression and I'll use proposed_salary for the second expression and I'll put it on another line. I press on F9. Ah, looks much better. Columns much more descriptive. Notice how SQL developer color-codes column aliases…

Contents