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.
💻 Live Code Editor
This page's programs are ready here — run them, edit them, and learn. No installation needed.
Powered by OneCompiler. The code loads into the editor automatically — press Run to see the output. If the editor does not open, open it in a new tab.