AI Hints
Homeโ€บSQL Tutorialโ€บCreating and Changing Data
SQL ยท Lesson 71 of 126

Adding Rows

INSERT INTO.

โฑ 2 min readโ–ถ Video at 1:40:15๐ŸŽ“ Free
Watch this lesson in the SQL courseWatch on YouTube โ†—Full SQL course

An empty table isn't much use. Helen has three events planned. Let's add them.

Adding Rows
From the video: Adding Rows
  • The table is empty
  • Three events planned
  • Let's add them

INSERT INTO

Insert into, the table name, and the columns you're filling in. Then values, with the data in the same order. We left out event ID, so it's numbered automatically. The second insert adds two rows at once, separated by a comma. And we left out seats, so they get the default. Run it. Three events, numbered one, two, and three. Only the author talk has forty seats.

query.sqlsql
CREATE TABLE events (
    event_id   INTEGER PRIMARY KEY,
    title      TEXT NOT NULL,
    event_date TEXT,
    seats      INTEGER DEFAULT 30
);
INSERT INTO events (title, event_date, seats)
VALUES ('Meet the Author: Ada Obi', '2026-03-14', 40);

INSERT INTO events (title, event_date)
VALUES ('Kids Story Hour', '2026-03-21'),
       ('Poetry Night',    '2026-04-02');

SELECT * FROM events;
Output
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ event_id โ”‚          title           โ”‚ event_date โ”‚ seats โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 1        โ”‚ Meet the Author: Ada Obi โ”‚ 2026-03-14 โ”‚ 40    โ”‚
โ”‚ 2        โ”‚ Kids Story Hour          โ”‚ 2026-03-21 โ”‚ 30    โ”‚
โ”‚ 3        โ”‚ Poetry Night             โ”‚ 2026-04-02 โ”‚ 30    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

INSERT tips

Always list the columns. It makes your insert clear, and it keeps working if someone adds a column later. Text goes in single quotes, numbers don't. And one insert can add many rows at once, which is much faster than one at a time.

List the columnsclear and safe
'Text' in quotesnumbers without
Many rowsone INSERT, commas
Missing columnsget the DEFAULT

Summary

Insert into adds new rows. Next, changing rows that are already there.

Key takeaways
  • INSERT INTO t (cols)
  • VALUES (...), (...)
  • Unlisted columns: DEFAULT
Next up: Changing Rows โ€” UPDATE ... SET