+-- Update addresses to adhere to OSM's style.
+-- This is largely based off of http://git.io/qM401g
 drop table if exists addresses_final;
 
 -- Create a new final table from our exiting addresses table so we can

    when 'NW' then 'Northwest'
    when 'SW' then 'Southwest'
  end,
  fname = initcap(fname)

create table addresses_final as
  select * from addresses;

-- We're expanding two character abbreviations to full words so we
-- need some extra characters
alter table addresses_final alter column fdpre type varchar(10);
alter table addresses_final alter column fdsuf type varchar(10);
alter table addresses_final alter column ftype type varchar(10);

-- Expand abbreviations in addresses to full words.
-- Also normalize names from NAME to Name where only the initial
-- letter is capitalized.
--
-- Example:
--    29751 SW TOWN CENTER LOOP W becomes Southwest Town Center Loop West
update addresses_final
  set fdpre =
  case fdpre
