Skip to content
/ Chapter 2 · Data Types Before Deep Querying
Lesson 2.3 · garden_shop
Lesson 2.3

Why SQL Strings Need Quotes

Text columns store words and codes. Literal text values must be wrapped in quotes.

String columns hold text: names, cities, states, emails, statuses, and other labels. When you compare a column to a text value, put the value in single quotes.

Without quotes, SQL thinks the value is a column name or keyword. That is why state = PA is different from state = 'PA'.

Pattern
select text_column, another_column
from table_name
where text_column = 'exact text value'
order by text_column
Schema · Garden Shop Table · suppliers 4 columns · 6 rows
Table · suppliers

One row per supplier. Some suppliers have no contact email.

4 columns · 6 rows
supplier_id int supplier_name text contact_email text state text
Your task

Fix the query so it returns the supplier name and state for suppliers in PA, sorted by supplier name.

·

Run your query to inspect the result.

Expected answer
  • Columns: supplier_name, state.
  • Rows: 2 Pennsylvania suppliers.
  • The suppliers should be Ironwood Tools and RootWorks Supply.