Best April deals - hours only!Up to 80% off on all courses and bundles.-Close
Simple text functions
Modifying strings
19. The REPEAT() function


Fantastic! The last function in this section is REPEAT(). It repeats a string (given in the first parameter) however many times specified by the second parameter. Here's an example:

SELECT REPEAT('.', 3) || name
FROM item;

This query returns the item name with three periods in front of it. Let's try this function out!


Slogans with multiple star and dot characters (e.g., SLOGAN *.*.*.*.*.) are fashionable this season. The marketing agency management has decided to change all slogans' texts to add at the end a space and a chain of five '.**.'. Name the column fashionable_text.

Stuck? Here's a hint!

You will need the following expression:

text || ' ' || REPEAT('.**.',5)