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
Is page ki language (MYSQL) mein code likhein aur turant chalाएं — yahीं, bina kuch install kiye.Powered by OneCompiler. Agar editor na khule to yahान naye tab mein kholein.
💻 Live Code Editor
Is page ke program yahan ready hain — chalाएं, badlें aur seekhें. Bina kuch install kiye.
Powered by OneCompiler. Editor mein code apne aap aa jata hai — Run dabaakर output dekhें.
Agar load na ho to naye tab mein kholें.