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.
insert into customers (customer_id, first_name, last_name)
values (21, 'Robin', 'Vale');
select * from customers where customer_id = 21;Schema · Garden ShopTable · products9 columns · 24 rows
One row per product, with price, cost, and inventory levels.
Add a new product, then confirm it. Insert a row intoproducts 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. ThenSELECTproduct_id, product_name, and price for product 25.
- Columns: product_id, product_name, price.
- Rows: 1, the product you just inserted.
- product_id 25 is 'Window Herb Kit' at price 24.