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
Tak for dine kommentarer!
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Can you explain this in simpler terms?
What are the main benefits or drawbacks?
Can you give me a real-world example?
Fantastisk!
Completion rate forbedret til 2.86
Challenge: Clean Up City Names
Stryg for at vise menuen
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
Tak for dine kommentarer!
single