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 ShopTable · suppliers4 columns · 6 rows
Table · suppliers

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

4 columns · 6 rows
supplier_id intsupplier_name textcontact_email textstate text
Your task

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

SQL Workbench
query.sqlgarden_shop · SQL engine loading
⌘↵ to run
·
Expected answer
  • Columns: supplier_name, state.
  • Rows: 2 Pennsylvania suppliers.
  • The suppliers should be Ironwood Tools and RootWorks Supply.