--Question 1
--a. Modify the datatypes of the following columns in the products column
--The code column should be char(15)
--The producct_line should be char(120)
--the product_cost should be money

ALTER TABLE ##Products ALTER COLUMN code char(15) --change size to char(5)
ALTER TABLE ##Products ALTER COLUMN product_line char(120) --change datatype to char(120)
ALTER TABLE ##Products ALTER COLUMN product_cost money 

--Question 2
--Fixing data errors
--We can modify the data in our temporary tables using the same commands we would use to update normal
--data For example:

--Profiling (as before)
SELECT retailer_city,count(*) as count
FROM ##sales
GROUP BY retailer_city
ORDER BY 1,2 desc

--Get rid of spaces
UPDATE ##sales
SET retailer_city=trim(retailer_city)

--Correct 'Lodon', 'Londonn'
UPDATE ##sales
SET retailer_city='London'
WHERE retailer_city in ('Lodon', 'Londonn')

--Check profile again
SELECT retailer_city,count(*) as count
FROM ##sales
GROUP BY retailer_city
ORDER BY 1,2 desc