×

sql · level 1 · unit 4 · lesson 4

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

Tap a green word if you get lost.

meet it

Glue text with and change it with functions.

|| glues values together. name || ' the ' || species turns Rex and dog into Rex the dog. Spaces only appear if you put them inside the quotes.

A is a named command. You give it a value in brackets and it hands back a new one. UPPER(name) gives the name in capitals.

LOWER() gives small letters, and LENGTH() counts the letters. Give the result a name with AS, or the top line shows the whole thing.

SELECT name || ' the ' || species AS pet FROM pets;

Functions work inside WHERE too, like WHERE LENGTH(name) > 4.