strawquery PT
All lessons

Lesson 13 of 30

Working with text

Today at the studio

The studio party is on Friday, and Emi is printing name badges. "I need the name and the role in one line," she says. "And Nagi wants the titles shouted in capitals for the banner."

The idea

SQLite has many functions for text. UPPER(x) and LOWER(x) change the case, LENGTH(x) counts characters, and SUBSTR(x, start, length) cuts a piece. The first character is number 1.

The || operator glues text together: first || ' ' || second. Remember that a number or a missing value in the middle can change the result, so keep gluing to text.

Example

SELECT LOWER(name), LENGTH(role) FROM staff WHERE department_id = 1

Your turn

0 of 4 questions

Question 1 of 4

Show every show title in UPPER case.

Unofficial fan project. Titles belong to their creators and rights holders.