Autumn Offers - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Concatenation
Simple text functions
7. The LENGTH() function
Modifying strings
Summary

Instruction

Well done! Now that we know about concatenation, let's learn some string functions. We'll start with a simple one.

The LENGTH() function shows the length of a string column. For example:

SELECT
  first_name,
  LENGTH(first_name) AS len
FROM copywriter;

Suppose that first_name has a value of 'Anne'. LENGTH() will return 4 because 'Anne' has 4 letters. Simple, right?

Exercise

Show the id, text, and string length for every slogan (text) in the slogan table. Name the last column len.

Stuck? Here's a hint!

Use LENGTH(text).