skip to today's puzzle

Text values go inside single quotes

A piece of text in SQL is called a string, and a string is written inside single quotes: 'Lisbon'. The quotes tell the database this is text, not the name of a column. Numbers need no quotes. Write the string exactly as it is stored, capital letters and all — whether 'lisbon' matches 'Lisbon' depends on the database and its settings, so matching the stored spelling is the safe habit.

A tiny example

In plain English: Show me the names of the cafés in Lisbon.

SELECT name, city
FROM cafes
WHERE city = 'Lisbon';

Query result

namecity
Sunny CupLisbon
Corner BeanLisbon

Sunny Cup and Corner Bean are the only cafés whose city is stored as exactly 'Lisbon'.

Related SQL lessons

Ready for a break?

A fresh, bite-sized SQL puzzle waits every morning. Tap tiles, see real results. No terminal, no setup, no timers.

Try today's free SQL puzzle