Skip to content
Justice Tech School

INSERT INTO

INSERT INTO adds a new row. List the column names so the values go to the right place. You can insert several rows in one statement by separating the value lists with commas.

Example
INSERT INTO students (id, name, country, score)
VALUES (9, 'Zuri', 'Kenya', 80);

Result

1 row affected
Example
INSERT INTO courses (id, title, price, level)
VALUES (6, 'Git', 0, 'Beginner'), (7, 'React', 20000, 'Advanced');

Result

2 rows affected

Exercise

Add a new row.

 INTO students (id, name) VALUES (10, 'Sam');

Quiz Test

Why list the column names in an INSERT?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.