MySQL + SQL · Lesson 43
INSERT Multiple Rows in MySQL
Insert Many Rows at Once
INSERT INTO students (roll_no, name, marks) VALUES
(1, 'Aman', 88),
(2, 'Riya', 91),
(3, 'Karan', 76);3 rows inserted with one statement — faster than three separate INSERTs.
INSERT ... SELECT
Copy rows from one table into another:
INSERT INTO toppers (name, marks)
SELECT name, marks FROM students WHERE marks >= 90;
Summary
- List multiple value groups separated by commas for bulk insert.
- INSERT ... SELECT copies matching rows from another table.