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

Tables, Rows, and Columns in SQL

Tables organize data into columns, and each row is one record.

A table has a name, like customers. Columns describe the fields available in that table, like first_name or state.

Rows are the records inside the table. In the Garden Shop dataset, each row in customers represents one customer.

Read a table before querying it

Before writing a report query, inspect the table name, the column names, and a few sample rows. That quick scan tells you what each row represents, which columns are identifiers, and which columns are useful for filtering, sorting, or grouping.

Pattern
select count(*) as row_count
from table_name
Schema · Garden Shop Table · customers 9 columns · 20 rows
Table · customers

One row per customer. Some customers have no phone on file.

9 columns · 20 rows
customer_id int first_name text last_name text email text phone text city text state text signup_date date is_active bool
Your task

Count how many rows are in the customers table. Name the output column customer_count.

·

Run your query to inspect the result.

Expected answer
  • Columns: customer_count.
  • Rows: 1 summary row.
  • The customer_count value should be 20.