Skip to content
/Chapter 1 · Welcome to the Shed
Lesson 1.2·garden_shop
Lesson 1.2

Your First SQL SELECT Statement

A SELECT query chooses columns from a table and returns a result.

The first SQL pattern to learn is SELECT plus FROM. SELECT says which columns you want, and FROM says which table to read.

LIMIT is useful while learning because it keeps the result small.

Pattern
select column_one, column_two
from table_name
limit 5

When to use SELECT

Use SELECT when you want to inspect data without changing it. A good first query asks for a few named columns from one table, then limits the result so you can check the shape before adding filters, joins, or calculations.

Avoid starting every query with select *. It is useful for quick exploration, but named columns make the result easier to read and keep later reports from breaking when a table changes.

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 each product's product name and price. Keep the result to the first 5 rows.

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