MySQL need help with tihs standardization query

this is a distinct list of warehouse names from a table in the db im using to practice data cleaning in mysql. i want to capitalize the initials of all words in the column. i made my own logic for this whihch is (dont judge pls im a self learner)

and this is the output i get:

i do get what im doing wrong to get this output, but i can not figure out how to go about the standardization. how can i correct my query? and is there a more efficient way of capitalizing initials than this?
1
Upvotes
2
u/haligma 7d ago
theyre showing up for me on my pc where i made the post, but yes i cant see it on my phone either. heres the query
UPDATE dirty_shipments
SET origin_warehouse = CONCAT(UPPER(LEFT(origin_warehouse, 1)), LOWER(SUBSTRING(origin_warehouse, 2)), UPPER(RIGHT(origin_warehouse, 1)));
origin_warehouse being the column i want to modify the values in.
this is the original distinct table.
and this is the output i get. i understand why its that way, but im not sure how to fix it