Challenge: Clean Up City Names
Swipe to start coding
Practice using string functions to clean up city names in the customers table. Your goal is to remove any leading or trailing spaces from each city name and ensure the first letter is uppercase while the remaining letters are lowercase.
- Use the
TRIMfunction to remove any leading or trailing spaces from thecitycolumn. - Use string functions to capitalize only the first letter of the city name.
- Convert the rest of the city name to lowercase.
- Return the columns
id,name,email, and the cleaned-up city name ascleaned_city.
Lösning
Tack för dina kommentarer!
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Can you explain this in simpler terms?
What are the main benefits or drawbacks?
Can you give me a real-world example?
Fantastiskt!
Completion betyg förbättrat till 2.86
Challenge: Clean Up City Names
Svep för att visa menyn
Swipe to start coding
Practice using string functions to clean up city names in the customers table. Your goal is to remove any leading or trailing spaces from each city name and ensure the first letter is uppercase while the remaining letters are lowercase.
- Use the
TRIMfunction to remove any leading or trailing spaces from thecitycolumn. - Use string functions to capitalize only the first letter of the city name.
- Convert the rest of the city name to lowercase.
- Return the columns
id,name,email, and the cleaned-up city name ascleaned_city.
Lösning
Tack för dina kommentarer!
single