Skip to content
/ Chapter 8 · Changing Data and Tables
Lesson 8.2 · garden_shop
Lesson 8.2

Adding Rows with SQL INSERT

INSERT adds new rows. Name the columns, supply matching values, then SELECT to confirm.

INSERT adds new rows. List the columns you're filling, then provide a value for each in the same order. Naming the columns explicitly instead of relying on table order keeps the statement readable and resilient.

Then do what every careful person does after a change: SELECT the row back to confirm it's really there. This exercise runs against a fresh copy each time you click Run, so you can insert as many times as you like.

Pattern
insert into customers (customer_id, first_name, last_name)
values (21, 'Robin', 'Vale');

select * from customers where customer_id = 21;
Schema · Garden Shop Table · products 9 columns · 24 rows
Table · products

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

9 columns · 24 rows
product_id int product_name text category_id int supplier_id int price decimal cost decimal quantity_on_hand int reorder_level int discontinued bool
Your task

Add a new product, then confirm it. Insert a row into products with product_id 25, name 'Window Herb Kit', category 2, supplier 6, price 24.00, cost 11.00, 30 on hand, reorder level 10, and not discontinued. Then SELECT product_id, product_name, and price for product 25.

·

Run your query to inspect the result.

Expected answer
  • Columns: product_id, product_name, price.
  • Rows: 1, the product you just inserted.
  • product_id 25 is 'Window Herb Kit' at price 24.