


When I code:
select name, surface_area, population, (population / surface_area)
from world.country
where continent = 'Africa'
and surface_area > 1000000
and population > 10000000


I have a computed column in the results: 
(population / surface_area)


I can give that column an Alias (a temp name)
select name, surface_area, population, (population / surface_area) as density
from world.country
where continent = 'Africa'
and surface_area > 1000000
and population > 10000000

Now that I have named it...
I can use that name in a sort

select name, surface_area, population, (population / surface_area) as density
from world.country
where continent = 'Africa'
and surface_area > 1000000
and population > 10000000
order by density

the keyword 'as' is not required:
select name, surface_area, population, (population / surface_area) density
from world.country
where continent = 'Africa'
and surface_area > 1000000
and population > 10000000
order by density

If I want spaces in my alias I MUST use "


-------------------------------------------------------

In addition to column aliases, I have table alises

for example:
select world.city.name, world.country.name, world.country.continent
from world.city 
  join world.country 
  on world.city.country_code = world.country.code
  where world.city.country_code = 'JPN'
  
I can shortcut this code like this:

select c1.name, c2.name, c2.continent
from world.city c1
  join world.country c2
  on c1.country_code = c2.code
  where c1.country_code = 'JPN'
  
  a Table alias cannot use the keyword 'as'
  a column alias can
