Skip to content
/Chapter 3 · Select, Filter, and Sort
Lesson 3.1·garden_shop
Lesson 3.1

Choosing Columns in a SQL SELECT

A query result is easier to read when it only includes the columns you need.

The SELECT line controls which columns appear in your result. The shortcut * means "show every column", which is useful for exploring a table.

Once you know what you need, name the columns directly. That keeps results focused and makes your query easier for another person to understand.

Pattern
select column_one, column_two
from table_name
Schema · Garden ShopTable · products9 columns · 24 rows
Table · products

One row per product, with price, cost, and inventory levels.

9 columns · 24 rows
product_id intproduct_name textcategory_id intsupplier_id intprice decimalcost decimalquantity_on_hand intreorder_level intdiscontinued bool
Your task

Show only each product's product name, price, and quantity on hand.

SQL Workbench
query.sqlgarden_shop · SQL engine loading
⌘↵ to run
·
Expected answer
  • Columns: product_name, price, quantity_on_hand.
  • Rows: 24 products.