1. Learn
  2. /
  3. Courses
  4. /
  5. Functions for Manipulating Data in PostgreSQL

Exercise

The TRIM function

In this exercise, we are going to revisit and combine a couple of exercises from earlier in this chapter. If you recall, you used the LEFT() function to truncate the description column to 50 characters but saw that some words were cut off and/or had trailing whitespace. We can use trimming functions to eliminate the whitespace at the end of the string after it's been truncated.

Instructions

100 XP
  • Convert the film category name to uppercase and use the CONCAT() concatenate it with the title.
  • Truncate the description to the first 50 characters and make sure there is no leading or trailing whitespace after truncating.