USE OLTP
--Remove spaces
SELECT TRIM(retailer_city) as retailer_city,count(*) as count
FROM sales
GROUP BY TRIM(retailer_city)
ORDER BY 1,2 desc

--Correct 'Lodon'
SELECT REPLACE(trim(retailer_city),'Lodon','London') as retailer_city,count(*) as count
FROM sales
GROUP BY REPLACE(trim(retailer_city),'Lodon','London')
ORDER BY 1,2 desc

--Correct 'Londonn'
SELECT REPLACE(replace(trim(retailer_city),'Lodon','London'),'Londonn','London') as retailer_city,count(*) as count
FROM sales
GROUP BY REPLACE(replace(trim(retailer_city),'Lodon','London'),'Londonn','London')
ORDER BY 1,2 desc

--If there are no more mistakes, our final query will look like this
go
CREATE VIEW sales_view AS
SELECT date
       ,REPLACE(replace(trim(retailer_city),'Lodon','London'),'Londonn','London') as retailer_city
       ,order_method_type,urgent,retailer_type,product_code,sale_price,quantity_sold
FROM sales
go

SELECT * 
FROM sales_view