×

sql · level 1 · unit 2 · lesson 2

  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

goes inside . Numbers do not.

To find pets by species, you compare with text. Text in SQL goes inside single quotes, like 'cat'. The quotes show where the text starts and stops.

Numbers, like 3, need no quotes. Leave the quotes off text, though, and cat looks like a column name. The database goes looking for a column called cat.

Text must match exactly, so 'Cat' with a capital C finds nothing. Forget the closing quote and the text never ends, so you get unrecognized token.

SELECT name, age FROM pets WHERE species = 'cat';

Use single quotes ' round text in SQL, not double quotes.